看板初始化提交
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
use Symfony\Contracts\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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
use Symfony\Contracts\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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
class CommentEvent extends GenericEvent
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
use ArrayAccess;
|
||||
use Symfony\Contracts\EventDispatcher\Event as BaseEvent;
|
||||
|
||||
class GenericEvent extends BaseEvent implements ArrayAccess
|
||||
{
|
||||
protected $container = array();
|
||||
|
||||
public function __construct(array $values = array())
|
||||
{
|
||||
$this->container = $values;
|
||||
}
|
||||
|
||||
public function getTaskId()
|
||||
{
|
||||
if (isset($this->container['task']['id'])) {
|
||||
return $this->container['task']['id'];
|
||||
}
|
||||
|
||||
if (isset($this->container['task_id'])) {
|
||||
return $this->container['task_id'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getProjectId()
|
||||
{
|
||||
if (isset($this->container['task']['project_id'])) {
|
||||
return $this->container['task']['project_id'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getAll()
|
||||
{
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
class ProjectFileEvent extends GenericEvent
|
||||
{
|
||||
public function getProjectId()
|
||||
{
|
||||
if (isset($this->container['file']['project_id'])) {
|
||||
return $this->container['file']['project_id'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
class SubtaskEvent extends GenericEvent
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
class TaskEvent extends GenericEvent
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
class TaskFileEvent extends GenericEvent
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
class TaskLinkEvent extends GenericEvent
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
class TaskListEvent extends GenericEvent
|
||||
{
|
||||
public function setTasks(array &$tasks)
|
||||
{
|
||||
$this->container['tasks'] =& $tasks;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Event;
|
||||
|
||||
use Kanboard\Core\User\UserProviderInterface;
|
||||
use Kanboard\User\LdapUserProvider;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class UserProfileSyncEvent
|
||||
*
|
||||
* @package Kanboard\Event
|
||||
* @author Fredic Guillot
|
||||
*/
|
||||
class UserProfileSyncEvent extends Event
|
||||
{
|
||||
/**
|
||||
* User profile
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $profile;
|
||||
|
||||
/**
|
||||
* User provider
|
||||
*
|
||||
* @var UserProviderInterface
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* UserProfileSyncEvent constructor.
|
||||
*
|
||||
* @param array $profile
|
||||
* @param UserProviderInterface $user
|
||||
*/
|
||||
public function __construct(array $profile, UserProviderInterface $user)
|
||||
{
|
||||
$this->profile = $profile;
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user profile
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProfile()
|
||||
{
|
||||
return $this->profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user provider object
|
||||
*
|
||||
* @access public
|
||||
* @return UserProviderInterface|LdapUserProvider
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user