/** * Create an instance * @param array $config * @param array $secretconfig */ public function __construct($config, $secretconfig = array()) { parent::__construct($config, $secretconfig); $this->tablename = $config['table']; try { $this->handle = new PDO($config['dsn'], $config['username'], $config['password']); } catch (PDOException $e) { return false; } }
/** * Create an instance * @param $config */ public function __construct($config, $secretconfig = array()) { parent::__construct($config, $secretconfig); $this->_userClass = isset($config['userClass']) ? $config['userClass'] : "tiqrPerson"; $this->_dnPattern = isset($config['dnPattern']) ? $config['dnPattern'] : "%s"; $this->_idAttr = isset($config['idAttr']) ? $config['idAttr'] : 'dn'; $this->_displayNameAttr = isset($config['displayNameAttr']) ? $config['displayNameAttr'] : 'sn'; $this->_secretAttr = isset($config['secretAttr']) ? $config['secretAttr'] : 'tiqrSecret'; $this->_notificationTypeAttr = isset($config['notificationTypeAttr']) ? $config['notificationTypeAttr'] : 'tiqrNotificationType'; $this->_notificationAddressAttr = isset($config['notificationAddressAttr']) ? $config['notificationAddressAttr'] : 'tiqrNotificationAddress'; $this->_isBlockedAttr = isset($config['isBlockedAttr']) ? $config['isBlockedAttr'] : 'tiqrIsBlocked'; $this->_loginAttemptsAttr = isset($config['loginAttemptsAttr']) ? $config['loginAttemptsAttr'] : 'tiqrLoginAttempts'; $this->_temporaryBlockAttemptAttr = isset($config['temporaryBlockAttemptsAttr']) ? $config['temporaryBlockAttemptsAttr'] : 'tiqrTemporaryBlockAttempts'; $this->_temporaryBlockTimestampAttr = isset($config['temporaryBlockTimestampAttr']) ? $config['temporaryBlockTimestampAttr'] : 'tiqrTemporaryBlockTimestamp'; $this->_attributes = isset($config['attributes']) ? $config['attributes'] : null; $ldapOptions = array("host" => $config['host'], "username" => $config['username'], "password" => $config['password'], "bindRequiresDn" => $config['bindRequiresDn'], "accountDomainName" => $config['accountDomainName'], "baseDn" => $config['baseDn']); $this->_ldap = new Zend_Ldap($ldapOptions); }