'auth', 'a' => 'login'])); } } public static function logout() { sAuth::logout(); header('Location: .'); } public static function check_pass() { if (\password_verify(post('password'), sAuth::User()->password)) { return 'OK'; } return 'KO'; } public static function change_pass() { return view('auth.change_pass'); } public static function do_change_pass() { if (\password_verify(post('old'), sAuth::User()->password)) { if (post('new') == post('new2')) { $user = sAuth::User(); $user->password(post('new')); $user->save(); header('Location: .'); die(); } } header('Location: ' . url('', ['p' => 'auth', 'a' => 'change_pass'])); } } ?>