Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce interface Icinga\Authentication\User\UserBackendInterface
refs #8826
- Loading branch information
Johannes Meyer
committed
May 4, 2015
1 parent
870e75c
commit 68657c0
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
library/Icinga/Authentication/User/UserBackendInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |