mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Code for #1607
This commit is contained in:
@@ -54,6 +54,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
{
|
||||
$roleObject = Role::where('name', $role)->first();
|
||||
if (null === $roleObject) {
|
||||
Log::error(sprintf('Could not find role "%s" in attachRole()', $role));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -61,7 +62,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
$user->roles()->attach($roleObject);
|
||||
} catch (QueryException $e) {
|
||||
// don't care
|
||||
Log::info(sprintf('Query exception when giving user a role: %s', $e->getMessage()));
|
||||
Log::error(sprintf('Query exception when giving user a role: %s', $e->getMessage()));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -77,6 +78,7 @@ class UserRepository implements UserRepositoryInterface
|
||||
* @see updateEmail
|
||||
*
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function changeEmail(User $user, string $newEmail): bool
|
||||
{
|
||||
|
Reference in New Issue
Block a user