Rewrite of the authentication and authorization system
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event as BaseEvent;
|
||||
|
||||
class AuthEvent extends BaseEvent
|
||||
{
|
||||
private $auth_name;
|
||||
private $user_id;
|
||||
|
||||
public function __construct($auth_name, $user_id)
|
||||
{
|
||||
$this->auth_name = $auth_name;
|
||||
$this->user_id = $user_id;
|
||||
}
|
||||
|
||||
public function getUserId()
|
||||
{
|
||||
return $this->user_id;
|
||||
}
|
||||
|
||||
public function getAuthType()
|
||||
{
|
||||
return $this->auth_name;
|
||||
}
|
||||
}
|
||||
44
app/Event/AuthFailureEvent.php
Normal file
44
app/Event/AuthFailureEvent.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event as BaseEvent;
|
||||
|
||||
/**
|
||||
* Authentication Failure Event
|
||||
*
|
||||
* @package event
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class AuthFailureEvent extends BaseEvent
|
||||
{
|
||||
/**
|
||||
* Username
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $username = '';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param string $username
|
||||
*/
|
||||
public function __construct($username = '')
|
||||
{
|
||||
$this->username = $username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get username
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
}
|
||||
43
app/Event/AuthSuccessEvent.php
Normal file
43
app/Event/AuthSuccessEvent.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event as BaseEvent;
|
||||
|
||||
/**
|
||||
* Authentication Success Event
|
||||
*
|
||||
* @package event
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class AuthSuccessEvent extends BaseEvent
|
||||
{
|
||||
/**
|
||||
* Authentication provider name
|
||||
*
|
||||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $authType;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param string $authType
|
||||
*/
|
||||
public function __construct($authType)
|
||||
{
|
||||
$this->authType = $authType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get authentication type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthType()
|
||||
{
|
||||
return $this->authType;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user