mirror of
https://github.com/flarum/core.git
synced 2025-05-08 00:15:24 +02: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(
|
$this->events->fire(
|
||||||
new UserWillBeSaved($user, $actor, $data)
|
new UserWillBeSaved($user, $actor, $data)
|
||||||
);
|
);
|
||||||
|
@ -352,9 +352,11 @@ class User extends AbstractModel
|
|||||||
*/
|
*/
|
||||||
public function activate()
|
public function activate()
|
||||||
{
|
{
|
||||||
|
if ($this->is_activated !== true) {
|
||||||
$this->is_activated = true;
|
$this->is_activated = true;
|
||||||
|
|
||||||
$this->raise(new UserWasActivated($this));
|
$this->raise(new UserWasActivated($this));
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user