mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 11:34:36 +08:00
Bypass email activation when admin creates user via API
This commit is contained in:
parent
595d715b1d
commit
341ffaced5
|
@ -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…
Reference in New Issue
Block a user