Undefined variable: usertoname, when trying to recover your forgotten password

Bug #515497 reported by Matteo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Undecided
Richard Mansfield

Bug Description

Mahara 1.2.2 (vanilla)
WAMP, PHP 5.2.12
MySQL

If for some reason the mail function will silently (due to the "@" in mail() call) fail an exception will be thrown.
The reason of the mail failure is e.g. wrong relay settings.

Revision history for this message
Matteo (matteo-scaramuccia) wrote :

Call stack (most recent first):

    * log_message("Undefined variable: usertoname", 8, true, true, "C:\path\to\mahara-1.2.2\htdocs\lib\user.php", 401) at C:\path\to\mahara-1.2.2\htdocs\lib\errors.php:446
    * error(8, "Undefined variable: usertoname", "C:\path\to\mahara-1.2.2\htdocs\lib\user.php", 401, array(size 14)) at C:\path\to\mahara-1.2.2\htdocs\lib\user.php:401
    * email_user(object(stdClass), null, "Username/Password details for Mahara", "Dear Admin User, A username/password request ha...", "<p>Dear Admin User,</p> <p>A username/password ...") at C:\path\to\mahara-1.2.2\htdocs\forgotpass.php:167
    * forgotpass_submit(object(Pieform), array(size 3)) at Unknown:0
    * call_user_func_array("forgotpass_submit", array(size 2)) at C:\path\to\mahara-1.2.2\htdocs\lib\pieforms\pieform.php:430
    * Pieform->__construct(array(size 5)) at C:\path\to\mahara-1.2.2\htdocs\lib\pieforms\pieform.php:170
    * Pieform::process(array(size 5)) at C:\path\to\mahara-1.2.2\htdocs\lib\pieforms\pieform.php:71
    * pieform(array(size 5)) at C:\path\to\mahara-1.2.2\htdocs\forgotpass.php:221

Patch proposal:

--- C:\path\to\mahara-1.2.2/htdocs/lib/user.php.orig Tue Dec 8 04:52:58 2009
+++ C:\path\to\mahara-1.2.2/htdocs/lib/user.php Mon Feb 1 15:09:18 2010
@@ -367,6 +367,7 @@

     $mail->Subject = substr(stripslashes($subject), 0, 900);

+ $usertoname = $userto->username . '(' . $userto->email . ')';
     if ($to = get_config('sendallemailto')) {
         // Admins can configure the system to send all email to a given address
         // instead of whoever would receive it, useful for debugging.

Changed in mahara:
assignee: nobody → Richard Mansfield (richard-mansfield)
Changed in mahara:
milestone: none → 1.2.3
status: New → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.