[geeklog-cvs] geeklog: - Usersettings.php - can not change password when custo...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jan 17 15:30:30 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/53e92082a7b2
changeset: 6685:53e92082a7b2
user:      blaine Lang <blaine at portalparts.com>
date:      Sat Jan 17 13:50:12 2009 -0500
description:
- Usersettings.php - can not change password when custom membership is enabled.
  Modified CUSTOM_userCheck to return both a error message string and Error code.
  Updated users.php and usersettings,php  (bug #0000776) [Blaine]

diffstat:

6 files changed, 3359 insertions(+), 3336 deletions(-)
language/english.php         |    8 
language/english_utf-8.php   |    9 
public_html/docs/history     |    3 
public_html/users.php        | 2528 +++++++++++++++++-----------------
public_html/usersettings.php | 3097 +++++++++++++++++++++---------------------
system/lib-custom.php        | 1050 +++++++-------

diffs (truncated from 6757 to 300 lines):

diff -r 87fd88086fef -r 53e92082a7b2 language/english.php
--- a/language/english.php	Sat Jan 17 18:51:14 2009 +0100
+++ b/language/english.php	Sat Jan 17 13:50:12 2009 -0500
@@ -1202,11 +1202,13 @@
     94 => 'Backup Failed: Filesize less than 1kb',
     95 => 'There was an error.',
     96 => '',
-    97 => 'Not all required fields have been passed validation - default custom membership message',
+    97 => '',
     98 => 'The plugin was successfully uploaded.',
     99 => 'The plugin already exists.',
     100 => 'The plugin file you uploaded was not a GZip or Zip compressed archive.',
-    101 => 'There are no topics (that you have access to). You need at least one topic to be able to submit stories.'
+    101 => 'There are no topics (that you have access to). You need at least one topic to be able to submit stories.',
+    400 => 'Not all required fields have been passed validation', // Error codes in the 400 range reserved for CUSTOM membership
+    401 => 'Please enter Fullname'
 );
 
 ###############################################################################
@@ -1652,7 +1654,7 @@
     'date' => "Date Format",
     'daytime' => "Daytime Format",
     'shortdate' => "Short Date Format",
-    'dateonly' => "Date Only Format", 
+    'dateonly' => "Date Only Format",
     'timeonly' => "Time Only Format",
     'week_start' => "Week Start",
     'hour_mode' => "Hour Mode",
diff -r 87fd88086fef -r 53e92082a7b2 language/english_utf-8.php
--- a/language/english_utf-8.php	Sat Jan 17 18:51:14 2009 +0100
+++ b/language/english_utf-8.php	Sat Jan 17 13:50:12 2009 -0500
@@ -1202,11 +1202,14 @@
     94 => 'Backup Failed: Filesize less than 1kb',
     95 => 'There was an error.',
     96 => '',
-    97 => 'Not all required fields have been passed validation - default custom membership message',
+    97 => '',
     98 => 'The plugin was successfully uploaded.',
     99 => 'The plugin already exists.',
     100 => 'The plugin file you uploaded was not a GZip or Zip compressed archive.',
-    101 => 'There are no topics (that you have access to). You need at least one topic to be able to submit stories.'
+    101 => 'There are no topics (that you have access to). You need at least one topic to be able to submit stories.',
+    400 => 'Not all required fields have been passed validation', // Error codes in the 400 range reserved for CUSTOM membership
+    401 => 'Please enter Fullname'
+
 );
 
 ###############################################################################
@@ -1652,7 +1655,7 @@
     'date' => "Date Format",
     'daytime' => "Daytime Format",
     'shortdate' => "Short Date Format",
-    'dateonly' => "Date Only Format", 
+    'dateonly' => "Date Only Format",
     'timeonly' => "Time Only Format",
     'week_start' => "Week Start",
     'hour_mode' => "Hour Mode",
diff -r 87fd88086fef -r 53e92082a7b2 public_html/docs/history
--- a/public_html/docs/history	Sat Jan 17 18:51:14 2009 +0100
+++ b/public_html/docs/history	Sat Jan 17 13:50:12 2009 -0500
@@ -11,6 +11,9 @@
 + (TBD) Comment moderation and editable comments, by Jared Wenerd
 
 Other changes:
+- Usersettings.php - can not change password when custom membership is enabled.
+  Modified CUSTOM_userCheck to return both a error message string and Error code.
+  Updated users.php and usersettings,php  (bug #0000776) [Blaine]
 - Implemented extended API for PLG_getItemInfo [mystral-kk, Dirk]
 - Fixed inconsistencies and various small mistakes when displaying "Access
   denied" messages on the admin pages [Dirk]
diff -r 87fd88086fef -r 53e92082a7b2 public_html/users.php
--- a/public_html/users.php	Sat Jan 17 18:51:14 2009 +0100
+++ b/public_html/users.php	Sat Jan 17 13:50:12 2009 -0500
@@ -1,1264 +1,1264 @@
-<?php
-
-/* Reminder: always indent with 4 spaces (no tabs). */
-// +---------------------------------------------------------------------------+
-// | Geeklog 1.6                                                               |
-// +---------------------------------------------------------------------------+
-// | users.php                                                                 |
-// |                                                                           |
-// | User authentication module.                                               |
-// +---------------------------------------------------------------------------+
-// | Copyright (C) 2000-2009 by the following authors:                         |
-// |                                                                           |
-// | Authors: Tony Bibbs        - tony AT tonybibbs DOT com                    |
-// |          Mark Limburg      - mlimburg AT users DOT sourceforge DOT net    |
-// |          Jason Whittenburg - jwhitten AT securitygeeks DOT com            |
-// |          Dirk Haun         - dirk AT haun-online DOT de                   |
-// +---------------------------------------------------------------------------+
-// |                                                                           |
-// | This program is free software; you can redistribute it and/or             |
-// | modify it under the terms of the GNU General Public License               |
-// | as published by the Free Software Foundation; either version 2            |
-// | of the License, or (at your option) any later version.                    |
-// |                                                                           |
-// | This program is distributed in the hope that it will be useful,           |
-// | but WITHOUT ANY WARRANTY; without even the implied warranty of            |
-// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
-// | GNU General Public License for more details.                              |
-// |                                                                           |
-// | You should have received a copy of the GNU General Public License         |
-// | along with this program; if not, write to the Free Software Foundation,   |
-// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
-// |                                                                           |
-// +---------------------------------------------------------------------------+
-
-/**
-* This file handles user authentication
-*
-* @author   Tony Bibbs <tony at tonybibbs.com>
-* @author   Mark Limburg <mlimburg at users.sourceforge.net>
-* @author   Jason Whittenburg
-*
-*/
-
-/**
-* Geeklog common function library
-*/
-require_once 'lib-common.php';
-require_once $_CONF['path_system'] . 'lib-user.php';
-$VERBOSE = false;
-
-// Uncomment the line below if you need to debug the HTTP variables being passed
-// to the script.  This will sometimes cause errors but it will allow you to see
-// the data being passed in a POST operation
-
-// echo COM_debug($_POST);
-
-/**
-* Shows a profile for a user
-*
-* This grabs the user profile for a given user and displays it
-*
-* @param    int     $user   User ID of profile to get
-* @param    int     $msg    Message to display (if != 0)
-* @param    string  $plugin optional plugin name for message
-* @return   string          HTML for user profile page
-*
-*/
-function userprofile($user, $msg = 0, $plugin = '')
-{
-    global $_CONF, $_TABLES, $_USER, $LANG01, $LANG04, $LANG09, $LANG28, $LANG_LOGIN;
-
-    $retval = '';
-    if (empty ($_USER['username']) &&
-        (($_CONF['loginrequired'] == 1) || ($_CONF['profileloginrequired'] == 1))) {
-        $retval .= COM_siteHeader ('menu', $LANG_LOGIN[1]);
-        $retval .= COM_startBlock ($LANG_LOGIN[1], '',
-                           COM_getBlockTemplate ('_msg_block', 'header'));
-        $login = new Template($_CONF['path_layout'] . 'submit');
-        $login->set_file (array ('login'=>'submitloginrequired.thtml'));
-        $login->set_var ( 'xhtml', XHTML );
-        $login->set_var ('login_message', $LANG_LOGIN[2]);
-        $login->set_var ('site_url', $_CONF['site_url']);
-        $login->set_var ('site_admin_url', $_CONF['site_admin_url']);
-        $login->set_var ('layout_url', $_CONF['layout_url']);
-        $login->set_var ('lang_login', $LANG_LOGIN[3]);
-        $login->set_var ('lang_newuser', $LANG_LOGIN[4]);
-        $login->parse ('output', 'login');
-        $retval .= $login->finish ($login->get_var('output'));
-        $retval .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
-        $retval .= COM_siteFooter ();
-
-        return $retval;
-    }
-
-    $result = DB_query ("SELECT {$_TABLES['users']}.uid,username,fullname,regdate,homepage,about,location,pgpkey,photo,email,status FROM {$_TABLES['userinfo']},{$_TABLES['users']} WHERE {$_TABLES['userinfo']}.uid = {$_TABLES['users']}.uid AND {$_TABLES['users']}.uid = $user");
-    $nrows = DB_numRows ($result);
-    if ($nrows == 0) { // no such user
-        return COM_refresh ($_CONF['site_url'] . '/index.php');
-    }
-    $A = DB_fetchArray ($result);
-
-    if ($A['status'] == USER_ACCOUNT_DISABLED && !SEC_hasRights ('user.edit')) {
-        COM_displayMessageAndAbort (30, '', 403, 'Forbidden');
-    }
-
-    $display_name = htmlspecialchars(COM_getDisplayName($user, $A['username'],
-                                                        $A['fullname']));
-
-    $retval .= COM_siteHeader ('menu', $LANG04[1] . ' ' . $display_name);
-    if ($msg > 0) {
-        $retval .= COM_showMessage($msg, $plugin);
-    }
-
-    // format date/time to user preference
-    $curtime = COM_getUserDateTimeFormat ($A['regdate']);
-    $A['regdate'] = $curtime[0];
-
-    $user_templates = new Template ($_CONF['path_layout'] . 'users');
-    $user_templates->set_file (array ('profile' => 'profile.thtml',
-                                      'row'     => 'commentrow.thtml',
-                                      'strow'   => 'storyrow.thtml'));
-    $user_templates->set_var ('xhtml', XHTML);
-    $user_templates->set_var ('site_url', $_CONF['site_url']);
-    $user_templates->set_var ('start_block_userprofile',
-            COM_startBlock ($LANG04[1] . ' ' . $display_name));
-    $user_templates->set_var ('end_block', COM_endBlock ());
-    $user_templates->set_var ('lang_username', $LANG04[2]);
-
-    if ($_CONF['show_fullname'] == 1) {
-        if (empty ($A['fullname'])) {
-            $username = $A['username'];
-            $fullname = '';
-        } else {
-            $username = $A['fullname'];
-            $fullname = $A['username'];
-        }
-    } else {
-        $username = $A['username'];
-        $fullname = $A['fullname'];
-    }
-    $username = htmlspecialchars($username);
-    $fullname = htmlspecialchars($fullname);
-
-    if ($A['status'] == USER_ACCOUNT_DISABLED) {
-        $username = sprintf ('<s title="%s">%s</s>', $LANG28[42], $username);
-        if (!empty ($fullname)) {
-            $fullname = sprintf ('<s title="%s">%s</s>', $LANG28[42], $fullname);
-        }
-    }
-
-    $user_templates->set_var ('username', $username);
-    $user_templates->set_var ('user_fullname', $fullname);
-
-    if (SEC_hasRights ('user.edit')) {
-        global $_IMAGE_TYPE, $LANG_ADMIN;
-
-        $edit_icon = '<img src="' . $_CONF['layout_url'] . '/images/edit.'
-                   . $_IMAGE_TYPE . '" alt="' . $LANG_ADMIN['edit']
-                   . '" title="' . $LANG_ADMIN['edit'] . '"' . XHTML . '>';
-        $edit_link_url = COM_createLink($edit_icon,
-            "{$_CONF['site_admin_url']}/user.php?mode=edit&uid={$A['uid']}");
-        $user_templates->set_var ('edit_icon', $edit_icon);
-        $user_templates->set_var ('edit_link', $edit_link_url);
-        $user_templates->set_var ('user_edit', $edit_link_url);
-    }
-
-    if (isset ($A['photo']) && empty ($A['photo'])) {
-        $A['photo'] = '(none)'; // user does not have a photo
-    }
-    $photo = USER_getPhoto ($user, $A['photo'], $A['email'], -1);
-    $user_templates->set_var ('user_photo', $photo);
-
-    $user_templates->set_var ('lang_membersince', $LANG04[67]);
-    $user_templates->set_var ('user_regdate', $A['regdate']);
-    $user_templates->set_var ('lang_email', $LANG04[5]);
-    $user_templates->set_var ('user_id', $user);
-    $user_templates->set_var ('lang_sendemail', $LANG04[81]);
-    $user_templates->set_var ('lang_homepage', $LANG04[6]);
-    $user_templates->set_var ('user_homepage', COM_killJS ($A['homepage']));
-    $user_templates->set_var ('lang_location', $LANG04[106]);
-    $user_templates->set_var ('user_location', strip_tags ($A['location']));
-    $user_templates->set_var ('lang_bio', $LANG04[7]);
-    $user_templates->set_var ('user_bio', nl2br (stripslashes ($A['about'])));
-    $user_templates->set_var ('lang_pgpkey', $LANG04[8]);
-    $user_templates->set_var ('user_pgp', nl2br ($A['pgpkey']));
-    $user_templates->set_var ('start_block_last10stories',
-            COM_startBlock ($LANG04[82] . ' ' . $display_name));
-    $user_templates->set_var ('start_block_last10comments',
-            COM_startBlock($LANG04[10] . ' ' . $display_name));
-    $user_templates->set_var ('start_block_postingstats',
-            COM_startBlock ($LANG04[83] . ' ' . $display_name));
-    $user_templates->set_var ('lang_title', $LANG09[16]);
-    $user_templates->set_var ('lang_date', $LANG09[17]);
-
-    // for alternative layouts: use these as headlines instead of block titles
-    $user_templates->set_var ('headline_last10stories', $LANG04[82]);
-    $user_templates->set_var ('headline_last10comments', $LANG04[10]);
-    $user_templates->set_var ('headline_postingstats', $LANG04[83]);
-
-    $result = DB_query ("SELECT tid FROM {$_TABLES['topics']}"
-            . COM_getPermSQL ());
-    $nrows = DB_numRows ($result);
-    $tids = array ();
-    for ($i = 0; $i < $nrows; $i++) {
-        $T = DB_fetchArray ($result);
-        $tids[] = $T['tid'];
-    }
-    $topics = "'" . implode ("','", $tids) . "'";
-
-    // list of last 10 stories by this user
-    if (sizeof ($tids) > 0) {
-        $sql = "SELECT sid,title,UNIX_TIMESTAMP(date) AS unixdate FROM {$_TABLES['stories']} WHERE (uid = $user) AND (draft_flag = 0) AND (date <= NOW()) AND (tid IN ($topics))" . COM_getPermSQL ('AND');
-        $sql .= " ORDER BY unixdate DESC LIMIT 10";
-        $result = DB_query ($sql);
-        $nrows = DB_numRows ($result);
-    } else {
-        $nrows = 0;
-    }
-    if ($nrows > 0) {
-        for ($i = 0; $i < $nrows; $i++) {
-            $C = DB_fetchArray ($result);
-            $user_templates->set_var ('cssid', ($i % 2) + 1);
-            $user_templates->set_var ('row_number', ($i + 1) . '.');
-            $articleUrl = COM_buildUrl ($_CONF['site_url']
-                                        . '/article.php?story=' . $C['sid']);
-            $user_templates->set_var ('article_url', $articleUrl);



More information about the geeklog-cvs mailing list