PluginProbe
ShiftController Employee Shift Scheduling / 2.2.5
ShiftController Employee Shift Scheduling v2.2.5
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / happ / application / core / Backend_controller.php

Backend_controller.php in ShiftController Employee Shift Scheduling 2.2.5, at happ/application/core/Backend_controller.php

54 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 class Backend_controller extends MY_Controller
3 {
4 function __construct( $user_level = 0, $default_path = '' )
5 {
6 parent::__construct();
7
8 $this->load->library('migration');
9 if ( ! $this->migration->current()){
10 // show_error($this->migration->error_string());
11 return false;
12 }
13 $this->load->library( 'conf/app_conf' );
14 $this->load->library( 'hc_time' );
15 $this->load->library( 'hc_form' );
16
17 $app = $this->config->item('nts_app');
18
19 if( isset($GLOBALS['NTS_CONFIG'][$app]['FORCE_LOGIN_ID']) )
20 {
21 $id = $GLOBALS['NTS_CONFIG'][$app]['FORCE_LOGIN_ID'];
22 $this->auth->login( $id );
23 }
24
25 if ( ! $this->auth->check() )
26 {
27 ci_redirect('auth/login');
28 exit;
29 }
30
31 /* check user active */
32 $user_active = 0;
33 if( $test_user = $this->auth->user() )
34 {
35 $user_active = $test_user->active;
36 }
37
38 if( ! $user_active )
39 {
40 $to = 'auth/notallowed';
41 ci_redirect( $to );
42 exit;
43 }
44
45 /* check user level */
46 if( $user_level )
47 {
48 $this->check_level( $user_level );
49 if( $default_path )
50 $this->conf['path'] = $default_path;
51 }
52 }
53 }
54