diff --git a/app/config/mail.php b/app/config/mail.php index a7151a0..ad17ce6 100644 --- a/app/config/mail.php +++ b/app/config/mail.php @@ -15,7 +15,7 @@ return array( | */ - 'driver' => 'smtp', + 'driver' => 'sendmail', /* |-------------------------------------------------------------------------- @@ -54,7 +54,7 @@ return array( | */ - 'from' => array('address' => null, 'name' => null), + 'from' => array('address' => 'dumbo-noreply@ascarion.org', 'name' => 'Dumbo Mailsystem'), /* |-------------------------------------------------------------------------- diff --git a/app/routes.php b/app/routes.php index dde7c97..1f08002 100644 --- a/app/routes.php +++ b/app/routes.php @@ -363,4 +363,35 @@ Route::post('news', array('before' => 'auth', function() { $n->save(); return Redirect::to('/')->with('message', 'News erstellt!'); } -})); \ No newline at end of file +})); + +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('/'); + }); +}); \ No newline at end of file diff --git a/app/views/emails/auth/reminder.blade.php b/app/views/emails/auth/reminder.blade.php index 2976327..0cdcbeb 100644 --- a/app/views/emails/auth/reminder.blade.php +++ b/app/views/emails/auth/reminder.blade.php @@ -1,13 +1 @@ - - -
- - - -Passwort vergessen? (Das funktioniert noch nicht)
+