PHP Class Horde_Auth_Cyrsql, horde

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)
);
Author: Ilya Krel ([email protected])
Author: Jan Schneider ([email protected])
Inheritance: extends Horde_Auth_Sql
Exibir arquivo Open project: horde/horde

Protected Properties

Property Type Description
$_capabilities array An array of capabilities, so that the driver can report which operations it supports and which it doesn't.
$_imap Horde_Imap_Client_Base Horde_Imap_Client object.

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
addUser ( string $userId, array $credentials ) Add a set of authentication credentials.
listUsers ( boolean $sort = false ) : mixed List all users in the system.
removeUser ( string $userId ) Delete a set of authentication credentials.
updateUser ( string $oldID, string $newID, array $credentials ) Update a set of authentication credentials.

Protected Methods

Method Description
_authenticate ( string $userId, array $credentials ) Find out if a set of login credentials are valid.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array Parameters: - domain_field: (string) If set to anything other than 'none' this is used as field name where domain is stored. DEFAULT: 'domain_name' - folders: (array) An array of folders to create under username. DEFAULT: NONE - hidden_accounts: (array) An array of system accounts to hide from the user interface. DEFAULT: None. - imap: (Horde_Imap_Client_Base) [REQUIRED] An IMAP client object. - quota: (integer) The quota (in kilobytes) to grant on the mailbox. DEFAULT: NONE - userhierarchy: (string) The user hierarchy prefix (UTF-8). DEFAULT: 'user.'

_authenticate() protected method

Find out if a set of login credentials are valid.
protected _authenticate ( string $userId, array $credentials )
$userId string The userId to check.
$credentials array The credentials to use.

addUser() public method

Add a set of authentication credentials.
public addUser ( string $userId, array $credentials )
$userId string The userId to add.
$credentials array The credentials to add.

listUsers() public method

List all users in the system.
public listUsers ( boolean $sort = false ) : mixed
$sort boolean Sort the users?
return mixed The array of userIds.

removeUser() public method

Delete a set of authentication credentials.
public removeUser ( string $userId )
$userId string The userId to delete.

updateUser() public method

Update a set of authentication credentials.
public updateUser ( string $oldID, string $newID, array $credentials )
$oldID string The old userId.
$newID string The new userId. [NOT SUPPORTED]
$credentials array The new credentials

Property Details

$_capabilities protected_oe property

An array of capabilities, so that the driver can report which operations it supports and which it doesn't.
protected array $_capabilities
return array

$_imap protected_oe property

Horde_Imap_Client object.
protected Horde_Imap_Client_Base $_imap
return Horde_Imap_Client_Base