function __construct()
 {
     parent::__construct();
     $app = $this->config->item('nts_app');
     $app_conf = HC_App::app_conf();
     if (isset($GLOBALS['NTS_CONFIG'][$app]['FORCE_LOGIN_ID'])) {
         $id = $GLOBALS['NTS_CONFIG'][$app]['FORCE_LOGIN_ID'];
         $this->auth->login($id);
     }
     // sync user account
     $ri = $this->remote_integration();
     if ($ri) {
         $id = $this->auth->check();
         if ($id) {
             $model_name = $ri . '_User';
             $um = HC_App::model($model_name);
             $um->sync($id);
             $this->auth->reset_user();
         }
     }
     // check user level
     $user_level = 0;
     $user_id = 0;
     if ($this->auth->check()) {
         if ($test_user = $this->auth->user()) {
             $user_id = $test_user->id;
             $user_level = $test_user->level;
         }
     }
     if ($ri) {
         $wall_schedule_display = 0;
     } else {
         $wall_schedule_display = $app_conf->get('wall:schedule_display');
     }
     $allowed = FALSE;
     switch ($user_level) {
         case 0:
             if ($wall_schedule_display <= $user_level) {
                 $to = 'list';
             } else {
                 if ($user_id) {
                     $to = 'auth/notallowed';
                 } else {
                     $to = 'auth/login';
                 }
             }
             break;
         case USER_HC_MODEL::LEVEL_ADMIN:
         case USER_HC_MODEL::LEVEL_MANAGER:
             $to = 'list';
             break;
         case USER_HC_MODEL::LEVEL_STAFF:
             $to = 'listme';
             break;
     }
     $this->redirect($to);
     exit;
 }
Example #2
0
 function __construct()
 {
     parent::__construct();
     $this->form_add_time = HC_Lib::form()->set_input('time', 'timeframe', array('start' => 'start', 'end' => 'end'))->set_input('date', 'recurring_date');
     if ($this->hc_modules->exists('shift_groups')) {
         $this->form_add_time->input_call('date', 'set_enabled', array(array('single', 'recurring')));
     } else {
         $this->form_add_time->input_call('date', 'set_enabled', array(array('single')));
     }
     $this->form_confirm = HC_Lib::form()->set_input('status', 'radio');
 }
Example #3
0
 function __construct()
 {
     parent::__construct();
     if (($test_user = $this->auth->user()) && $test_user->id) {
     } else {
         $this->fix['filter'] = NULL;
     }
     $acl = HC_App::acl();
     if ($this->hc_modules->exists('shift_groups')) {
         $this->form = HC_Lib::form()->set_input('action', 'hidden')->set_input('id', 'checkbox_set')->set_input('ids', 'hidden');
     }
 }
Example #4
0
 function __construct()
 {
     parent::__construct();
     $note = HC_App::model('note');
     $this_user = $this->auth->user();
     if ($this_user->level > $this_user->_const('LEVEL_MANAGER')) {
         $access_levels = array($note->_const('LEVEL_EVERYONE') => HCM::__('Everyone'), $note->_const('LEVEL_ALL_USERS') => HCM::__('Logged In Users'), $note->_const('LEVEL_OWNER') => HCM::__('Owner'), $note->_const('LEVEL_ADMIN') => HCM::__('Admin'));
     } else {
         $access_levels = array($note->_const('LEVEL_OWNER') => HCM::__('Owner'));
     }
     $this->access_levels = $access_levels;
 }
Example #5
0
 function __construct()
 {
     parent::__construct(FALSE);
     $ri = HC_Lib::ri();
     $app = $this->config->item('nts_app');
     if ($ri) {
         $user_id = 0;
         if ($test_user = $this->auth->user()) {
             $user_id = $test_user->id;
         }
         if (!$user_id) {
             Modules::run($ri . '/auth/login');
         }
     }
 }
Example #6
0
 function __construct()
 {
     parent::__construct();
     $this->form_add = HC_Lib::form()->set_input('user', 'hidden')->set_input('type', 'radio')->set_input('date', 'recurring_date', array('date_start' => 'date', 'date_end' => 'date', 'details' => 'date'))->set_input('time', 'timeframe', array('start' => 'start', 'end' => 'end'));
 }
Example #7
0
 function __construct()
 {
     parent::__construct();
     $this->form_edit = HC_Lib::form()->set_input('status', 'radio')->set_input('date', 'date')->set_input('time', 'timeframe', array('start' => 'start', 'end' => 'end'))->set_input('user', 'hidden')->set_input('location', 'hidden');
 }
Example #8
0
 function __construct()
 {
     parent::__construct();
 }
Example #9
0
 function __construct()
 {
     parent::__construct();
     $this->form_edit = HC_Lib::form()->set_input('email', 'text');
     $this->form_password = HC_Lib::form()->set_input('password', 'password')->set_input('confirm_password', 'password');
 }