コード例 #1
0
 public function roleChange()
 {
     $user = \App\users::find(session('user')->userid);
     $user->roleid = 2;
     $user->save();
     session(['user' => $user]);
     return redirect('/dashboard/sell');
 }
コード例 #2
0
ファイル: admin.php プロジェクト: armzaazaazaa/mini420
 public function postDeleteid($id)
 {
     $user = \App\users::find($id);
     $st = \App\statususers::where('username', $user->name)->get();
     $status = \App\statususers::findOrNew($st[0]['id']);
     $status->delete();
     $user->delete();
     return redirect('/admin');
 }
コード例 #3
0
ファイル: settingController.php プロジェクト: aaffio/guide
 public function postPass()
 {
     $validator = Validator::make(Input::all(), array("oldPass" => "required", "newPass" => "required|min:6", "confPass" => "required|same:newPass"));
     if ($validator->passes()) {
         $password = Input::get('oldPass');
         $haspass = Auth::user()->password;
         if (Hash::check($password, $haspass)) {
             $chpass = users::find(Auth::user()->id);
             $chpass->password = Hash::make(Input::get('newPass'));
             $chpass->save();
             return Redirect::to("setting/password")->with('setting_success', 'Your password was updated.');
         } else {
             return Redirect::to('setting/password')->with('oldpass_fail', 'wrong');
         }
     } else {
         return Redirect::to('/setting/password')->withErrors($validator)->withInput();
     }
 }
コード例 #4
0
ファイル: UserController.php プロジェクト: Raja4567/Shubooks
 public function updatePassword(PasswordUpdateRequest $request)
 {
     $user = \App\users::find(session('user')->userid);
     if ($user->password == $request->input('oldpassword')) {
         if ($request->input('oldpassword') != $request->input('password')) {
             $user->password = $request->input('oldpassword');
             $user->save();
             \Session::flash('message', 'Password changed Successfully!');
             \Session::flash('type', 'success');
             return view('user.password');
         } else {
             \Session::flash('message', 'New password and Old password cannot be the same');
             \Session::flash('type', 'danger');
             return view('user.password');
         }
     } else {
         \Session::flash('message', 'Old Password is not valid');
         \Session::flash('type', 'danger');
         return view('user.password');
     }
 }