X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fplugins%2Fpersonal%2Fgeneric%2Fclass_user.inc;h=b81be284c3904b0ca47389be2da75143c6580ed7;hb=599213321dc69ae86f2951df82d6d0c93e8cfc9d;hp=7e02c71ede3174263ad804b74125c4fdab7b0f08;hpb=96ed33b5a60800ae93d981a1ab4ede0aad955b7b;p=gosa.git diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc index 7e02c71ed..b81be284c 100644 --- a/gosa-core/plugins/personal/generic/class_user.inc +++ b/gosa-core/plugins/personal/generic/class_user.inc @@ -141,7 +141,7 @@ class user extends plugin $this->config= $config; /* Configuration is fine, allways */ - if($this->config->get_cfg_value("honourIvbbAttributes") == "true"){ + if($this->config->get_cfg_value("core","honourIvbbAttributes") == "true"){ $this->governmentmode = TRUE; $this->attributes=array_merge($this->attributes,$this->govattrs); } @@ -175,7 +175,7 @@ class user extends plugin } /* Make hash default to md5 if not set in config */ - $hash= $this->config->get_cfg_value("passwordDefaultHash", "crypt/md5"); + $hash= $this->config->get_cfg_value("core","passwordDefaultHash"); /* Load data from LDAP? */ if ($dn !== NULL){ @@ -270,7 +270,7 @@ class user extends plugin $attrs = $ldap->fetch(); $this->manager_name = $attrs['cn'][0]; }else{ - $this->manager_name = "("._("Unknown")."!): ".$this->manager; + $this->manager_name = "("._("unknown")."!): ".$this->manager; } } } @@ -332,7 +332,7 @@ class user extends plugin $smarty= get_smarty(); - $smarty->assign("usePrototype", "true"); + $smarty->assign("gosaLoginRestrictionWidget", $this->gosaLoginRestrictionWidget->render()); /* Assign sex */ @@ -565,7 +565,7 @@ class user extends plugin /* Additional info if start end time is '0' */ $add_str_info = ""; if($timeto == 0 && $timefrom == 0){ - $add_str_info = "
"._("(Some types of certificates are currently not supported and may be displayed as 'invalid'.)").""; + $add_str_info = "
".bold(_("(Not supported certificate types are marked as invalid.)")); } $str = " @@ -576,10 +576,10 @@ class user extends plugin

". sprintf(_("Certificate is valid from %s to %s and is currently %s."), - "".date('d M Y',$timefrom)."", - "".date('d M Y',$timeto)."", - $certificate->isvalid()?""._("valid")."": - ""._("invalid")."").$add_str_info; + bold(date('d M Y',$timefrom)), + bold(date('d M Y',$timeto)), + $certificate->isvalid()?bold(""._("valid").""): + bold(""._("invalid")."")).$add_str_info; $smarty->assign($cert."info",$str); $smarty->assign($cert."_state","true"); @@ -600,7 +600,7 @@ class user extends plugin /* Prepare password hashes */ if ($this->pw_storage == ""){ - $this->pw_storage= $this->config->get_cfg_value("hash"); + $this->pw_storage= $this->config->get_cfg_value("core","passwordDefaultHash"); } $temp= passwordMethod::get_available_methods(); @@ -746,7 +746,6 @@ class user extends plugin while ($ldap->fetch()){ $og= new ogroup($this->config, $ldap->getDN()); unset($og->member[$this->dn]); - $og->member= array_values($og->member); $og->save (); } @@ -1153,11 +1152,11 @@ class user extends plugin die ("Could not connect to LDAP server"); } ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("ldapFollowReferrals") == "true") { + if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("core","ldapFollowReferrals") == "true") { ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1); ldap_set_rebind_proc($ds, array(&$this, "rebind")); } - if($this->config->get_cfg_value("ldapTLS") == "true"){ + if($this->config->get_cfg_value("core","ldapTLS") == "true"){ ldap_start_tls($ds); } if (!($res = @ldap_bind($ds, $this->config->current['ADMIN'], @@ -1242,7 +1241,7 @@ class user extends plugin function update_new_dn() { // Alternative way to handle DN - $pattern= $this->config->get_cfg_value("accountRDN"); + $pattern= $this->config->get_cfg_value("user","accountRDN"); if ($pattern != "") { $rdn= $this->create_initial_rdn($pattern); $attribute= preg_replace('/=.*$/', '', $rdn); @@ -1260,7 +1259,7 @@ class user extends plugin } else { $pt= ""; - if($this->config->get_cfg_value("personalTitleInDN") == "true"){ + if($this->config->get_cfg_value("core","personalTitleInDN") == "true"){ if(!empty($this->personalTitle)){ $pt = $this->personalTitle." "; } @@ -1269,7 +1268,7 @@ class user extends plugin $this->cn= $pt.$this->givenName." ".$this->sn; /* Permissions for that base? */ - if ($this->config->get_cfg_value("accountPrimaryAttribute") == "uid"){ + if ($this->config->get_cfg_value("core","accountPrimaryAttribute") == "uid"){ $this->new_dn= 'uid='.$this->uid.','.get_people_ou().$this->base; } else { /* Don't touch dn, if cn hasn't changed */ @@ -1344,7 +1343,7 @@ class user extends plugin if ($this->uid == ""){ $message[]= msgPool::required(_("Login")); } - if ($this->config->get_cfg_value("accountPrimaryAttribute") != "uid"){ + if ($this->config->get_cfg_value("core","accountPrimaryAttribute") != "uid"){ $ldap->cat($this->new_dn); if ($ldap->count() != 0 && $this->dn != $this->new_dn && $this->dn == 'new'){ $message[]= msgPool::duplicated(_("Name")); @@ -1439,11 +1438,11 @@ class user extends plugin { $ds= ldap_connect($this->config->current['SERVER']); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("ldapFollowReferrals") == "true"){ + if (function_exists("ldap_set_rebind_proc") && $this->config->get_cfg_value("core","ldapFollowReferrals") == "true"){ ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1); ldap_set_rebind_proc($ds, array(&$this, "rebind")); } - if ($this->config->get_cfg_value("ldapTLS") == "true"){ + if ($this->config->get_cfg_value("core","ldapTLS") == "true"){ ldap_start_tls($ds); } @@ -1646,15 +1645,17 @@ class user extends plugin /* Generate dateOfBirth entry */ if (isset ($source['dateOfBirth'])){ - - /* This entry is ISO 8601 conform */ list($year, $month, $day)= explode("-", $source['dateOfBirth'][0], 3); - -#TODO: use $lang to convert date $this->dateOfBirth= "$day.$month.$year"; } else { $this->dateOfBirth= ""; } + + // Try to load the user picture + $tmp_dn = $this->dn; + $this->dn = $source['dn']; + $this->load_picture(); + $this->dn = $tmp_dn; } @@ -1686,13 +1687,29 @@ class user extends plugin "plCategory" => array("users" => array("description" => _("Users"), "objectClass" => "gosaAccount")), + + "plProperties" => array( + array( + "name" => "accountRDN", + "type" => "string", + "default" => "", + "description" => sprintf( + _("The 'accountRDN' option tells GOsa to use a placeholder pattern for generating account RDNs. A pattern can include attribute names prefaced by a % and normal text: %s. This will generate a RDN consisting of cn=.... filled with surname and given name of the edited account. This option disables the use of accountPrimaryAttribute and personalTitleInDn."), + "accountRDN=\"cn=%sn %givenName\""), + "check" => "gosaProperty::isString", + "migrate" => "", + "group" => "plugin", + "mandatory" => FALSE + ) + + ), "plProvidedAcls" => array( "sn" => _("Surname"), "givenName" => _("Given name"), - "uid" => _("User identification"), + "uid" => _("Login"), - "gosaUserDefinedFilter" => _("Allow to define user filters"), + "gosaUserDefinedFilter" => _("Allow definition of custom filters"), "personalTitle" => _("Personal title"), "academicTitle" => _("Academic title"), @@ -1731,13 +1748,13 @@ class user extends plugin ); - /* Append government attributes if required */ - global $config; - if($config->get_cfg_value("honourIvbbAttributes") == "true"){ - foreach($govattrs as $attr => $desc){ - $ret["plProvidedAcls"][$attr] = $desc; - } - } +# /* Append government attributes if required */ +# global $config; +# if($config->get_cfg_value("core","honourIvbbAttributes") == "true"){ +# foreach($govattrs as $attr => $desc){ +# $ret["plProvidedAcls"][$attr] = $desc; +# } +# } return($ret); } @@ -1884,7 +1901,7 @@ class user extends plugin $attrs = $ldap->fetch(); $this->manager_name = $attrs['cn'][0]; }else{ - $this->manager_name = "("._("Unknown")."!): ".$this->manager; + $this->manager_name = "("._("unknown")."!): ".$this->manager; } }