[geeklog-hg] geeklog: Fixed a bug where the administrator is forced to be an ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Wed Oct 22 11:46:51 EDT 2014


changeset 9542:7708211a9ad4
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/7708211a9ad4
user: dengen <taharaxp at gmail.com>
date: Thu Oct 23 00:46:08 2014 +0900
description:
Fixed a bug where the administrator is forced to be an input of the user password in the Edit User screen

diffstat:

 public_html/admin/user.php |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 0b4f271e4504 -r 7708211a9ad4 public_html/admin/user.php
--- a/public_html/admin/user.php	Wed Oct 22 23:55:22 2014 +0900
+++ b/public_html/admin/user.php	Thu Oct 23 00:46:08 2014 +0900
@@ -496,7 +496,14 @@
         $passwd_conf = '';
     }
 
-    if ($passwd != $passwd_conf) { // passwords don't match
+    $passwd_changed = true;
+    if (empty($service) &&
+      SEC_encryptUserPassword($passwd, $uid) === 0 &&
+      $passwd_conf === '') {
+        $passwd_changed = false;
+    }
+
+    if ($passwd_changed && $passwd != $passwd_conf) { // passwords don't match
         return edituser($uid, 67);
     }
 
@@ -611,7 +618,7 @@
 
             $curphoto = DB_escapeString($curphoto);
             DB_query("UPDATE {$_TABLES['users']} SET username = '$username', fullname = '$fullname', email = '$email', homepage = '$homepage', photo = '$curphoto', status='$userstatus' WHERE uid = $uid");
-            if (!empty($passwd)) {
+            if ($passwd_changed && !empty($passwd)) {
                 SEC_updateUserPassword($passwd, $uid);
             }
             if ($_CONF['custom_registration'] AND (function_exists('CUSTOM_userSave'))) {



More information about the geeklog-cvs mailing list