__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array A hash containing connection parameters.
Example #1
0
 /**
  * @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);
 }
Example #2
0
 /**
  */
 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));
 }
Example #3
0
 /**
  */
 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);
 }
Example #4
0
 /**
  */
 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));
 }
Example #5
0
 /**
  * @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));
 }
Example #6
0
 /**
  */
 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.');
     }
 }
Example #7
0
 /**
  */
 public function __construct(array $params = array())
 {
     foreach (array('basedn', 'ldap', 'uid') as $val) {
         if (!isset($params[$val])) {
             throw new InvalidArgumentException(__CLASS__ . ': Missing ' . $val . ' parameter.');
         }
     }
     $this->_ldap = $params['ldap'];
     unset($params['ldap']);
     parent::__construct(array_merge(array('host' => 'localhost', 'port' => 389, 'encryption' => 'crypt', 'show_encryption' => 'true', 'uid' => 'uid', 'basedn' => '', 'admindn' => '', 'adminpw' => '', 'realm' => '', 'filter' => null, 'tls' => false, 'attribute' => 'userPassword', 'shadowlastchange' => '', 'shadowmin' => ''), $params));
     if (!empty($this->_params['tls']) && empty($this->_params['sslhost'])) {
         $this->_params['sslhost'] = $this->_params['host'];
     }
 }
Example #8
0
 /**
  */
 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);
 }
Example #9
0
 /**
  */
 public function __construct(array $params = array())
 {
     parent::__construct(array_merge(array('host' => 'localhost', 'program' => '/usr/bin/smbpasswd'), $params));
 }
Example #10
0
 /**
  */
 public function __construct(array $params = array())
 {
     parent::__construct(array_merge(array('host' => 'localhost', 'port' => 106), $params));
 }