librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1426] Apply patch from qwp0 (Andrej T) to display err


From: Michael Sheldon
Subject: [Librefm-commits] [1426] Apply patch from qwp0 (Andrej T) to display errors after an unsuccessful login and automatically fill the username box (fixes bug #26423)
Date: Fri, 08 May 2009 22:53:47 +0000

Revision: 1426
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1426
Author:   elleo
Date:     2009-05-08 22:53:46 +0000 (Fri, 08 May 2009)
Log Message:
-----------
Apply patch from qwp0 (Andrej T) to display errors after an unsuccessful login 
and automatically fill the username box (fixes bug #26423)

Ticket Links:
:-----------
    http://savannah.gnu.org/bugs/?26423

Modified Paths:
--------------
    trunk/nixtape/login.php

Modified: trunk/nixtape/login.php
===================================================================
--- trunk/nixtape/login.php     2009-05-08 22:40:38 UTC (rev 1425)
+++ trunk/nixtape/login.php     2009-05-08 22:53:46 UTC (rev 1426)
@@ -47,7 +47,9 @@
                $res = $mdb2->query('SELECT username FROM Users WHERE '
                        . ' lower(username) = ' . 
$mdb2->quote(strtolower($username), 'text')
                        . ' AND password = ' . $mdb2->quote(md5($password), 
'text') . ' AND active = 1');
-               if(!$res->numRows()) {
+               if(PEAR::isError($res)) {
+                       $errors .= 'A database error happened.';
+               } elseif(!$res->numRows()) {
                        $errors .= 'Invalid username or password.';
                } else {
                        // Give the user a session id, like any other client
@@ -80,7 +82,8 @@
                { $smarty->assign('return', $_REQUEST['return']); }
        else
                { $smarty->assign('return', ''); }
-       
+
+       $smarty->assign('username', $username);
+       $smarty->assign('errors', $errors);
        $smarty->display('login.tpl');
 }
-?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]