2013-06-07 11:44:37 +02:00
|
|
|
<?php
|
2013-06-10 17:03:01 +02:00
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
2013-06-28 16:47:30 +02:00
|
|
|
/**
|
2013-10-23 15:10:33 +02:00
|
|
|
* This file is part of Icinga Web 2.
|
2013-09-04 18:27:16 +02:00
|
|
|
*
|
2013-10-23 15:10:33 +02:00
|
|
|
* Icinga Web 2 - Head for multiple monitoring backends.
|
2013-06-28 16:47:30 +02:00
|
|
|
* Copyright (C) 2013 Icinga Development Team
|
2013-09-04 18:27:16 +02:00
|
|
|
*
|
2013-06-28 16:47:30 +02:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2013-09-04 18:27:16 +02:00
|
|
|
*
|
2013-06-28 16:47:30 +02:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2013-09-04 18:27:16 +02:00
|
|
|
*
|
2013-06-28 16:47:30 +02:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2013-09-04 18:27:16 +02:00
|
|
|
*
|
2013-10-23 15:10:33 +02:00
|
|
|
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
|
|
|
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
|
|
|
* @author Icinga Development Team <info@icinga.org>
|
|
|
|
*
|
2013-06-28 16:47:30 +02:00
|
|
|
*/
|
2013-06-10 17:03:01 +02:00
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}}
|
2013-06-07 11:44:37 +02:00
|
|
|
|
|
|
|
namespace Icinga\Authentication;
|
|
|
|
|
2013-08-28 10:16:18 +02:00
|
|
|
use \Zend_Config;
|
|
|
|
use \Icinga\User;
|
2013-08-30 10:24:05 +02:00
|
|
|
use Icinga\Authentication\Credential;
|
2013-08-28 10:16:18 +02:00
|
|
|
|
2013-08-27 14:37:22 +02:00
|
|
|
/**
|
2013-08-28 10:16:18 +02:00
|
|
|
* Public api for an user backend object
|
2013-08-27 14:37:22 +02:00
|
|
|
*/
|
2013-06-10 13:28:54 +02:00
|
|
|
interface UserBackend
|
2013-06-07 11:44:37 +02:00
|
|
|
{
|
2013-06-25 12:24:52 +02:00
|
|
|
/**
|
|
|
|
* Test if the username exists
|
2013-08-26 17:23:31 +02:00
|
|
|
*
|
2013-08-30 10:24:05 +02:00
|
|
|
* @param Credential $credentials
|
2013-08-28 10:16:18 +02:00
|
|
|
*
|
|
|
|
* @return bool
|
2013-06-25 12:24:52 +02:00
|
|
|
*/
|
2013-08-30 10:24:05 +02:00
|
|
|
public function hasUsername(Credential $credentials);
|
2013-06-07 11:44:37 +02:00
|
|
|
|
2013-06-25 12:24:52 +02:00
|
|
|
/**
|
|
|
|
* Authenticate
|
2013-08-26 17:23:31 +02:00
|
|
|
*
|
2013-08-30 10:24:05 +02:00
|
|
|
* @param Credential $credentials
|
2013-08-28 10:16:18 +02:00
|
|
|
*
|
|
|
|
* @return User
|
2013-06-25 12:24:52 +02:00
|
|
|
*/
|
2013-08-30 10:24:05 +02:00
|
|
|
public function authenticate(Credential $credentials);
|
2013-08-26 17:23:31 +02:00
|
|
|
|
2013-08-28 10:16:18 +02:00
|
|
|
/**
|
|
|
|
* Name of the backend
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getName();
|
|
|
|
|
2013-08-26 17:23:31 +02:00
|
|
|
/**
|
|
|
|
* Get the number of users available through this backend
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getUserCount();
|
2013-08-27 17:17:09 +02:00
|
|
|
}
|