File manager - Edit - /home/wwwroot/camplus.hk/master.camplus.hk/public_html/application/core/MY_Controller.php
Back
<?php class MY_Controller extends MX_Controller { public $allowedActions = array(); public $assertion = TRUE; public static $currentModule; function __construct() { parent::__construct(); if(empty(static::$currentModule)){ static::$currentModule = $this->router->fetch_module(); } //$this->data['allDepartmentsForSidebar'] = Modules::run('core/getDepartments'); $this->data['siteSettings'] = Modules::run('core/get_site_settings'); //use in apprisal start //use in sidebar $this->data['ebSettings'] = Modules::run('core/getEBSettings'); $this->data['currentModule'] = static::$currentModule; $siteModules = unserialize($this->data['siteSettings']['modules']); $this->data['siteModules'] = $siteModules; if(!in_array(static::$currentModule, $siteModules['modules'])) show_error('This module is currently disabled!'); // if($this->session->userdata('id')) // { // $sessionUserRoles = $this->User_model->sessionUserRoles(); // $rolesArr = array(); // foreach($sessionUserRoles as $role){ // $rolesArr[] = $role['role']; // } // if(in_array('Applicant', $rolesArr)) // $this->data['isApplicant'] = 1; // else // $this->data['isApplicant'] = 0; // if(in_array('Clerk', $rolesArr)) // $this->data['isClerk'] = 1; // else // $this->data['isClerk'] = 0; // } if(isset($_COOKIE['remember_me'])) { if(!$this->session->userdata("user_id")){ $this->User_model->set_cookie_session(); } } if(isset($_COOKIE['language'])){ $this->lang->load('site', $_COOKIE['language']); $cookie = array( 'name' => 'language', 'value' => $_COOKIE['language'], 'expire' => '86500' ); $this->input->set_cookie($cookie); } else { $this->lang->load('site', 'en'); $cookie = array( 'name' => 'language', 'value' => 'en', 'expire' => '86500' ); $this->input->set_cookie($cookie); } } function allow(){ $this->allowedActions = array_merge($this->allowedActions, func_get_args()); } function assert($msg){ if($this->assertion){ echo '<pre>'; throw new Exception($msg); echo '</pre>'; exit; } } }
| ver. 1.4 |
Github
|
.
| PHP 7.2.34 | Generation time: 0.15 |
proxy
|
phpinfo
|
Settings