Example #1
0
	/**
	 * Output Validation Errors
	 *
	 * Using the Status class move all errors into an error
	 * message
	 *
	 * @access public
	 */
        
	function output_errors()
	{
		// Make sure the status module is
               $this->CI->load->library('status/status/status');
               $error = $this->error_string(' ',' ');
		flashMsg('warning',$error);
	}
Example #2
0
	function __construct()
	{
		parent::__construct();
		// Set base crumb
		$this->bep_site->set_crumb($this->lang->line('backendpro_control_panel'),'admin');
		// Set container variable
		$this->_container = $this->config->item('backendpro_template_admin') . "container.php";
		$this->_phpinfocontainer = $this->config->item('backendpro_template_admin') . "phpinfocontainer.php";
		// Set Pop container variable
		$this->_popup_container = $this->config->item('backendpro_template_admin') . "popup.php";
		// Make sure user is logged in
		check('Control Panel');
		// Check to see if the install path still exists
		if( is_dir('install'))
		{
			flashMsg('warning',$this->lang->line('backendpro_remove_install'));
		}                
		// Set private meta tags
		//$this->bep_site->set_metatag('name','content',TRUE/FALSE);
		$this->bep_site->set_metatag('robots','nofollow, noindex');
		$this->bep_site->set_metatag('pragma','nocache',TRUE);
		// Load the ADMIN asset group
		$this->bep_assets->load_asset_group('ADMIN');
		// Loading module model for menu on the left
		$this->load->model('category/MCats');
		$this->load->model('currency/MCurrency');
		$this->lang->load('shop');
		$this->load->language('kaimonokago/kaimonokagoadmin');
		$this->load->language('welcome/webshop');
		log_message('debug','BackendPro : Admin_Controller class loaded');
	}
 function add_schedule($object)
 {
     $group_id = $object['group_name'];
     $where['group_id'] = $group_id;
     $this->CI->schedule_model->delete_schedule($where);
     $days = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');
     $index = 0;
     $day_number = 0;
     /* 0 for sunday, 1 for monday and so on */
     foreach ($days as $day) {
         $index = 0;
         $data = array();
         foreach ($object[$day] as $item) {
             $hr = explode(':', $item, 2);
             $hr = $hr[0];
             $data['group_id'] = $group_id;
             $data['day'] = $day;
             $data['start_time'] = $item;
             $data['duration'] = $object[$day][$index++];
             $data['order'] = $index;
             $data['slot'] = $day_number * 24 + $hr;
             $this->CI->schedule_model->add_schedule($data);
         }
         $day_number++;
     }
     flashMsg('success', 'Schedule added successfully');
     return;
 }
 function Admin_Controller()
 {
     parent::Site_Controller();
     // Set base crumb
     $this->bep_site->set_crumb($this->lang->line('backendpro_control_panel'), 'admin');
     // Set container variable
     $this->_container = $this->config->item('backendpro_template_admin') . "container.php";
     // Set Pop container variable
     $this->_popup_container = $this->config->item('backendpro_template_admin') . "popup.php";
     // Make sure user is logged in
     check('Control Panel');
     // Check to see if the install path still exists
     if (is_dir('install')) {
         flashMsg('warning', $this->lang->line('backendpro_remove_install'));
     }
     // Set private meta tags
     //$this->bep_site->set_metatag('name','content',TRUE/FALSE);
     $this->bep_site->set_metatag('robots', 'nofollow, noindex');
     $this->bep_site->set_metatag('pragma', 'nocache', TRUE);
     // Load the ADMIN asset group
     $this->bep_assets->load_asset_group('ADMIN');
     // Loading language file here rather than Shop_admin_controller.php.
     // Otherwise menu items will not be displayed
     $this->lang->load('shop');
     $this->load->module_language('kaimonokago', 'kaimonokagoadmin');
     $this->load->module_language('welcome', 'webshop');
     log_message('debug', 'BackendPro : Admin_Controller class loaded');
 }
Example #5
0
 function delete()
 {
     $this->MKaimonokago->deleteitem($this->table, $this->id);
     $this->session->set_flashdata('message', $this->lang->line('kago_deleted'));
     flashMsg('success', $this->lang->line('kago_deleted'));
     redirect($this->module . "/admin/index/", "refresh");
 }
Example #6
0
	function update($id)
	{
		$this->form_validation->set_rules('ten','"Tên"','required');
		$this->form_validation->set_rules('diachi','"Địa chỉ"','required');
		$this->form_validation->set_rules('dienthoai','"Điện thoại"','required');
		$this->form_validation->set_rules('email','"Email"','required');
		$this->form_validation->set_rules('website','"Website"','required');
		
		if($this->form_validation->run())
		{
			$this->MContact->updateContact($id);
			$data['title']="Quản lý địa chỉ liên hệ";
			$data['module'] = $this->module;
			$data['header'] = $this->lang->line('backendpro_access_control');
			$data['page'] = $this->config->item('backendpro_template_admin')."view";
			$data['contact'] = $this->MContact->getListContact();	    
	   	 	flashMsg('success','Thông tin liên hệ được cập nhật thành công');	
			$this->load->view($this->_container,$data);
		}
		else 
		{
			$data['title']="Quản lý địa chỉ liên hệ";
			$data['module'] = $this->module;
			$data['header'] = $this->lang->line('backendpro_access_control');
			$data['page'] = $this->config->item('backendpro_template_admin')."view";
			$data['contact'] = $this->MContact->getListContact();	    
	   	 	flashMsg('error','Bạn phải nhập đầy đủ thông tin');	
			$this->load->view($this->_container,$data);
		}
	}
Example #7
0
 function index()
 {
     //security check
     $this->freakauth_light->check('admin');
     //load necessary models and libraries
     $this->load->model('postplanmodel');
     $this->load->library('validation');
     //set rules for falidation
     $rules['packet'] = 'required';
     $rules['time'] = 'required';
     $rules['idletimeout'] = 'required';
     $this->validation->set_rules($rules);
     //get price for /byte and /minute
     $data['packet'] = $this->postplanmodel->getPerByte();
     $data['time'] = $this->postplanmodel->getPerMinute();
     $data['idletimeout'] = $this->postplanmodel->getIdleTimeout();
     $data['bw_download'] = $this->postplanmodel->getDownloadRate();
     $data['bw_upload'] = $this->postplanmodel->getUploadRate();
     //set page information
     $data['title'] = 'Postpaid Setting';
     $data['action'] = 'Postpaid Setting';
     $data['notice'] = '';
     $this->load->vars($data);
     if ($this->validation->run() == FALSE) {
         $this->load->view('admin/postplan/postplan_view');
     } else {
         $this->postplanmodel->save();
         // $data['notice'] = 'Postpaid Settings Saved !';
         flashMsg('Postpaid Settings Saved !');
         redirect('/admin/postplan');
     }
 }
 /**
  * Output Validation Errors
  *
  * Using the Status class move all errors into an error
  * message
  *
  * @access public
  */
 function output_errors()
 {
     // Make sure the status module is
     $this->CI->load->module_library('status', 'status');
     foreach ($this->_error_array as $error) {
         flashMsg('warning', $error);
     }
 }
Example #9
0
 function delete_group($where)
 {
     $status = $this->CI->group_model->delete_group($where);
     if ($status) {
         flashMsg('success', "Group Deleted Successfully");
     } else {
         flashMsg('warning', "Sorry Group Can't be deleted");
     }
     return;
 }
Example #10
0
 function create()
 {
     $this->freakauth_light->check('user');
     if ($this->invoicemodel->insert($this->uri->segment(3))) {
         $this->print_invoice();
         flashMsg('Invoice Created');
         $this->load->view('invoice/invoice_view.php');
     } else {
         flashMsg('Cannot Create Invoice, this account has never been used');
         redirect('postpaid', 'location');
     }
 }
Example #11
0
		function view($id=0)
		{
			$this->bep_assets->load_asset_group('TINYMCE');
	    	$data['title']='Hỏi đáp';
			$data['module'] = $this->module;
	        $data['hoidap']=$this->Mhoidap->getView($id);
			$data['header'] = $this->lang->line('backendpro_access_control');
	        $data['page'] = $this->config->item('backendpro_template_admin') . "admin_hoidap_view";
			$this->bep_site->set_crumb($this->lang->line('kogo_edit_hoidap'));
			flashMsg('succes','Hiển thị câu hỏi số '.$id.' thành công');
	        $this->load->view($this->_container,$data);
	    }
Example #12
0
		function update()
		{
			$this->bep_assets->load_asset_group('TINYMCE');
	        $data['hjx'] = $this->Mslide->getIDs();
	        $x = $data['hjx'];
	        foreach($x as $key => $list )
	        {
	         	$data = $this->_fields($list['id']);	
	        	$this->Mslide->updateSlide($data);		
	        }
			
	        $this->index();
	        flashMsg('success','Cập nhật thành công!!!');
		}
Example #13
0
 function delete($id)
 {
     if (IS_AJAX) {
         $this->MMessages->delete($id);
     } else {
         if ($id) {
             $this->MMessages->delete($id);
             flashMsg('success', 'Task deleted');
             redirect('messages/admin/', 'refresh');
         }
         flashMsg('warning', 'Task not deleted');
         redirect('messages/admin/', 'refresh');
     }
 }
Example #14
0
		function upload()
		{
			$config['upload_path'] = './assets/upload/';
			$config['allowed_types'] = '*';
			$config['max_size']	= '0';
			$config['max_width']  = '0';
			$config['max_height']  = '0';
			
			$this->load->library('upload', $config);
			if ( ! $this->upload->do_upload())
			{
				$data['module'] = $this->module;
				$error = array('error' => $this->upload->display_errors());
				$data['title']="Cập nhật lịch học";
				$data['header'] = $this->lang->line('backendpro_access_control');
				$data['page'] = $this->config->item('backendpro_template_admin') . "admin_lichhoc_home";
				$data['query']=$this->Mlichhoc->get_lichhoc();
				flashMsg('error','Bạn chưa chọn file upload hoặc định dạng file không phù hợp');
				$this->load->view($this->_container,$data);
			}
			else
			{
				$upload=$this->upload->data();
				
				if($this->Mlichhoc->delete_lichhoc()==true)
				{
					$pathToFile = 'assets/upload/'.$upload['file_name'];
					$dulieu = new Spreadsheet_Excel_Reader($pathToFile,false,"UTF-8");
					
					for ($i = 2; $i <= $dulieu->sheets[0]['numRows']; $i++) 
						    {
						    	$khoa		=	$dulieu->sheets[0]['cells'][$i][1];
								$thoigian	=	$dulieu->sheets[0]['cells'][$i][2];
								$diadiem	=	$dulieu->sheets[0]['cells'][$i][3];
								$giangvien	=	$dulieu->sheets[0]['cells'][$i][4];
								
						      	$this->Mlichhoc->insert_lichhoc($khoa,$thoigian,$diadiem,$giangvien);
						    }
					 
					if(file_exists($pathToFile))
						unlink($pathToFile);
					
					redirect(base_url().'index.php/lichhoc/admin','refresh');
				}			
			}


		}
Example #15
0
 function edit()
 {
     if ($this->input->post('langname')) {
         $data = $this->_fields();
         $this->MKaimonokago->updateItem($this->module, $data);
         flashMsg('success', $this->lang->line('kago_updated'));
         redirect($this->module . '/admin/index', 'refresh');
     } else {
         $id = $this->uri->segment(4);
         $data['title'] = $this->lang->line('kago_edit');
         $data['info'] = $this->MKaimonokago->getInfo($this->module, $id);
         $data['header'] = $this->lang->line('backendpro_access_control');
         $data['page'] = $this->config->item('backendpro_template_admin') . "admin_edit";
         $data['module'] = $this->module;
         $this->load->view($this->_container, $data);
     }
 }
Example #16
0
 function addContact()
 {
     $this->CI->load->plugin('gmail_contacts');
     if (strstr($_SERVER['REQUEST_URI'], '?')) {
         $tokens = array();
         $responce = $_SERVER['REQUEST_URI'];
         $responcearr = explode('?', $responce);
         if (!empty($responcearr)) {
             $gets = explode('&', $responcearr[1]);
             if (!empty($gets)) {
                 foreach ($gets as $value) {
                     $array = explode('=', $value);
                     if (!empty($array)) {
                         $tokens[$array[0]] = $array[1];
                     }
                 }
             }
         }
         $contacts = getContacts($tokens, $this->CI->config->item('SMS_google_ckey'), $this->CI->config->item('SMS_google_csecretkey'), $this->CI->config->item('SMS_google_callbackurl'));
         $data['contacts'] = $contacts;
         return $this->CI->load->view($this->CI->config->item('SMS_gcontacts_list_view'), $data, TRUE);
         die;
     }
     $fields['mobileno'] = $this->CI->lang->line('SMS_mobileno_label');
     $fields['full_name'] = $this->CI->lang->line('SMS_fullname_label');
     $rules['mobileno'] = $this->CI->config->item('SMS_mobileno_field_validation_smssend');
     $rules['full_name'] = $this->CI->config->item('SMS_fullname_field_validation_smssend');
     $this->CI->fal_validation->set_fields($fields);
     $this->CI->fal_validation->set_rules($rules);
     $data['ss'] = '';
     if ($this->CI->fal_validation->run()) {
         $user_id = $this->user_id;
         $mobileno = $this->CI->input->post('mobileno');
         $fullname = $this->CI->input->post('full_name');
         $values = array('user_id' => $user_id, 'name' => $fullname, 'mobileno' => $mobileno, 'createdon' => date("Y-m-d H:i:s"));
         $this->CI->contactsmodel->insert($values);
         flashMsg('Contact added Successfully');
         redirect('contacts/show');
     } else {
         $data['gconnect'] = getGoogleConnectLink($this->CI->config->item('SMS_google_ckey'), $this->CI->config->item('SMS_google_csecretkey'), $this->CI->config->item('SMS_google_callbackurl'));
         return $this->CI->load->view($this->CI->config->item('SMS_contacts_form_view'), $data, TRUE);
     }
 }
Example #17
0
 function index()
 {
     $this->load->library('validation');
     $data['action'] = "FreeRadius captive portal management";
     $data['chilli_configuration'] = $this->easyhotspot_chillispot->get_configuration();
     $rules['radiusserver1'] = 'required';
     $rules['radiusserver2'] = 'required';
     $rules['radiussecret'] = 'required';
     $rules['dhcpif'] = 'required';
     $rules['uamserver'] = 'required';
     $rules['uamhomepage'] = 'required';
     $rules['uamsecret'] = 'required';
     $rules['uamallowed'] = 'required';
     $this->validation->set_rules($rules);
     if ($this->validation->run() == FALSE) {
         $this->load->vars($data);
         $this->load->view('admin/freeradius/freeradius_view');
     } else {
         $this->easyhotspot_chillispot->set_configuration($_POST);
         flashMsg('Configuration Saved');
         redirect('admin/freeradius', 'location');
     }
 }
Example #18
0
    function edit($id=0)
    {
    	$this->bep_assets->load_asset_group('TINYMCE');
    	$this->form_validation->set_rules('noidung','Nội dung','required|trim');
		$this->form_validation->set_rules('tieude','Tiêu đề','required|trim');
		$this->form_validation->set_rules('alias','Alias','required|trim');
		$this->form_validation->set_message('required','Mục %s không được để trống');
		
		if ($this->form_validation->run())
		{
			$input=$this->_field();
			$this->Mtintuc->updateNews($id,$input);
			flashMsg('success','Cập nhật tin thành công');
	        redirect($this->module.'/admin/index','refresh');
		}
		else 
		{
			$data['tintuc']=$this->Mtintuc->getDetailByID($id);
	    	$data['page'] = $this->config->item('backendpro_template_admin') . "admin_tintuc_edit";
	    	$data['title']='Sửa tin';
	    	$data['cancel_link']= $this->module."/admin/index/";
	        $this->load->view($this->_container,$data);
		}
    }
Example #19
0
 function delete()
 {
     $this->MKaimonokago->deleteitem($this->table, $this->id);
     $this->session->set_flashdata('message',$this->lang->line('kago_deleted'));
     flashMsg('success',$this->lang->line('kago_deleted'));
     if(!empty($this->sub_controller))
     {// for cecilieokada.com products/manage/
         redirect($this->module."/".$this->sub_controller."/index/".$this->category_id,"refresh");
     }
     elseif($this->module=='email')
     {
         $this->module='subscribers';
         redirect($this->module."/admin/email_home/","refresh");
     }
     elseif($this->module=='emailtemplate')
     {
         $this->module='subscribers';
         redirect($this->module."/admin/template_home/","refresh");
     }
     else
     {
         redirect($this->module."/admin/index/","refresh");
     }
 }
Example #20
0
 function delete($id = 0)
 {
     $this->MCalendar->deleteEvent($id);
     $this->session->set_flashdata('message', 'Event deleted successfully.');
     flashMsg('success', 'Event deleted successfully.');
     redirect('calendar/admin/index');
 }
Example #21
0
 function delete($id)
 {
     $table ='unix_'.$this->module;
     $this->MLoaisach->deleteitem($table,$id);
     flashMsg('success','Loại sách đã được xóa thành công.');
     redirect($this->module.'/admin/index','refresh');
 }
Example #22
0
 /**
  * Delete Actions
  *
  * @access public
  */
 function delete()
 {
     if (FALSE === ($actions = $this->input->post('select'))) {
         redirect('auth/admin/acl_actions', 'location');
     }
     $this->load->library('khacl');
     foreach ($actions as $action) {
         if ($this->khacl->axo->delete($action)) {
             flashMsg('success', sprintf($this->lang->line('access_action_deleted'), $action));
         } else {
             flashMsg('error', sprintf($this->lang->line('backendpro_action_failed'), $this->lang->line('access_delete_action')));
         }
     }
     redirect('auth/admin/acl_actions', 'location');
 }
Example #23
0
 /**
  * Delete Resources
  *
  * @access public
  * @return void
  */
 function delete()
 {
     if (FALSE === ($resources = $this->input->post('select'))) {
         redirect('auth/admin/acl_resources', 'location');
     }
     $this->load->library('khacl');
     foreach ($resources as $resource) {
         // Check we havn't already deleted it as a child of another node
         $query = $this->access_control_model->fetch('acos', NULL, NULL, array('name' => $resource));
         if ($query->num_rows() === 0) {
             flashMsg('success', sprintf($this->lang->line('access_resource_deleted'), $resource));
             continue;
         }
         if ($this->khacl->aco->delete($resource)) {
             flashMsg('success', sprintf($this->lang->line('access_resource_deleted'), $resource));
         } else {
             flashMsg('error', sprintf($this->lang->line('backendpro_action_failed'), $this->lang->line('access_delete_resource')));
         }
     }
     redirect('auth/admin/acl_resources', 'location');
 }
Example #24
0
 /**
  * Set User Login data
  *
  * When given a user ID it will fetch the required data
  * we need to save and save it to their session
  *
  * @access public
  * @param integer $user_id User ID of user
  */
 function set_userlogin($id)
 {
     //@INFO: This dosn't seem very safe having this exposed to everything.
     // Create Users session data
     $user = $this->CI->user_model->getUsers(array('users.id' => $id));
     $user = $user->row_array();
     $this->CI->session->set_userdata($user);
     if (!$this->CI->session) {
         // Could not log user in, something went wrong
         flashMsg('error', $this->CI->lang->line('userlib_login_failed'));
         // Remove autologin value to stop an infinite loop
         delete_cookie('autologin');
         redirect('auth/login', 'location');
     }
     // Update users last login time
     $this->CI->user_model->updateUserLogin($id);
 }
Example #25
0
 function edit($id=0)
 {
     if ($this->input->post('title'))
     {
         $data = $this->_fields();
         $this->MNews->updateNewsByID($id,$data);
         flashMsg('success',"Update sucessfully");
         redirect(base_url().'index.php/is_news/admin','refresh');
     }
     else
     {
     	$data['page'] = "admin/admin_news_edit";
         $data['module'] = $this->module;
     	$data['news'] = $this->MNews->getNewsByID($id);
         $this->load->view($this->_container,$data);
     }
 }
Example #26
0
 function delete($id)
 {
     /**
      * When you delete customer, it will affect on omc_order table and it will affect omc_order_table_items
      * Check if the customer has orders, if yes, then go back with warning to delete the order first.
      *
      */
     $order_orphans = $this->MCustomers->checkOrphans($id);
     if (count($order_orphans)) {
         // $this->session->set_userdata($order_orphans);
         flashMsg('warning', 'Customer can\'t be deleted');
         flashMsg('warning', $order_orphans);
         redirect('orders/admin/index/', 'refresh');
     } else {
         $table = 'omc_' . $this->module;
         $this->MKaimonokago->deleteitem($table, $id);
         //$this->MCustomers->deleteCustomer($id);
         flashMsg('success', 'Customer deleted');
         redirect($this->module . '/admin/index', 'refresh');
     }
 }
Example #27
0
 /**
  * Displays the registration form.
  * 
  * @access public
  *
  */
 function del($id)
 {
     // security check:
     // admins or superadmins cannot be deleted in the users controller
     $edited_role = getUserPropertyFromId($id, 'role');
     $allowed = ($edited_role != 'admin' and $edited_role != 'superadmin');
     if (!$allowed) {
         $this->freakauth_light->denyAccess(getUserProperty('role'));
     }
     $this->usermodel->deleteUser($id);
     if ($this->config->item('FAL_create_user_profile') == TRUE) {
         $this->load->model('Userprofile');
         $this->Userprofile->deleteUserProfile($id);
     }
     //set a flash message
     $msg = $this->db->affected_rows() . $this->lang->line('FAL_user_deleted');
     flashMsg($msg);
     redirect('admin/users', 'location');
 }
Example #28
0
 function langcreate()
 {
     $this->bep_assets->load_asset_group('TINYMCE');
     if ($this->input->post('name')) {
         // info is filled out, so the followings
         $this->MCats->addCategory();
         // This is CI way to show flashdata
         // $this->session->set_flashdata('message','Page updated');
         // But here we use Bep way to display flash msg
         flashMsg('success', $this->lang->line('kago_translation_added'));
         redirect('category/admin/index', 'refresh');
     } else {
         // segment 4 is table_id
         $table_id = $this->uri->segment(4);
         // need to send it to a view for table_id
         $data['table_id'] = $table_id;
         // page_uri_id is in segment 5
         //$page_uri_id = $this->uri->segment(5);
         //$data['page_uri_id']= $page_uri_id;
         // language id is in segment 5
         $lang_id = $this->uri->segment(5);
         $data['lang_id'] = $lang_id;
         // no need for menu path
         //$path = $this->uri->segment(6);
         // check if there is no translation with this lang
         // this can use a model as well
         //$checktrans = $this->MKaimonokago->checktrans($this->module, $id, $lang_id);
         //if (count($checktrans)){
         // there is translation of this language
         //redirect with warning
         //flashMsg('warning',$this->lang->line('kago_translation_exists'));
         //redirect('menus/admin/index','refresh');
         //}
         // do normal thing
         // get all the languages
         $data['languages'] = $this->MLangs->getLangDropDownWithId();
         // get all the translated languages
         //$id =
         //$data['translanguages'] =$this->MLangs->getTransLang($this->module,$id);
         $data['translanguages'] = $this->MLangs->getTransLang($this->module, $table_id);
         //$data['translanguages'] =$this->MLangs->getTransLang($this->module,$page_uri_id);
         // get language info, langname. This will be used in Title
         $table = 'languages';
         $selected_lang = $this->MKaimonokago->getinfo($table, $lang_id);
         $data['selected_lang'] = $selected_lang;
         // this must pull only pages where the segment 6 which is lang id
         // then use dropdown to select page
         // then use dropdown to select page
         //$data['pages'] = $this->MPages->getIdwithnone();
         /*
                 $data['pages'] = $this->MPages->getIdwithnoneLang($lang_id);
                 $lang_id = $this->uri->segment(6);
                 $data['menus'] = $this->MMenus->getAllMenusDisplayByLang($lang_id);
         */
         $data['category'] = $this->MCats->getCategory($table_id);
         // get category by lang
         //$data['categories'] = $this->MCats->getCategoriesbyLang($lang_id);
         $data['categories'] = $this->MCats->getTopCategories($lang_id);
         // set variables here
         $data['title'] = $this->lang->line('kago_add_translation') . ucwords($selected_lang['langname']);
         $data['page'] = $this->config->item('backendpro_template_admin') . "admin_lang_create";
         // send the parent(English) field data to use it for other languages
         //$data['menu'] = $this->MMenus->getMenu($id);
         //if (!count($data['menu'])){
         // if page is not specified redirect to index
         //  flashMsg('warning',$this->lang->line('kago_no_exists'));
         //  redirect('menus/admin/index','refresh');
         //}
         $selected_lang = ucfirst($selected_lang['langname']);
         // using this in bread crumb
         //$data['menus'] = $this->MMenus->getAllMenusDisplay();
         // Set breadcrumb
         $this->bep_site->set_crumb($this->lang->line('kago_edit_home'), 'menus/admin/edit/');
         //$this->bep_site->set_crumb($this->lang->line('kago_add_translation').$selected_lang,'menus/admin/edit/'.$id."/".$lang_id);
         $data['header'] = $this->lang->line('backendpro_access_control');
         $data['cancel_link'] = $this->module . "/admin/index/";
         $data['module'] = $this->module;
         $this->load->view($this->_container, $data);
     }
 }
Example #29
0
 /**
  * Function that handles the change password procedure
  * needed to let the user set the password he wants after the
  * forgotten_password_reset() procedure
  * Displays the forgotten password reset.
  * -------------------------
  * Usage:
  * -------------------------
  * //load the library in your controller
  * $this->load->library('FAL_front', 'fal_front');
  *
  * $data['fal'] = $this->fal_front->changepassword();  // <--assign it to a variable
  * $this->load->view('your_view', $data);  // <--pass it to your view
  *
  * -------------------------
  * Try also
  * echo $this->fal_front->changepassword();
  * -------------------------
  *
  * @return the change password view HTML output
  */
 function changepassword()
 {
     //sets the necessary form fields
     $fields['user_name'] = $this->CI->lang->line('FAL_user_name_label');
     $fields['old_password'] = $this->CI->lang->line('FAL_old_password_label');
     $fields['password'] = $this->CI->lang->line('FAL_new_password_label');
     $fields['password_confirm'] = $this->CI->lang->line('FAL_retype_new_password_label');
     $fields['security'] = $this->CI->lang->line('FAL_captcha_label');
     $rules['user_name'] = $this->CI->config->item('FAL_user_name_field_validation_login');
     //old password
     $rules['old_password'] = $this->CI->config->item('FAL_user_password_field_validation_login');
     //new password
     $rules['password'] = $this->CI->config->item('FAL_password_required_validation');
     //new password confirmation
     $rules['password_confirm'] = $this->CI->config->item('FAL_password_required_confirm_validation');
     //-----------------------------------------------
     //ADD MORE FIELDS AND RULES HERE IF YOU NEED THEM
     //-----------------------------------------------
     $this->CI->fal_validation->set_fields($fields);
     $this->CI->fal_validation->set_rules($rules);
     //if it got post data and they validate display the success page
     if ($this->CI->fal_validation->run() && $this->CI->freakauth_light->_change_password()) {
         //set FLASH MESSAGE
         $msg = $this->CI->lang->line('FAL_change_password_success');
         flashMsg($msg);
         redirect('', 'location');
     } else {
         //page display
         $data['heading'] = $this->CI->lang->line('FAL_change_password_label');
         return $this->CI->load->view($this->CI->config->item('FAL_change_password_view'), $data, TRUE);
     }
 }
Example #30
0
 /**
  * Handles the user change password $_POST requests
  * returns true if password sent to user, false otherwise
  * @return true if password sent to user
  */
 function _change_password()
 {
     if ($this->CI->db_session) {
         $username = $this->CI->input->post('user_name');
         $old_password = $this->CI->input->post('old_password');
         $new_password = $this->CI->input->post('password');
         // if $email not false checks the relative password for that user querying the DB
         if ($username != false and $old_password != false and $new_password != false) {
             $query = $this->CI->usermodel->getUserForLogin($username, $this->_encode($old_password));
             if ($query != null && $query->num_rows() == 1) {
                 $row = $query->row();
                 $user_id = $row->{'id'};
                 $user = $row->{'user_name'};
                 $email = $row->{'email'};
                 // clear text password for e-mail
                 $password_email = $new_password;
                 // encrypts the password for DB update
                 $new_password = $this->_encode($new_password);
                 // updates the user table
                 $this->CI->usermodel->updateUserForForgottenPasswordReset($user_id, $new_password);
                 // sends e-mail to user
                 $this->_sendChangePasswordEmail($user_id, $user, $email, $password_email);
                 return true;
             }
         }
         // set unsuccess FLASH MESSAGE
         $msg = $this->CI->lang->line('FAL_change_password_failed_message');
         flashMsg($msg);
         redirect($this->CI->config->item('FAL_changePassword_uri'), 'location');
     }
 }