Fixed some bugs while registering users.

This commit is contained in:
James Cole 2015-01-17 07:14:01 +01:00
parent 86ecca6011
commit 7d4006b205
2 changed files with 28 additions and 1 deletions

View File

@ -77,7 +77,11 @@ class UserController extends BaseController
$user = $repository->register(Input::all());
if ($user) {
$email->sendVerificationMail($user);
$result = $email->sendVerificationMail($user);
if($result === false) {
$user->delete();
return View::make('error')->with('message','The email message could not be send. See the log files.');
}
return View::make('user.verification-pending');
}
@ -121,6 +125,9 @@ class UserController extends BaseController
*/
public function register()
{
if (Config::get('mail.from.address') == '@gmail.com' || Config::get('mail.from.address') == '') {
return View::make('error')->with('message', 'Configuration error in <code>app/config/'.App::environment().'/mail.php</code>');
}
return View::make('user.register');
}

View File

@ -3,6 +3,8 @@ namespace FireflyIII\Shared\Mail;
use Swift_RfcComplianceException;
use Illuminate\Mail\Message;
use Swift_TransportException;
/**
* Class Registration
*
@ -57,7 +59,16 @@ class Registration implements RegistrationInterface
}
);
} catch (Swift_RfcComplianceException $e) {
\Log::error($e->getMessage());
return false;
} catch(Swift_TransportException $e) {
\Log::error($e->getMessage());
return false;
} catch(\Exception $e) {
\Log::error($e->getMessage());
return false;
}
return true;
}
@ -84,7 +95,16 @@ class Registration implements RegistrationInterface
}
);
} catch (Swift_RfcComplianceException $e) {
\Log::error($e->getMessage());
return false;
} catch(Swift_TransportException $e) {
\Log::error($e->getMessage());
return false;
} catch(\Exception $e) {
\Log::error($e->getMessage());
return false;
}
return true;
}
}