D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
www
/
cas
/
application
/
libraries
/
util
/
Filename :
URLValidator.php
back
Copy
<?php /** * Library Class For Handling All URL Request Validation * * @author Softpro India Pvt. Ltd. */ defined('BASEPATH') OR exit('No direct script access allowed'); class URLValidator { public static function isURLAuthenticated($current_url) { $CI = & get_instance(); $CI->load->library('session'); $slugData = $CI->session->userdata("slugData"); $current_slug = substr($current_url, strripos(substr($current_url, 0, strripos($current_url, "/")), "/")); for($i=0;$i<sizeof($slugData);$i++){ if(stripos($slugData[$i],$current_slug)){ return true; } } return false; } public static function isAccessGranted() { $CI = & get_instance(); $slugData = $CI->session->userdata("slugData"); if ($CI->router->fetch_method() == "index") { if (in_array($CI->router->fetch_class(), $slugData)) { return true; } else { return false; } } else { if (in_array($CI->router->fetch_class() . "/" . $CI->router->fetch_method(), $slugData)) { return true; } else { return false; } } } }