update folder location
This commit is contained in:
38
src/User/Event/FormEvent.php
Normal file
38
src/User/Event/FormEvent.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Da\User\Event;
|
||||
|
||||
use yii\base\Event;
|
||||
use yii\base\Model;
|
||||
|
||||
class FormEvent extends Event
|
||||
{
|
||||
const EVENT_BEFORE_REQUEST = 'beforeRequest';
|
||||
const EVENT_AFTER_REQUEST = 'afterRequest';
|
||||
const EVENT_BEFORE_RESEND = 'beforeResend';
|
||||
const EVENT_AFTER_RESEND = 'afterResend';
|
||||
const EVENT_BEFORE_LOGIN = 'beforeLogin';
|
||||
const EVENT_AFTER_LOGIN = 'afterLogin';
|
||||
|
||||
protected $form;
|
||||
|
||||
public function __construct(Model $form, array $config = [])
|
||||
{
|
||||
$this->form = $form;
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getForm()
|
||||
{
|
||||
return $this->form;
|
||||
}
|
||||
}
|
||||
32
src/User/Event/ProfileEvent.php
Normal file
32
src/User/Event/ProfileEvent.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Da\User\Event;
|
||||
|
||||
use Da\User\Model\Profile;
|
||||
use yii\base\Event;
|
||||
|
||||
class ProfileEvent extends Event
|
||||
{
|
||||
protected $profile;
|
||||
|
||||
public function __construct(Profile $profile, array $config = [])
|
||||
{
|
||||
$this->profile = $profile;
|
||||
|
||||
return parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getProfile()
|
||||
{
|
||||
return $this->profile;
|
||||
}
|
||||
}
|
||||
50
src/User/Event/ResetPasswordEvent.php
Normal file
50
src/User/Event/ResetPasswordEvent.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Da\User\Event;
|
||||
|
||||
use Da\User\Form\RecoveryForm;
|
||||
use Da\User\Model\Token;
|
||||
use yii\base\Event;
|
||||
|
||||
class ResetPasswordEvent extends Event
|
||||
{
|
||||
const EVENT_BEFORE_TOKEN_VALIDATE = 'beforeTokenValidate';
|
||||
const EVENT_AFTER_TOKEN_VALIDATE = 'afterTokenValidate';
|
||||
const EVENT_BEFORE_RESET = 'beforeReset';
|
||||
const EVENT_AFTER_RESET = 'afterReset';
|
||||
|
||||
protected $form;
|
||||
protected $token;
|
||||
|
||||
public function __construct(Token $token, RecoveryForm $form, array $config = [])
|
||||
{
|
||||
$this->form = $form;
|
||||
$this->token = $token;
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getForm()
|
||||
{
|
||||
return $this->form;
|
||||
}
|
||||
|
||||
public function getToken()
|
||||
{
|
||||
return $this->token;
|
||||
}
|
||||
|
||||
public function updateForm(RecoveryForm $form)
|
||||
{
|
||||
return new static($this->getToken(), $form);
|
||||
}
|
||||
}
|
||||
45
src/User/Event/SocialNetworkAuthEvent.php
Normal file
45
src/User/Event/SocialNetworkAuthEvent.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Da\User\Event;
|
||||
|
||||
use Da\User\Model\SocialNetworkAccount;
|
||||
use yii\authclient\ClientInterface;
|
||||
use yii\base\Event;
|
||||
|
||||
class SocialNetworkAuthEvent extends Event
|
||||
{
|
||||
const EVENT_BEFORE_AUTHENTICATE = 'beforeAuthenticate';
|
||||
const EVENT_AFTER_AUTHENTICATE = 'afterAuthenticate';
|
||||
const EVENT_BEFORE_CONNECT = 'beforeConnect';
|
||||
const EVENT_AFTER_CONNECT = 'afterConnect';
|
||||
|
||||
protected $client;
|
||||
protected $account;
|
||||
|
||||
public function __construct(SocialNetworkAccount $account, ClientInterface $client, $config = [])
|
||||
{
|
||||
$this->account = $account;
|
||||
$this->client = $client;
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getClient()
|
||||
{
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
public function getAccount()
|
||||
{
|
||||
return $this->account;
|
||||
}
|
||||
}
|
||||
45
src/User/Event/SocialNetworkConnectEvent.php
Normal file
45
src/User/Event/SocialNetworkConnectEvent.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Da\User\Event;
|
||||
|
||||
use Da\User\Model\SocialNetworkAccount;
|
||||
use Da\User\Model\User;
|
||||
use yii\base\Event;
|
||||
|
||||
class SocialNetworkConnectEvent extends Event
|
||||
{
|
||||
const EVENT_BEFORE_CONNECT = 'beforeConnect';
|
||||
const EVENT_AFTER_CONNECT = 'afterConnect';
|
||||
const EVENT_BEFORE_DISCONNECT = 'beforeDisconnect';
|
||||
const EVENT_AFTER_DISCONNECT = 'afterDisconnect';
|
||||
|
||||
protected $user;
|
||||
protected $account;
|
||||
|
||||
public function __construct(User $user, SocialNetworkAccount $account, $config = [])
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->account = $account;
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getAccount()
|
||||
{
|
||||
return $this->account;
|
||||
}
|
||||
}
|
||||
50
src/User/Event/UserEvent.php
Normal file
50
src/User/Event/UserEvent.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Da\User\Event;
|
||||
|
||||
use Da\User\Model\User;
|
||||
use yii\base\Event;
|
||||
|
||||
class UserEvent extends Event
|
||||
{
|
||||
const EVENT_BEFORE_CREATE = 'beforeCreate';
|
||||
const EVENT_AFTER_CREATE = 'afterCreate';
|
||||
const EVENT_BEFORE_DELETE = 'beforeDelete';
|
||||
const EVENT_AFTER_DELETE = 'afterDelete';
|
||||
const EVENT_BEFORE_REGISTER = 'beforeRegister';
|
||||
const EVENT_AFTER_REGISTER = 'afterRegister';
|
||||
const EVENT_BEFORE_ACCOUNT_UPDATE = 'beforeAccountUpdate';
|
||||
const EVENT_AFTER_ACCOUNT_UPDATE = 'afterAccountUpdate';
|
||||
const EVENT_BEFORE_PROFILE_UPDATE = 'beforeProfileUpdate';
|
||||
const EVENT_AFTER_PROFILE_UPDATE = 'afterProfileUpdate';
|
||||
const EVENT_BEFORE_CONFIRMATION = 'beforeConfirmation';
|
||||
const EVENT_AFTER_CONFIRMATION = 'afterConfirmation';
|
||||
const EVENT_BEFORE_UNBLOCK = 'beforeUnblock';
|
||||
const EVENT_AFTER_UNBLOCK = 'afterUnblock';
|
||||
const EVENT_BEFORE_BLOCK = 'beforeBlock';
|
||||
const EVENT_AFTER_BLOCK = 'afterBlock';
|
||||
const EVENT_BEFORE_LOGOUT = 'beforeLogout';
|
||||
const EVENT_AFTER_LOGOUT = 'afterLogout';
|
||||
|
||||
protected $user;
|
||||
|
||||
public function __construct(User $user, array $config = [])
|
||||
{
|
||||
$this->user = $user;
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user