diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index 8bb519724d0dcd165d361570d101b01a6ac2f800..b81be284c3904b0ca47389be2da75143c6580ed7 100644 (file)
$this->config= $config;
/* Configuration is fine, allways */
$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);
}
$this->governmentmode = TRUE;
$this->attributes=array_merge($this->attributes,$this->govattrs);
}
}
/* Make hash default to md5 if not set in config */
}
/* 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){
/* Load data from LDAP? */
if ($dn !== NULL){
$attrs = $ldap->fetch();
$this->manager_name = $attrs['cn'][0];
}else{
$attrs = $ldap->fetch();
$this->manager_name = $attrs['cn'][0];
}else{
- $this->manager_name = "("._("Unknown")."!): ".$this->manager;
+ $this->manager_name = "("._("unknown")."!): ".$this->manager;
}
}
}
}
}
}
}
if($this->dialog && $this->dialog instanceOf singleUserSelect && count($this->dialog->detectPostActions())){
$users = $this->dialog->detectPostActions();
}
if($this->dialog && $this->dialog instanceOf singleUserSelect && count($this->dialog->detectPostActions())){
$users = $this->dialog->detectPostActions();
- if(isset($users['targets']) && count($users['targets'])){
-
+ if(isset($users['action']) && $users['action'] =='userSelected' && isset($users['targets']) && count($users['targets'])){
$headpage = $this->dialog->getHeadpage();
$dn = $users['targets'][0];
$attrs = $headpage->getEntry($dn);
$headpage = $this->dialog->getHeadpage();
$dn = $users['targets'][0];
$attrs = $headpage->getEntry($dn);
$smarty= get_smarty();
$smarty= get_smarty();
- $smarty->assign("usePrototype", "true");
+
$smarty->assign("gosaLoginRestrictionWidget", $this->gosaLoginRestrictionWidget->render());
/* Assign sex */
$smarty->assign("gosaLoginRestrictionWidget", $this->gosaLoginRestrictionWidget->render());
/* Assign sex */
}
$this->pwObject->display = TRUE;
$this->dialog= TRUE;
}
$this->pwObject->display = TRUE;
$this->dialog= TRUE;
+ pathNavigator::registerPlugin(_("Password configuration"));
return ($this->pwObject->configure());
}
}
return ($this->pwObject->configure());
}
}
}
/* Display picture dialog */
if ($this->picture_dialog){
}
/* Display picture dialog */
if ($this->picture_dialog){
+ pathNavigator::registerPlugin(_("User picture"));
return($smarty->fetch (get_template_path('generic_picture.tpl', TRUE, dirname(__FILE__))));
}
/* Display cert dialog */
if ($this->cert_dialog){
return($smarty->fetch (get_template_path('generic_picture.tpl', TRUE, dirname(__FILE__))));
}
/* Display cert dialog */
if ($this->cert_dialog){
+ pathNavigator::registerPlugin(_("Certificates"));
$smarty->assign("CertificateACL",$this->getacl("Certificate"));
$smarty->assign("Certificate_readable",$this->acl_is_readable("Certificate"));
$smarty->assign("certificateSerialNumber",$this->certificateSerialNumber);
$smarty->assign("CertificateACL",$this->getacl("Certificate"));
$smarty->assign("Certificate_readable",$this->acl_is_readable("Certificate"));
$smarty->assign("certificateSerialNumber",$this->certificateSerialNumber);
/* Additional info if start end time is '0' */
$add_str_info = "";
if($timeto == 0 && $timefrom == 0){
/* Additional info if start end time is '0' */
$add_str_info = "";
if($timeto == 0 && $timefrom == 0){
- $add_str_info = "<br><i>"._("(Some types of certificates are currently not supported and may be displayed as 'invalid'.)")."</i>";
+ $add_str_info = "<br>".bold(_("(Not supported certificate types are marked as invalid.)"));
}
}
- $str = "<table summary=\"\" border=0>
+ $str = "<table \"\" border=0 summary='"._("Certificates")."'>
<tr>
<tr>
- <td style='vertical-align:top'>CN</td>
+ <td>CN</td>
<td>".preg_replace("/ /", " ", $certificate->getname())."</td>
</tr>
</table><br>".
sprintf(_("Certificate is valid from %s to %s and is currently %s."),
<td>".preg_replace("/ /", " ", $certificate->getname())."</td>
</tr>
</table><br>".
sprintf(_("Certificate is valid from %s to %s and is currently %s."),
- "<b>".date('d M Y',$timefrom)."</b>",
- "<b>".date('d M Y',$timeto)."</b>",
- $certificate->isvalid()?"<b><font style='color:green'>"._("valid")."</font></b>":
- "<b><font style='color:red'>"._("invalid")."</font></b>").$add_str_info;
+ bold(date('d M Y',$timefrom)),
+ bold(date('d M Y',$timeto)),
+ $certificate->isvalid()?bold("<span style='color:green'>"._("valid")."</span>"):
+ bold("<span style='color:red'>"._("invalid")."</span>")).$add_str_info;
$smarty->assign($cert."info",$str);
$smarty->assign($cert."_state","true");
$smarty->assign($cert."info",$str);
$smarty->assign($cert."_state","true");
/* Prepare password hashes */
if ($this->pw_storage == ""){
/* 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();
$is_configurable= FALSE;
$hashes = $temp['name'];
if(isset($temp[$this->pw_storage])){
}
$temp= passwordMethod::get_available_methods();
$is_configurable= FALSE;
$hashes = $temp['name'];
if(isset($temp[$this->pw_storage])){
- $test= new $temp[$this->pw_storage]($this->config);
+ $test= new $temp[$this->pw_storage]($this->config, $this->dn);
$is_configurable= $test->is_configurable();
}else{
new msg_dialog(_("Password method"),_("The selected password method is no longer available."),WARNING_DIALOG);
$is_configurable= $test->is_configurable();
}else{
new msg_dialog(_("Password method"),_("The selected password method is no longer available."),WARNING_DIALOG);
/* Save government mode attributes */
if($this->governmentmode){
$smarty->assign("governmentmode", "true");
/* Save government mode attributes */
if($this->governmentmode){
$smarty->assign("governmentmode", "true");
- $ivbbmodes= array("nein", "ivbv", "testa", "ivbv,testa", "internet",
- "internet,ivbv", "internet,testa", "internet,ivbv,testa");
+ $ivbbmodes= array("nein", "", "ivbv", "testa", "ivbv,testa", "internet",
+ "internet,ivbv", "internet,testa", "internet,ivbv,testa");
$smarty->assign("ivbbmodes", $ivbbmodes);
foreach ($this->govattrs as $val){
$smarty->assign("$val", $this->$val);
$smarty->assign("ivbbmodes", $ivbbmodes);
foreach ($this->govattrs as $val){
$smarty->assign("$val", $this->$val);
while ($ldap->fetch()){
$og= new ogroup($this->config, $ldap->getDN());
unset($og->member[$this->dn]);
while ($ldap->fetch()){
$og= new ogroup($this->config, $ldap->getDN());
unset($og->member[$this->dn]);
- $og->member= array_values($og->member);
$og->save ();
}
$og->save ();
}
}
/* If needed, let the password method do some cleanup */
}
/* If needed, let the password method do some cleanup */
- $tmp = new passwordMethod($this->config);
+ $tmp = new passwordMethod($this->config, $this->dn);
$available = $tmp->get_available_methods();
if (in_array_ics($this->pw_storage, $available['name'])){
$test= new $available[$this->pw_storage]($this->config);
$available = $tmp->get_available_methods();
if (in_array_ics($this->pw_storage, $available['name'])){
$test= new $available[$this->pw_storage]($this->config);
die ("Could not connect to LDAP server");
}
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
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"));
}
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'],
ldap_start_tls($ds);
}
if (!($res = @ldap_bind($ds, $this->config->current['ADMIN'],
/* If needed, let the password method do some cleanup */
if ($this->pw_storage != $this->last_pw_storage){
/* If needed, let the password method do some cleanup */
if ($this->pw_storage != $this->last_pw_storage){
- $tmp = new passwordMethod($this->config);
+ $tmp = new passwordMethod($this->config, $this->dn);
$available = $tmp->get_available_methods();
if (in_array_ics($this->last_pw_storage, $available['name'])){
$test= new $available[$this->last_pw_storage]($this->config,$this->dn);
$available = $tmp->get_available_methods();
if (in_array_ics($this->last_pw_storage, $available['name'])){
$test= new $available[$this->last_pw_storage]($this->config,$this->dn);
function update_new_dn()
{
// Alternative way to handle DN
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);
if ($pattern != "") {
$rdn= $this->create_initial_rdn($pattern);
$attribute= preg_replace('/=.*$/', '', $rdn);
} else {
$pt= "";
} 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." ";
}
if(!empty($this->personalTitle)){
$pt = $this->personalTitle." ";
}
$this->cn= $pt.$this->givenName." ".$this->sn;
/* Permissions for that base? */
$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 */
$this->new_dn= 'uid='.$this->uid.','.get_people_ou().$this->base;
} else {
/* Don't touch dn, if cn hasn't changed */
if ($this->uid == ""){
$message[]= msgPool::required(_("Login"));
}
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"));
$ldap->cat($this->new_dn);
if ($ldap->count() != 0 && $this->dn != $this->new_dn && $this->dn == 'new'){
$message[]= msgPool::duplicated(_("Name"));
{
$ds= ldap_connect($this->config->current['SERVER']);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
{
$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"));
}
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);
}
ldap_start_tls($ds);
}
$this->old_userPKCS12= "";
$this->old_userSMIMECertificate= "";
$this->old_userCertificate= "";
$this->old_userPKCS12= "";
$this->old_userSMIMECertificate= "";
$this->old_userCertificate= "";
+
+ /* Generate dateOfBirth entry */
+ if (isset ($source['dateOfBirth'])){
+ list($year, $month, $day)= explode("-", $source['dateOfBirth'][0], 3);
+ $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;
}
}
"plCategory" => array("users" => array("description" => _("Users"),
"objectClass" => "gosaAccount")),
"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"),
"plProvidedAcls" => array(
"sn" => _("Surname"),
"givenName" => _("Given name"),
- "uid" => _("User identification"),
+ "uid" => _("Login"),
+
+ "gosaUserDefinedFilter" => _("Allow definition of custom filters"),
+
"personalTitle" => _("Personal title"),
"academicTitle" => _("Academic title"),
"personalTitle" => _("Personal title"),
"academicTitle" => _("Academic title"),
);
);
- /* 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);
}
return($ret);
}
$attrs = $ldap->fetch();
$this->manager_name = $attrs['cn'][0];
}else{
$attrs = $ldap->fetch();
$this->manager_name = $attrs['cn'][0];
}else{
- $this->manager_name = "("._("Unknown")."!): ".$this->manager;
+ $this->manager_name = "("._("unknown")."!): ".$this->manager;
}
}
}
}