Esempio n. 1
0
 /**
  * Creates a new {@link LdapUsers} instance using config.ini.php values.
  *
  * @return LdapUsers
  */
 public static function makeConfigured()
 {
     $result = new LdapUsers();
     $result->setLdapServers(Config::getConfiguredLdapServers());
     $usernameSuffix = Config::getLdapUserEmailSuffix();
     if (!empty($usernameSuffix)) {
         $result->setAuthenticationUsernameSuffix($usernameSuffix);
     }
     $requiredMemberOf = Config::getRequiredMemberOf();
     if (!empty($requiredMemberOf)) {
         $result->setAuthenticationRequiredMemberOf($requiredMemberOf);
     }
     $memberOfField = Config::getRequiredMemberOfField();
     if (!empty($memberOfField)) {
         $result->setAuthenticationMemberOfField($memberOfField);
     }
     $filter = Config::getLdapUserFilter();
     if (!empty($filter)) {
         $result->setAuthenticationLdapFilter($filter);
     }
     $timeoutSecs = Config::getLdapNetworkTimeout();
     if (!empty($timeoutSecs)) {
         $result->setLdapNetworkTimeout($timeoutSecs);
     }
     $result->setLdapUserMapper(UserMapper::makeConfigured());
     Log::debug("LdapUsers::%s: configuring with userEmailSuffix = %s, requiredMemberOf = %s, filter = %s, timeoutSecs = %s", __FUNCTION__, $usernameSuffix, $requiredMemberOf, $filter, $timeoutSecs);
     return $result;
 }
 /**
  * Creates a new {@link LdapUsers} instance using config.ini.php values.
  *
  * @return LdapUsers
  */
 public static function makeConfigured()
 {
     $result = new LdapUsers();
     $result->setLdapServers(Config::getConfiguredLdapServers());
     $usernameSuffix = Config::getLdapUserEmailSuffix();
     if (!empty($usernameSuffix)) {
         $result->setAuthenticationUsernameSuffix($usernameSuffix);
     }
     $requiredMemberOf = Config::getRequiredMemberOf();
     if (!empty($requiredMemberOf)) {
         $result->setAuthenticationRequiredMemberOf($requiredMemberOf);
     }
     $memberOfField = Config::getRequiredMemberOfField();
     if (!empty($memberOfField)) {
         $result->setAuthenticationMemberOfField($memberOfField);
     }
     $filter = Config::getLdapUserFilter();
     if (!empty($filter)) {
         $result->setAuthenticationLdapFilter($filter);
     }
     $timeoutSecs = Config::getLdapNetworkTimeout();
     if (!empty($timeoutSecs)) {
         $result->setLdapNetworkTimeout($timeoutSecs);
     }
     $result->setLdapUserMapper(UserMapper::makeConfigured());
     return $result;
 }