/** * @param array $params Driver parameters: * - drivers: (array) Array of Passwd_Driver objects. * * @throws Passwd_Exception */ public function __construct(array $params = array()) { if (!isset($params['drivers']) || !is_array($params['drivers'])) { throw new Passwd_Exception(_("Required 'drivers' is misconfigured in Composite configuration.")); } parent::__construct($params); }
/** */ public function __construct(array $params = array()) { if (empty($params['host']) || empty($params['port'])) { throw new Passwd_Exception(_("Password module is missing required parameters.")); } parent::__construct(array_merge(array('timeout' => 30), $params)); }
/** */ public function __construct(array $params = array()) { if (empty($params['server']) || empty($params['bin']) || empty($params['admusr']) || empty($params['admpwd'])) { throw new Passwd_Exception(_("Password module is missing required parameters.")); } if (!file_exists($params['bin'])) { throw new Passwd_Exception(_("Password module can't find the supplied bin.")); } parent::__construct($params); }
/** */ public function __construct($params = array()) { if (!isset($params['db'])) { throw new Passwd_Exception('Missing required Horde_Db_Adapter object'); } $this->_db = $params['db']; unset($params['db']); /* Use defaults from Horde. */ parent::__construct(array_merge(Horde::getDriverConfig('', 'sql'), array('clear_passwd' => 'pw_clear_passwd', 'domain' => 'pw_domain', 'encryption' => 'crypt', 'name' => 'pw_name', 'passwd' => 'pw_passwd', 'show_encryption' => false, 'table' => 'horde_users', 'use_clear_passwd' => false), $params)); }
/** * @param array $params Driver parameters: * - db: (Horde_Db_Adapter; REQUIRED) A DB Adapter object. * - encryption: (string) The encryption type. * - pass_col: (string) The table column for password. * - query_lookup: (string) Should we use a custom query for lookup? * - query_modify: (string) Should we use a custom query for changing? * - show_encryption: (boolean) Prepend the encryption type to the * password? * - table: (string) The name of the user database table. * - user_col: (string) The table column for user name. */ public function __construct(array $params = array()) { if (isset($params['db'])) { $this->_db = $params['db']; unset($params['db']); } else { throw new InvalidArgumentException('Missing required Horde_Db_Adapter object'); } /* These default to matching the Auth_Sql defaults. */ parent::__construct(array_merge(array('encryption' => 'ssha', 'pass_col' => 'user_pass', 'query_lookup' => false, 'query_modify' => false, 'show_encryption' => false, 'table' => 'horde_users', 'user_col' => 'user_uid'), $params)); }
/** */ public function __construct(array $params = array()) { // Default ISPConfig encryption settings parent::__construct(array_merge(array('encryption' => 'crypt-md5', 'show_encryption' => false), $params)); if (!class_exists('SoapClient')) { throw new Passwd_Exception('You need the soap PHP extension to use this driver.'); } if (empty($this->_params['soap_uri']) || empty($this->_params['soap_user'])) { throw new Passwd_Exception('The Passwd Ispconfig driver is not properly configured, edit your passwd/config/backends.local.php.'); } }
/** */ public function __construct(array $params = array()) { if (!class_exists('SoapClient')) { throw new Passwd_Exception('You need the soap PHP extension to use this driver.'); } if (empty($params['wsdl']) && (empty($params['soap_params']['location']) || empty($params['soap_params']['uri']))) { throw new Passwd_Exception('Either the "wsdl" or the "location" and "uri" parameter must be provided.'); } if (isset($params['wsdl'])) { unset($params['soap_params']['location']); unset($params['soap_params']['uri']); } $params['soap_params']['exceptions'] = false; parent::__construct($params); }
/** * Compares a plaintext password with an encrypted password. * * @param string $encrypted An encrypted password. * @param string $plaintext An unencrypted password. * * @throws Passwd_Exception if passwords don't match. */ protected function _comparePasswords($encrypted, $plaintext) { $encrypted = preg_replace('/^{MD5}(.*)/i', '{MD5-BASE64}$1', $encrypted); return parent::_comparePasswords($encrypted, $plaintext); }
/** */ public function __construct(array $params = array()) { parent::__construct(array_merge(array('host' => 'localhost', 'program' => '/usr/bin/smbpasswd'), $params)); }
/** */ public function __construct(array $params = array()) { parent::__construct(array_merge(array('host' => 'localhost', 'port' => 106), $params)); }