예제 #1
0
 function __construct($check_active = TRUE)
 {
     parent::__construct();
     $this->load->library('migration');
     if (!$this->migration->current()) {
         //			show_error($this->migration->error_string());
         return false;
     }
     $nts_config = HC_Lib::nts_config();
     if (isset($nts_config['FORCE_LOGIN_ID'])) {
         $id = $nts_config['FORCE_LOGIN_ID'];
         $this->auth->login($id);
     }
     if ($check_active) {
         $user = $this->auth->user();
         $user_active = 1;
         if ($user && $user->id) {
             $user_active = $user->active;
         }
         if (!$user_active) {
             $to = 'auth/notallowed';
             $this->redirect($to);
             exit;
         }
     }
 }
예제 #2
0
파일: test.php 프로젝트: RCMmedia/rubicon
 function __construct()
 {
     parent::__construct();
     if (defined('NTS_DEVELOPMENT')) {
         $this->output->enable_profiler(TRUE);
     }
 }
예제 #3
0
 function __construct($user_level = 0)
 {
     parent::__construct();
     $this->load->library('migration');
     if (!$this->migration->current()) {
         //			show_error($this->migration->error_string());
         return false;
     }
     $nts_config = HC_Lib::nts_config();
     if (isset($nts_config['FORCE_LOGIN_ID'])) {
         $id = $nts_config['FORCE_LOGIN_ID'];
         $this->auth->login($id);
     }
     if (!$this->auth->check()) {
         $this->redirect('auth/login');
         exit;
     }
     /* check user active */
     $user_active = 0;
     if ($test_user = $this->auth->user()) {
         $user_active = $test_user->active;
     }
     if (!$user_active) {
         $to = 'auth/notallowed';
         $this->redirect($to);
         exit;
     }
     /* check user level */
     if ($user_level) {
         $this->check_level($user_level);
     }
     /* check license code */
     if ($this->hc_modules->exists('license')) {
         $license_model = HC_App::model('hitcode_license');
         $code = $license_model->get();
         if (!$code) {
             $to = 'license/admin';
             $current_slug = $this->get_current_slug();
             if ($current_slug != $to) {
                 $this->session->set_flashdata('error', 'license_code_required');
                 $this->redirect($to);
                 exit;
             }
         }
     }
 }