function is_role_authenticate($array) { global $GeneralObj, $site_url; if (!@in_array($this->params['file'], $this->parent_allow_module_array)) { $allow = false; if (count($array) > 0) { $session_data = $this->Auth->getAuthIdentity(); foreach ($array as $key => $data) { if ($session_data[$key] == $data) { $allow = true; break; } } } else { echo $allow = true; exit; } if ($allow == false) { $arr = array(); $this->Auth->setAuthIdentity($arr); $msg = "Sorry! You are unauthorize to access this location."; $GeneralObj->setError_Message($msg, 'err', 'login_err_id'); if ($array['sess_eUserType'] == "Jobseeker") { http_redirects($site_url . "jobseeker_login"); } elseif ($array['sess_eUserType'] == "Recruiter") { http_redirects($site_url . "recruiter_login"); } else { http_redirects($site_url); } } } }
<?php if ($_SESSION['sess_auth']['sess_iMemberId'] == "") { if ($params['pass']['0'] != $_SESSION['sess_auth']['enc_iMemberId']) { $msg = "You are not authorised to view this page."; $GeneralObj->setError_Message($msg, 'logout-msg', 'login_err_id'); http_redirects($site_url . "content/register/"); } else { $msg = "You are not authorised to view this page."; $GeneralObj->setError_Message($msg, 'logout-msg', 'login_err_id'); http_redirects($site_url . "content/register/"); } } else { if ($params['pass']['0'] != '') { if ($params['pass']['0'] != $_SESSION['sess_auth']['enc_iMemberId']) { $msg = "You are not authorised to view this page."; $GeneralObj->setError_Message($msg, 'logout-msg', 'login_err_id'); http_redirects($site_url . "content/register/"); } } } if ($params['module'] == "content") { $msg = "You are not authorised to view this page."; $GeneralObj->setError_Message($msg, 'logout-msg', 'login_err_id'); http_redirects($site_url); }