[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:13 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/60e7e87f1934
changeset: 6750:60e7e87f1934
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, 10 insertions(+), 9 deletions(-)
public_html/docs/history |    2 ++
public_html/users.php    |   17 ++++++++---------

diffs (57 lines):

diff -r 063645a4564f -r 60e7e87f1934 public_html/docs/history
--- a/public_html/docs/history	Sun Feb 01 17:18:07 2009 +0100
+++ b/public_html/docs/history	Sun Feb 01 17:46:47 2009 +0100
@@ -76,6 +76,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 063645a4564f -r 60e7e87f1934 public_html/users.php
--- a/public_html/users.php	Sun Feb 01 17:18:07 2009 +0100
+++ b/public_html/users.php	Sun Feb 01 17:46:47 2009 +0100
@@ -374,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;
 
@@ -409,13 +408,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])
@@ -1004,7 +1003,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