1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96:
<?php
namespace Nethgui\Authorization;
/*
* Copyright (C) 2011 Nethesis S.r.l.
*
* This script is part of NethServer.
*
* NethServer 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 3 of the License, or
* (at your option) any later version.
*
* NethServer 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.
*
* You should have received a copy of the GNU General Public License
* along with NethServer. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* UserInterface implements the authentication procedure and
* provides access to authentication credentials of the user
*
*
* @author Davide Principi <davide.principi@nethesis.it>
* @since 1.0
* @api
*/
interface UserInterface extends AuthorizationAttributesProviderInterface
{
const ID = __CLASS__;
/**
* Authenticate the user through the given credentials.
*
* NOTE:
* You can pass an arbitrary number of arguments to the
* authentication procedure. The actual number of arguments depends on
* the implementation.
*
* @api
* @see isAuthenticated()
* @return boolean TRUE if authentication is successful
*/
public function authenticate();
/**
* The authentication state
*
* @api
* @return boolean TRUE if authenticated, FALSE otherwise
*/
public function isAuthenticated();
/**
* Authentication credentials are acquired during authentication and
* provide the basic informations for authorization decisions.
*
* @api
* @param string $credentialName
* @return mixed
*/
public function getCredential($credentialName);
/**
* Check whether $credentialName is present or not.
*
* @api
* @return boolean
*/
public function hasCredential($credentialName);
/**
* The language that was choosen by the user
*
* @api
* @deprecated since version 1.7.0
* @return string ISO 639-1 language code (2 characters).
*/
public function getLanguageCode();
/**
* Get the User preferred locale
*
* @api
* @return string RFC 4646 compliant
*/
public function getLocale();
}