You are here

protected function LdapServerAdmin::warnings in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_servers/LdapServerAdmin.class.php \LdapServerAdmin::warnings()
  2. 7 ldap_servers/LdapServerAdmin.class.php \LdapServerAdmin::warnings()
1 call to LdapServerAdmin::warnings()
LdapServerAdmin::drupalFormWarnings in ldap_servers/LdapServerAdmin.class.php

File

ldap_servers/LdapServerAdmin.class.php, line 438

Class

LdapServerAdmin

Code

protected function warnings($op, $has_errors = NULL) {
  $warnings = [];
  if ($this->ldap_type) {
    $defaults = ldap_servers_ldaps_option_array();
    if (isset($defaults['user']['user_attr']) && $this->user_attr != $defaults['user']['user_attr']) {
      $tokens = [
        '%name' => $defaults['name'],
        '%default' => $defaults['user']['user_attr'],
        '%user_attr' => $this->user_attr,
      ];
      $warnings['user_attr'] = t('The standard UserName attribute in %name is %default.  You have %user_attr. This may be correct
          for your particular LDAP.', $tokens);
    }
    if (isset($defaults['user']['mail_attr']) && $this->mail_attr && $this->mail_attr != $defaults['user']['mail_attr']) {
      $tokens = [
        '%name' => $defaults['name'],
        '%default' => $defaults['user']['mail_attr'],
        '%mail_attr' => $this->mail_attr,
      ];
      $warnings['mail_attr'] = t('The standard mail attribute in %name is %default.  You have %mail_attr.  This may be correct
          for your particular LDAP.', $tokens);
    }
  }
  if (!$this->mail_attr && !$this->mail_template) {
    $warnings['mail_attr'] = t('Mail attribute or Mail Template should be used for most user account functionality.');
  }
  return $warnings;
}