$_capabilities
$_capabilities : array
An array of capabilities, so that the driver can report which operations it supports and which it doesn't.
The Horde_Auth_Cyrsql class provides a SQL implementation of the Horde authentication system for the Cyrus IMAP server. Most of the functionality is the same as for the SQL class; only what is different overrides the parent class implementations.
The table structure for the auth system is as follows:
CREATE TABLE accountuser ( username VARCHAR(255) BINARY NOT NULL DEFAULT '', password VARCHAR(32) BINARY NOT NULL DEFAULT '', prefix VARCHAR(50) NOT NULL DEFAULT '', domain_name VARCHAR(255) NOT NULL DEFAULT '', UNIQUE KEY username (username) ); CREATE TABLE adminuser ( username VARCHAR(50) BINARY NOT NULL DEFAULT '', password VARCHAR(50) BINARY NOT NULL DEFAULT '', type INT(11) NOT NULL DEFAULT '0', SID VARCHAR(255) NOT NULL DEFAULT '', home VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (username) ); CREATE TABLE alias ( alias VARCHAR(255) NOT NULL DEFAULT '', dest LONGTEXT, username VARCHAR(50) NOT NULL DEFAULT '', status INT(11) NOT NULL DEFAULT '1', PRIMARY KEY (alias) ); CREATE TABLE domain ( domain_name VARCHAR(255) NOT NULL DEFAULT '', prefix VARCHAR(50) NOT NULL DEFAULT '', maxaccounts INT(11) NOT NULL DEFAULT '20', quota INT(10) NOT NULL DEFAULT '20000', transport VARCHAR(255) NOT NULL DEFAULT 'cyrus', freenames ENUM('YES','NO') NOT NULL DEFAULT 'NO', freeaddress ENUM('YES','NO') NOT NULL DEFAULT 'NO', PRIMARY KEY (domain_name), UNIQUE KEY prefix (prefix) ); CREATE TABLE domainadmin ( domain_name VARCHAR(255) NOT NULL DEFAULT '', adminuser VARCHAR(255) NOT NULL DEFAULT '' ); CREATE TABLE search ( search_id VARCHAR(255) NOT NULL DEFAULT '', search_sql TEXT NOT NULL, perpage INT(11) NOT NULL DEFAULT '0', timestamp TIMESTAMP(14) NOT NULL, PRIMARY KEY (search_id), KEY search_id (search_id) ); CREATE TABLE virtual ( alias VARCHAR(255) NOT NULL DEFAULT '', dest LONGTEXT, username VARCHAR(50) NOT NULL DEFAULT '', status INT(11) NOT NULL DEFAULT '1', KEY alias (alias) ); CREATE TABLE log ( id INT(11) NOT NULL AUTO_INCREMENT, msg TEXT NOT NULL, user VARCHAR(255) NOT NULL DEFAULT '', host VARCHAR(255) NOT NULL DEFAULT '', time DATETIME NOT NULL DEFAULT '2000-00-00 00:00:00', pid VARCHAR(255) NOT NULL DEFAULT '', PRIMARY KEY (id) );
__construct(array $params = array())
Constructor.
array | $params | Parameters:
|
authenticate(string $userId, array $credentials, boolean $login = true) : boolean
Finds out if a set of login credentials are valid, and if requested, mark the user as logged in in the current session.
string | $userId | The userId to check. |
array | $credentials | The credentials to check. |
boolean | $login | Whether to log the user in. If false, we'll only test the credentials and won't modify the current session. Defaults to true. |
Whether or not the credentials are valid.
isLocked(string $userId, boolean $show_details = false) : boolean|array
Returns whether a user is currently locked.
string | $userId | The user to check. |
boolean | $show_details | Return timeout too? |
If $show_details is a true, an array with 'locked' and 'lock_timeout' values. Whether the user is locked, otherwise.
transparent() : boolean
Automatic authentication.
Transparent authentication should set 'userId', 'credentials', or 'params' in $this->_credentials as needed - these values will be used to set the credentials in the session.
Transparent authentication should normally never throw an error - false should be returned.
Whether transparent login is supported.
getCredential(mixed $name = null) : mixed
Returns internal credential value(s).
mixed | $name | The credential value to get. If null, will return the entire credential list. Valid names:
|
The credential information, or null if the credential doesn't exist.
_authenticate(string $userId, array $credentials)
Find out if a set of login credentials are valid.
On failure, Horde_Auth_Exception should pass a message string (if any) in the message field, and the HordeAuth::REASON* constant in the code field (defaults to Horde_Auth::REASON_MESSAGE).
string | $userId | The userId to check. |
array | $credentials | The credentials to use. |
_comparePasswords(string $encrypted, string $plaintext) : boolean
Compare an encrypted password to a plaintext string to see if they match.
string | $encrypted | The crypted password to compare against. |
string | $plaintext | The plaintext password to verify. |
True if matched, false otherwise.
_sort(array $users, boolean $sort) : array
Basic sort implementation.
If the backend has listUsers and doesn't have a native sorting option, fall back to this method.
array | $users | An array of usernames. |
boolean | $sort | Whether to sort or not. |
the users, sorted or not