mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 08:39:25 +08:00
Bypass email activation when admin creates user via API
This commit is contained in:
parent
52cf465a90
commit
7cc2e46173
@ -124,6 +124,10 @@ class RegisterUserHandler
|
||||
}
|
||||
}
|
||||
|
||||
if ($actor->isAdmin()) {
|
||||
$user->activate();
|
||||
}
|
||||
|
||||
$this->events->fire(
|
||||
new UserWillBeSaved($user, $actor, $data)
|
||||
);
|
||||
|
@ -352,9 +352,11 @@ class User extends AbstractModel
|
||||
*/
|
||||
public function activate()
|
||||
{
|
||||
$this->is_activated = true;
|
||||
if ($this->is_activated !== true) {
|
||||
$this->is_activated = true;
|
||||
|
||||
$this->raise(new UserWasActivated($this));
|
||||
$this->raise(new UserWasActivated($this));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user