22defined ('BASEPATH ' ) OR exit ('No direct script access allowed ' );
33class Dashboard extends LB_Admin_Controller
44{
5- public function __construct ()
5+ public $ user_model ;
6+
7+ public function __construct ()
68 {
79 parent ::__construct ();
810 #redirect(config_item('admin_folder').'/dashboard/welcome');
911 $ this ->data ['link_map ' ]['controller ' ] = 'Dashboard ' ;
1012 $ this ->load ->model ('user_model ' );
11- }
13+ $ this ->load ->model (config_item ('admin_folder ' ) . '/User_model ' );
14+ //echo "<pre>";print_r($this->user_model);die;
15+ }
1216 public function index ()
1317 {
1418
@@ -18,7 +22,7 @@ public function welcome()
1822 {
1923 $ this ->data ['link_map ' ]['method ' ] = 'Welcome ' ;
2024 $ this ->data ['site_content ' ] = 'admin/pages/home ' ;
21- $ this ->load ->view ('admin/section ' , $ this ->data );
25+ $ this ->load ->view ('admin/section ' , $ this ->data );
2226
2327 }
2428 public function change_password ()
@@ -42,17 +46,16 @@ public function change_password()
4246 )
4347 ));
4448 $ this ->form_validation ->set_rules ($ validationRules );
45- if ($ this ->form_validation ->run () == TRUE ) {
49+ if ($ this ->form_validation ->run ()) {
4650 $ this ->load ->model (config_item ('admin_folder ' ) . '/User_model ' );
47- $ result = $ this ->User_model ->check_recovery_key_expired ();
48- if ($ this ->User_model ->change_password ()) {
51+ $ this ->user_model ->check_recovery_key_expired ();
52+ if ($ this ->user_model ->change_password ()) {
4953 $ this ->session ->set_flashdata ('success ' , 'Your account password changed successfully. ' );
50- $ this ->data ['alert ' ] = $ this ->alertMessage () ?: '' ;
51- } else {
54+ } else {
5255 $ this ->session ->set_flashdata ('error ' , 'Your account password change unsuccessful. ' );
53- $ this -> data [ ' alert ' ] = $ this -> alertMessage () ?: '' ;
54- }
55- }
56+ }
57+ $ this -> data [ ' alert ' ] = $ this -> alertMessage () ?: '' ;
58+ }
5659 $ this ->data ['site_content ' ] = config_item ('admin_folder ' ) . '/page/change_password ' ;
5760 $ this ->load ->view (config_item ('admin_folder ' ) . '/section ' , $ this ->data );
5861 }
0 commit comments