Commit 589f6688 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes: #2859 Added comment modifier, force uid unicity

Showing with 11 additions and 9 deletions
+11 -9
...@@ -565,6 +565,8 @@ class plugin ...@@ -565,6 +565,8 @@ class plugin
mb_internal_encoding('UTF-8'); mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8'); mb_regex_encoding('UTF-8');
switch($m) { switch($m) {
case 'c': // comment
return array('');
case 'u': // uppercase case 'u': // uppercase
return array(mb_strtoupper($str, 'UTF-8')); return array(mb_strtoupper($str, 'UTF-8'));
case 'l': // lowercase case 'l': // lowercase
......
...@@ -1250,16 +1250,16 @@ class user extends plugin ...@@ -1250,16 +1250,16 @@ class user extends plugin
$message[]= msgPool::check_base();; $message[]= msgPool::check_base();;
} }
if (!$this->is_template){ /* UID already used? */
/* UID already used? */ $ldap = $this->config->get_ldap_link();
$ldap= $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']);
$ldap->cd($this->config->current['BASE']); $ldap->search("(uid=$this->uid)", array("uid"));
$ldap->search("(uid=$this->uid)", array("uid")); $ldap->fetch();
$ldap->fetch(); if ($ldap->count() != 0 && $this->dn == 'new') {
if ($ldap->count() != 0 && $this->dn == 'new'){ $message[] = msgPool::duplicated(_("Login"));
$message[]= msgPool::duplicated(_("Login")); }
}
if (!$this->is_template){
if ($this->givenName == ""){ if ($this->givenName == ""){
$message[]= msgPool::required(_("Given name")); $message[]= msgPool::required(_("Given name"));
} }
......
  • bmortier @bmortier

    mentioned in issue #982 (closed)

    By Côme Chilliet on 2017-09-02T15:06:50 (imported from GitLab)

    ·

    mentioned in issue #982 (closed)

    By Côme Chilliet on 2017-09-02T15:06:50 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment