コード例 #1
0
ファイル: log.php プロジェクト: rajsingh8220/Mikrotik-Manager
 function __construct()
 {
     parent::__construct();
     $this->load->library('login_lib');
     $login = new login_lib();
     if ($login->is_logged_in() == FALSE) {
         redirect('login');
     }
     $this->load->model('log_model');
     $this->data['submenu'] = 'log/submenu_log';
     $this->load->library('pagination');
     //$this->setup();
 }
コード例 #2
0
 function __construct()
 {
     parent::__construct();
     $this->load->library('login_lib');
     $login = new login_lib();
     if ($login->is_logged_in() == FALSE) {
         redirect('login');
     }
     //$this->load->model('category_model');
     $this->load->model('log/log_model');
     $this->load->model('bandwidth_model');
     $this->data['submenu'] = 'bandwidth/submenu_bandwidth';
     //$this->load->library('pagination');
     //$this->load->model('api/api_model');
     //$this->setup();
 }
コード例 #3
0
 function __construct()
 {
     parent::__construct();
     $this->load->library('login_lib');
     $login = new login_lib();
     if ($login->is_logged_in() == FALSE) {
         redirect('login');
     }
     $this->load->model('home_model');
     $this->load->model('category/category_model');
     $this->load->model('log/log_model');
     //	$this->data['submenu'] = 'category/submenu_actions';
     $this->load->library('pagination');
     $this->data['categories'] = $this->category_model->get_categories();
     //$this->setup();
 }
コード例 #4
0
 function __construct()
 {
     parent::__construct();
     $this->load->library('login_lib');
     $login = new login_lib();
     if ($login->is_logged_in() == FALSE) {
         redirect('login');
     }
     if (!$this->session->userdata('mikro_ip')) {
         redirect('error/');
     }
     //$this->load->model('home/home_model');
     $this->data['submenu'] = 'terminal/terminal_submenu';
     //$this->load->library('pagination');
     $this->load->model('api/api_model');
     //$this->setup();
 }
コード例 #5
0
 function logout()
 {
     $logout = date('Y-m-d h:i:s');
     $login = date("Y-m-d");
     $staff_id = $this->session->userdata('login_id');
     mysql_query("update tbl_attendance set logout_time='{$logout}' where staff_id ='{$staff_id}' and login_time like'{$login}%' ");
     login_lib::destroy_sessions('login_name');
     login_lib::destroy_sessions('login_email');
     login_lib::destroy_sessions('login_id');
     login_lib::destroy_sessions('login_type');
     redirect(Login_lib::UNSUCCESSFULL_LOGIN);
 }
コード例 #6
0
 public function edit($user_id)
 {
     $read_write = $this->session->userdata('read_write_blocked');
     if ($read_write == '0') {
         if ($this->input->post('edit_submit')) {
             $this->form_validation->set_error_delimiters('<span class="error">', '</span><br/>');
             $this->form_validation->set_rules('username', 'Username', 'required|xss_clean');
             $this->form_validation->set_rules('new_password', 'password', 'trim|required|xss_clean');
             $this->form_validation->set_rules('recovery_email', 'Recovery Email', 'trim|required|xss_clean|valid_email');
             $this->form_validation->set_rules('re_password', 'Re Password', 'required');
             if ($this->form_validation->run() == TRUE) {
                 $some_data['username'] = $this->input->post('username');
                 $some_data['password'] = login_lib::prepare_password($this->input->post('new_password'));
                 $some_data['recovery_email'] = $this->input->post('recovery_email');
                 $insert_id = $this->admin_model->update_admin($some_data, $user_id);
                 if (isset($insert_id)) {
                     $this->session->set_flashdata('message', 'Data successfully Added !');
                     redirect('admin/');
                 }
             }
         }
         $this->data['title'] = "Edit User";
         $this->data['record'] = $this->admin_model->get_admin_user($user_id);
         $this->data['template'] = 'admin/edit_admin';
         $this->data['password'] = $this->input->post('new_password');
         $this->load->view('common/main', $this->data);
     } else {
         $this->data['title'] = "Add Categories";
         $this->data['template'] = 'admin/not_allowed';
         $this->load->view('common/main', $this->data);
     }
 }