Some code cleanup [skip ci]

This commit is contained in:
James Cole
2015-05-27 07:27:05 +02:00
parent 58014f0592
commit 2ace7c3ca0
7 changed files with 67 additions and 40 deletions

View File

@@ -1,6 +1,8 @@
<?php namespace FireflyIII\Http\Controllers\Auth;
use App;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\User;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
@@ -87,22 +89,27 @@ class AuthController extends Controller
$this->auth->login($this->registrar->create($data));
// get the email address
$email = $this->auth->user()->email;
if ($this->auth->user() instanceof User) {
$email = $this->auth->user()->email;
// send email.
Mail::send(
'emails.registered', [], function(Message $message) use ($email) {
$message->to($email, $email)->subject('Welcome to Firefly III!');
// send email.
Mail::send(
'emails.registered', [], function (Message $message) use ($email) {
$message->to($email, $email)->subject('Welcome to Firefly III!');
}
);
// set flash message
Session::flash('success', 'You have registered successfully!');
Session::flash('gaEventCategory', 'user');
Session::flash('gaEventAction', 'new-registration');
return redirect($this->redirectPath());
}
);
App::abort(500, 'Not a user!');
// set flash message
Session::flash('success', 'You have registered successfully!');
Session::flash('gaEventCategory', 'user');
Session::flash('gaEventAction', 'new-registration');
return redirect($this->redirectPath());
return false;
}
}