/** * Sets username and password for authentication * * @return void */ public function __construct($username, $password, array $arrayOfOptions = array()) { $this->_identityUserName = $username; try { if (!is_array($arrayOfOptions)) { throw new USVN_Exception(T_("LDAP options must be an array!")); } if (!isset($arrayOfOptions[0]) || !is_array($arrayOfOptions[0])) { $arrayOfOptions = array($arrayOfOptions); } foreach ($arrayOfOptions as &$options) { if (array_key_exists('bindDnFormat', $options)) { $username = sprintf($options['bindDnFormat'], $username); unset($options['bindDnFormat']); } } parent::__construct($arrayOfOptions, $username, $password); } catch (Exception $e) { throw new USVN_Exception($e->getMessage()); } }