Ejemplo n.º 1
0
 /**
  * Creates a UserMapper instance configured using INI options.
  *
  * @return UserMapper
  */
 public static function makeConfigured()
 {
     $result = new UserMapper();
     $uidField = Config::getLdapUserIdField();
     if (!empty($uidField)) {
         $result->setLdapUserIdField($uidField);
     }
     $lastNameField = Config::getLdapLastNameField();
     if (!empty($lastNameField)) {
         $result->setLdapLastNameField($lastNameField);
     }
     $firstNameField = Config::getLdapFirstNameField();
     if (!empty($firstNameField)) {
         $result->setLdapFirstNameField($firstNameField);
     }
     $aliasField = Config::getLdapAliasField();
     if (!empty($aliasField)) {
         $result->setLdapAliasField($aliasField);
     }
     $mailField = Config::getLdapMailField();
     if (!empty($mailField)) {
         $result->setLdapMailField($mailField);
     }
     $userPasswordField = Config::getLdapPasswordField();
     if (!empty($userPasswordField)) {
         $result->setLdapUserPasswordField($userPasswordField);
     }
     $userEmailSuffix = Config::getLdapUserEmailSuffix();
     if (!empty($userEmailSuffix)) {
         $result->setUserEmailSuffix($userEmailSuffix);
     }
     $isRandomTokenAuthGenerationEnabled = Config::isRandomTokenAuthGenerationEnabled();
     if (!empty($isRandomTokenAuthGenerationEnabled)) {
         $result->setIsRandomTokenAuthGenerationEnabled($isRandomTokenAuthGenerationEnabled);
     }
     $appendUserEmailSuffixToUsername = Config::shouldAppendUserEmailSuffixToUsername();
     if (!empty($appendUserEmailSuffixToUsername)) {
         $result->setAppendUserEmailSuffixToUsername($appendUserEmailSuffixToUsername);
     }
     Log::debug("UserMapper::%s: configuring with uidField = %s, aliasField = %s firstNameField = %s, lastNameField = %s" . " mailField = %s, ldapUserPasswordField = %s, userEmailSuffix = %s, isRandomTokenAuthGenerationEnabled = %s", __FUNCTION__, $uidField, $aliasField, $firstNameField, $lastNameField, $mailField, $userPasswordField, $userEmailSuffix, $isRandomTokenAuthGenerationEnabled);
     return $result;
 }
Ejemplo n.º 2
0
 /**
  * Creates a UserMapper instance configured using INI options.
  *
  * @return UserMapper
  */
 public static function makeConfigured()
 {
     $result = new UserMapper();
     $uidField = Config::getLdapUserIdField();
     if (!empty($uidField)) {
         $result->setLdapUserIdField($uidField);
     }
     $lastNameField = Config::getLdapLastNameField();
     if (!empty($lastNameField)) {
         $result->setLdapLastNameField($lastNameField);
     }
     $firstNameField = Config::getLdapFirstNameField();
     if (!empty($firstNameField)) {
         $result->setLdapFirstNameField($firstNameField);
     }
     $aliasField = Config::getLdapAliasField();
     if (!empty($aliasField)) {
         $result->setLdapAliasField($aliasField);
     }
     $mailField = Config::getLdapMailField();
     if (!empty($mailField)) {
         $result->setLdapMailField($mailField);
     }
     $userPasswordField = Config::getLdapPasswordField();
     if (!empty($userPasswordField)) {
         $result->setLdapUserPasswordField($userPasswordField);
     }
     $userEmailSuffix = Config::getLdapUserEmailSuffix();
     if (!empty($userEmailSuffix)) {
         $result->setUserEmailSuffix($userEmailSuffix);
     }
     $isRandomTokenAuthGenerationEnabled = Config::isRandomTokenAuthGenerationEnabled();
     if (!empty($isRandomTokenAuthGenerationEnabled)) {
         $result->setIsRandomTokenAuthGenerationEnabled($isRandomTokenAuthGenerationEnabled);
     }
     $appendUserEmailSuffixToUsername = Config::shouldAppendUserEmailSuffixToUsername();
     if (!empty($appendUserEmailSuffixToUsername)) {
         $result->setAppendUserEmailSuffixToUsername($appendUserEmailSuffixToUsername);
     }
     return $result;
 }