[geeklog-cvs] geeklog: Fixed undefined index errors
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Aug 28 11:08:54 EDT 2011
changeset 8365:322ac22b8bfd
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/322ac22b8bfd
user: Dirk Haun <dirk at haun-online.de>
date: Sun Jun 19 13:53:01 2011 +0200
description:
Fixed undefined index errors
diffstat:
public_html/admin/user.php | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diffs (68 lines):
diff -r 61b8d6c96de7 -r 322ac22b8bfd public_html/admin/user.php
--- a/public_html/admin/user.php Sun Jun 19 13:51:56 2011 +0200
+++ b/public_html/admin/user.php Sun Jun 19 13:53:01 2011 +0200
@@ -470,8 +470,9 @@
COM_errorLog("group size at beginning = " . count($groups), 1);
}
+ $service = DB_getItem($_TABLES['users'], 'remoteservice', "uid = $uid");
// If remote service then assume blank password
- if ($A['remoteservice'] != '') {
+ if (! empty($service)) {
$passwd = '';
$passwd_conf = '';
}
@@ -487,8 +488,6 @@
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
}
@@ -506,9 +505,8 @@
$ucount = DB_getItem ($_TABLES['users'], 'COUNT(*)',
"username = '$uname'");
} else {
- $uservice = DB_getItem ($_TABLES['users'], 'remoteservice', "uid = $uid");
- if ($uservice != '') {
- $uservice = addslashes($uservice);
+ if (! empty($service)) {
+ $uservice = addslashes($service);
$ucount = DB_getItem ($_TABLES['users'], 'COUNT(*)',
"username = '$uname' AND uid <> $uid AND remoteservice = '$uservice'");
} else {
@@ -557,8 +555,8 @@
if (empty ($uid) || !empty ($passwd)) {
$passwd = SEC_encryptPassword($passwd);
} else {
- if ($A['remoteservice'] != '') {
- $passwd = DB_getItem ($_TABLES['users'], 'passwd', "uid = $uid");
+ if (! empty($service)) {
+ $passwd = DB_getItem($_TABLES['users'], 'passwd', "uid = $uid");
}
}
@@ -1277,10 +1275,18 @@
echo COM_refresh($_CONF['site_admin_url'] . '/index.php');
exit;
} else {
+ $passwd = '';
+ if (isset($_POST['passwd'])) {
+ $passwd = $_POST['passwd'];
+ }
+ $passwd_conf = '';
+ if (isset($_POST['passwd_conf'])) {
+ $passwd = $_POST['passwd_conf'];
+ }
$display = saveusers($uid, $_POST['username'], $_POST['fullname'],
- $_POST['passwd'], $_POST['passwd_conf'], $_POST['email'],
- $_POST['regdate'], $_POST['homepage'], $_POST['groups'],
- $delphoto, $_POST['userstatus'], $_POST['oldstatus']);
+ $passwd, $passwd_conf, $_POST['email'], $_POST['regdate'],
+ $_POST['homepage'], $_POST['groups'], $delphoto,
+ $_POST['userstatus'], $_POST['oldstatus']);
if (!empty($display)) {
$tmp = COM_siteHeader('menu', $LANG28[22]);
$tmp .= $display;
More information about the geeklog-cvs
mailing list