mirror of
https://github.com/flarum/core.git
synced 2025-10-18 18:26:07 +02:00
Move event to Flarum\User namespace
This commit is contained in:
37
src/User/Event/CheckingPassword.php
Normal file
37
src/User/Event/CheckingPassword.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\User\Event;
|
||||
|
||||
use Flarum\User\User;
|
||||
|
||||
class CheckingPassword
|
||||
{
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $password;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param string $password
|
||||
*/
|
||||
public function __construct($user, $password)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->password = $password;
|
||||
}
|
||||
}
|
@@ -14,7 +14,6 @@ namespace Flarum\User;
|
||||
use DomainException;
|
||||
use Flarum\Database\AbstractModel;
|
||||
use Flarum\Database\ScopeVisibilityTrait;
|
||||
use Flarum\Event\CheckUserPassword;
|
||||
use Flarum\Event\ConfigureUserPreferences;
|
||||
use Flarum\Event\PrepareUserGroups;
|
||||
use Flarum\Foundation\Application;
|
||||
@@ -26,6 +25,7 @@ use Flarum\Post\Event\Deleted as PostDeleted;
|
||||
use Flarum\User\Event\Activated;
|
||||
use Flarum\User\Event\AvatarChanged;
|
||||
use Flarum\User\Event\BioChanged;
|
||||
use Flarum\User\Event\CheckingPassword;
|
||||
use Flarum\User\Event\Deleted;
|
||||
use Flarum\User\Event\EmailChanged;
|
||||
use Flarum\User\Event\EmailChangeRequested;
|
||||
@@ -350,7 +350,7 @@ class User extends AbstractModel
|
||||
*/
|
||||
public function checkPassword($password)
|
||||
{
|
||||
$valid = static::$dispatcher->until(new CheckUserPassword($this, $password));
|
||||
$valid = static::$dispatcher->until(new CheckingPassword($this, $password));
|
||||
|
||||
if ($valid !== null) {
|
||||
return $valid;
|
||||
|
Reference in New Issue
Block a user