Introduce interface Icinga\Authentication\User\UserBackendInterface
refs #8826
This commit is contained in:
parent
870e75c99c
commit
68657c02ee
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||
|
||||
namespace Icinga\Authentication\User;
|
||||
|
||||
use Icinga\Exception\AuthenticationException;
|
||||
use Icinga\User;
|
||||
|
||||
/**
|
||||
* Interface for user backends
|
||||
*/
|
||||
interface UserBackendInterface
|
||||
{
|
||||
/**
|
||||
* Set this backend's name
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name);
|
||||
|
||||
/**
|
||||
* Return this backend's name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName();
|
||||
|
||||
/**
|
||||
* Authenticate the given user
|
||||
*
|
||||
* @param User $user
|
||||
* @param string $password
|
||||
*
|
||||
* @return bool True on success, false on failure
|
||||
*
|
||||
* @throws AuthenticationException In case authentication is not possible due to an error
|
||||
*/
|
||||
public function authenticate(User $user, $password);
|
||||
}
|
Loading…
Reference in New Issue