From fd3b48966a65311acbe9db42fcdedee81240bc62 Mon Sep 17 00:00:00 2001 From: kkalev Date: Wed, 14 Aug 2002 14:00:12 +0000 Subject: [PATCH] When updating ldap user information don't do an update if the new attribute value is '-' (default value) --- Changelog | 2 ++ lib/ldap/change_info.php3 | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Changelog b/Changelog index fd5aeda..9ae2b8a 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,8 @@ Ver 1.53: * html fixes in show_groups.php3 * When reporting sql errors also print the output of da_sql_error +* When updating ldap user information don't do an update if the new attribute value + is '-' (default value) Ver 1.52: * Add Reply-Message in conf/user_edit.attrs so that it appears in the user/group edit pages * Allow the administrator to specify a group in the New User page. Update lib/sql/create_user.php3 to add diff --git a/lib/ldap/change_info.php3 b/lib/ldap/change_info.php3 index 48e10d0..a4d4188 100644 --- a/lib/ldap/change_info.php3 +++ b/lib/ldap/change_info.php3 @@ -3,15 +3,15 @@ if ($ds){ $r = @ldap_bind($ds,"$config[ldap_binddn]",$config[ldap_bindpw]); if ($r){ - if ($Fcn != '' && $Fcn != $cn) + if ($Fcn != '' && $Fcn != '-' && $Fcn != $cn) $mod['cn'] = $Fcn; - if ($Fmail != '' && $Fmail != $mail) + if ($Fmail != '' && $Fmail != '-' && $Fmail != $mail) $mod['mail'] = $Fmail; - if ($Fou != '' && $Fou != $ou) + if ($Fou != '' && $Fou != '-' && $Fou != $ou) $mod['ou'] = $Fou; - if ($Ftelephonenumber != '' && $Ftelephonenumber != $telephonenumber) + if ($Ftelephonenumber != '' && $Ftelephonenumber != '-' && $Ftelephonenumber != $telephonenumber) $mod['telephonenumber'] = $Ftelephonenumber; - if ($Fhomephone != '' && $Fhomephone != $homephone) + if ($Fhomephone != '' && $Fhomephone != '-' && $Fhomephone != $homephone) $mod['homephone'] = $Fhomephone; if ($dn != ''){ @ldap_mod_replace($ds,$dn,$mod); -- 2.39.5