[geeklog-cvs] geeklog: Display a message when sending the email for a new pass...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Feb 1 11:59:12 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6d6e4b21742a
changeset: 6749:6d6e4b21742a
user:      Dirk Haun <dirk at haun-online.de>
date:      Sun Feb 01 17:46:47 2009 +0100
description:
Display a message when sending the email for a new password failed

diffstat:

2 files changed, 11 insertions(+), 12 deletions(-)
public_html/docs/history |    2 ++
public_html/users.php    |   21 +++++++++------------

diffs (75 lines):

diff -r 81e157f9d3fb -r 6d6e4b21742a public_html/docs/history
--- a/public_html/docs/history	Sat Jan 31 22:15:27 2009 +0100
+++ b/public_html/docs/history	Sun Feb 01 17:46:47 2009 +0100
@@ -2,6 +2,8 @@
 
 Feb ??, 2009 (1.5.2)
 ------------
+
+- Display a message when sending the email for a new password failed [Dirk]
 
 - Updated Japanese language file, provided by the Geeklog.jp group
 
diff -r 81e157f9d3fb -r 6d6e4b21742a public_html/users.php
--- a/public_html/users.php	Sat Jan 31 22:15:27 2009 +0100
+++ b/public_html/users.php	Sun Feb 01 17:46:47 2009 +0100
@@ -8,7 +8,7 @@
 // |                                                                           |
 // | User authentication module.                                               |
 // +---------------------------------------------------------------------------+
-// | Copyright (C) 2000-2008 by the following authors:                         |
+// | 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    |
@@ -31,8 +31,6 @@
 // | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
 // |                                                                           |
 // +---------------------------------------------------------------------------+
-//
-// $Id: users.php,v 1.170 2008/09/15 18:26:17 mjervis Exp $
 
 /**
 * This file handles user authentication
@@ -376,11 +374,10 @@
 * User request for a new password - send email with a link and request id
 *
 * @param username string   name of user who requested the new password
-* @param msg      int      index of message to display (if any)
 * @return         string   form or meta redirect
 *
 */
-function requestpassword ($username, $msg = 0)
+function requestpassword($username)
 {
     global $_CONF, $_TABLES, $LANG04;
 
@@ -412,13 +409,13 @@
         } else {
             $mailfrom = $_CONF['site_mail'];
         }
-        COM_mail ($A['email'], $subject, $mailtext, $mailfrom);
+        if (COM_mail ($A['email'], $subject, $mailtext, $mailfrom)) {
+            $msg = 55; // message sent
+        } else {
+            $msg = 85; // problem sending the email
+        }
 
-        if ($msg) {
-            $retval .= COM_refresh ($_CONF['site_url'] . "/index.php?msg=$msg");
-        } else {
-            $retval .= COM_refresh ($_CONF['site_url'] . '/index.php');
-        }
+        $retval .= COM_refresh ($_CONF['site_url'] . "/index.php?msg=$msg");
         COM_updateSpeedlimit ('password');
     } else {
         $retval .= COM_siteHeader ('menu', $LANG04[17])
@@ -1007,7 +1004,7 @@
                                     "email = '$email' AND ((remoteservice IS NULL) OR (remoteservice = ''))");
         }
         if (!empty ($username)) {
-            $display .= requestpassword ($username, 55);
+            $display .= requestpassword($username);
         } else {
             $display = COM_refresh ($_CONF['site_url']
                                     . '/users.php?mode=getpassword');



More information about the geeklog-cvs mailing list