diff --git a/app/Http/Controllers/Admin/Dashboard.php b/app/Http/Controllers/Admin/Dashboard.php index aa433978..1bfc0ed2 100755 --- a/app/Http/Controllers/Admin/Dashboard.php +++ b/app/Http/Controllers/Admin/Dashboard.php @@ -21,4 +21,34 @@ public function dd(){ $json_string = json_encode(Request("commands")); die($json_string); } + + public function showChangePassword(){ + return view('admin.pages.account.changepassword'); + } + + + public function doChangePassword(){ + if (Hash::check(\Request('current_password'), \Auth::user()->password)) { + $new1 = \Request('new_password'); + $new2 = \Request('new_password_repeat'); + if($new1 == $new2){ + $u = \Auth::user(); + $u->password = \Hash::make($new1); + $u->save(); + session()->flash('good', 'Password Changed!'); + return redirect()->route('admin.account.changepassword'); + }else{ + session()->flash('bad', 'Passwords did not match'); + return redirect()->route('admin.account.changepassword'); + } + }else{ + session()->flash('bad', 'Incorrect password'); + return redirect()->route('admin.account.changepassword'); + } + + + return view('admin.pages.account.changepassword'); + } + + } diff --git a/config/self-update.php b/config/self-update.php index 42d6da5e..b6ede282 100755 --- a/config/self-update.php +++ b/config/self-update.php @@ -22,7 +22,7 @@ | */ - 'version_installed' => env('SELF_UPDATER_VERSION_INSTALLED', '0.0.5'), + 'version_installed' => env('SELF_UPDATER_VERSION_INSTALLED', '0.0.6'), /* |-------------------------------------------------------------------------- diff --git a/resources/views/admin/layout.blade.php b/resources/views/admin/layout.blade.php index 62aec5d1..106a39db 100755 --- a/resources/views/admin/layout.blade.php +++ b/resources/views/admin/layout.blade.php @@ -171,7 +171,7 @@