PHP Класс 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)
);
Автор: Ilya Krel ([email protected])
Автор: Jan Schneider ([email protected])
Наследование: extends Horde_Auth_Sql
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
_authenticate ( string $userId, array $credentials ) Find out if a set of login credentials are valid.

Описание методов

__construct() публичный Метод

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() защищенный Метод

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() публичный Метод

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() публичный Метод

List all users in the system.
public listUsers ( boolean $sort = false ) : mixed
$sort boolean Sort the users?
Результат mixed The array of userIds.

removeUser() публичный Метод

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

updateUser() публичный Метод

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

Описание свойств

$_capabilities защищенное свойство

An array of capabilities, so that the driver can report which operations it supports and which it doesn't.
protected array $_capabilities
Результат array

$_imap защищенное свойство

Horde_Imap_Client object.
protected Horde_Imap_Client_Base $_imap
Результат Horde_Imap_Client_Base