D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
www
/
cas
/
application
/
libraries
/
util
/
Filename :
SessionValidator.php
back
Copy
<?php /** * Library For All Util Tasks Related To Sessions * * @author Softpro India Pvt. Ltd. */ defined('BASEPATH') OR exit('No direct script access allowed'); class SessionValidator { public static function isLoggedIn() { $CI = & get_instance(); $adminData = $CI->session->userdata("adminData"); if ($adminData != NULL) { if ($adminData['logged_in']) { return true; } else { return false; } } else { 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; } } } public static function isStudentLoggedIn() { $CI = & get_instance(); $studentData = $CI->session->userdata("studentData"); if ($studentData != NULL) { if ($studentData['logged_in']) { return true; } else { return false; } } else { return false; } } }