This commit is contained in:
2013-11-18 20:12:28 +01:00
parent 41f27fbddb
commit 7bc24be788
6 changed files with 122 additions and 18 deletions

View File

@@ -363,4 +363,35 @@ Route::post('news', array('before' => 'auth', function() {
$n->save();
return Redirect::to('/')->with('message', 'News erstellt!');
}
}));
}));
Route::get('passwort-vergessen', function() {
return View::make('pwform');
});
Route::post('passwort-vergessen', function() {
$credentials = array('email' => Input::get('email'));
return Password::remind($credentials, function($message, $user) {
$message->subject('Passwort für Dumbo zurücksetzen.');
});
});
Route::get('passwort-reset/{token}', function($token) {
return View::make('pwreset')->with('token', $token);
});
Route::post('passwort-reset', function() {
$credentials = array(
'email' => Input::get('email'),
'password' => Input::get('password'),
'password_confirmation' => Input::get('password_confirmation')
);
return Password::reset($credentials, function($user, $password) {
$user->password = Hash::make($password);
$user->save();
return Redirect::to('/');
});
});