[geeklog-cvs] geeklog: Don't insist on an email adress when editing a Remote U...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Jun 11 08:10:40 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9920c449e20a
changeset: 7098:9920c449e20a
user:      Dirk Haun <dirk at haun-online.de>
date:      Thu Jun 11 14:10:30 2009 +0200
description:
Don't insist on an email adress when editing a Remote User (bug #0000885)

diffstat:

 public_html/admin/user.php |  27 +++++++++++++++++++++------
 public_html/docs/history   |   2 ++
 2 files changed, 23 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r 7716140ef6f8 -r 9920c449e20a public_html/admin/user.php
--- a/public_html/admin/user.php	Thu Jun 11 12:55:01 2009 +0200
+++ b/public_html/admin/user.php	Thu Jun 11 14:10:30 2009 +0200
@@ -447,13 +447,28 @@
     if ($_USER_VERBOSE) COM_errorLog("group size at beginning = " . sizeof($groups),1);
 
     if ($passwd != $passwd_conf) { // passwords don't match
-        return edituser ($uid, 67);
+        return edituser($uid, 67);
     }
 
-    if (!empty ($username) && !empty ($email)) {
+    $nameAndEmailOkay = true;
+    if (empty($username)) {
+        $nameAndEmailOkay = false;
+    } elseif (empty($email)) {
+        if (empty($uid)) {
+            $nameAndEmailOkay = false; // new users need an email address
+        } else {
+            $service = DB_getItem($_TABLES['users'], 'remoteservice',
+                                  "uid = $uid");
+            if (empty($service)) {
+                $nameAndEmailOkay = false; // not a remote user - needs email
+            }
+        }
+    }
 
-        if (!COM_isEmail ($email)) {
-            return edituser ($uid, 52);
+    if ($nameAndEmailOkay) {
+
+        if (!empty($email) && !COM_isEmail($email)) {
+            return edituser($uid, 52);
         }
 
         $uname = addslashes ($username);
@@ -638,8 +653,8 @@
         }
     } else {
         $retval = COM_siteHeader('menu', $LANG28[1]);
-        $retval .= COM_errorLog($LANG28[10]);
-        if (DB_count($_TABLES['users'],'uid',$uid) > 0) {
+        $retval .= COM_showMessageText($LANG28[10]);
+        if (DB_count($_TABLES['users'], 'uid', $uid) > 0) {
             $retval .= edituser($uid);
         } else {
             $retval .= edituser();
diff -r 7716140ef6f8 -r 9920c449e20a public_html/docs/history
--- a/public_html/docs/history	Thu Jun 11 12:55:01 2009 +0200
+++ b/public_html/docs/history	Thu Jun 11 14:10:30 2009 +0200
@@ -11,6 +11,8 @@
 + Comment moderation and editable comments, by Jared Wenerd
 
 Changes since 1.6.0b2:
+- Don't insist on an email adress when editing a Remote User (bug #0000885)
+  [Dirk]
 - Added a config option to send an X-FRAME-OPTIONS HTTP header to prevent
   "clickjacking" (requires browser support) [Dirk]
 - Prevent XSS in the install script (reported independently by Nemesis and MaXe)



More information about the geeklog-cvs mailing list