Issue tracker moved to https://gitlab.archlinux.org/archlinux/aurweb/-/issues
FS#2585 - User Existence Check Broken
Attached to Project:
AUR web interface
Opened by Simo Leone (neotuli) - Saturday, 16 April 2005, 02:20 GMT
Last edited by Simo Leone (neotuli) - Saturday, 23 April 2005, 17:24 GMT
Opened by Simo Leone (neotuli) - Saturday, 16 April 2005, 02:20 GMT
Last edited by Simo Leone (neotuli) - Saturday, 23 April 2005, 17:24 GMT
|
DetailsThis IF statement (from web/html/accounts.php) doesn't trip even if the user doesn't exist.
$q = "SELECT Users.*, AccountTypes.AccountType "; $q.= "FROM Users, AccountTypes "; $q.= "WHERE AccountTypes.ID = Users.AccountTypeID "; $q.= "AND Users.ID = ".intval($_REQUEST["ID"]); $result = db_query($q, $dbh); if (!result) { print __("Could not retrieve information for the specified user."); } Not sure why... will look into it. |
This task depends upon
Closed by Simo Leone (neotuli)
Saturday, 23 April 2005, 17:25 GMT
Reason for closing: Fixed
Additional comments about closing: committed rev162
Saturday, 23 April 2005, 17:25 GMT
Reason for closing: Fixed
Additional comments about closing: committed rev162
It returns a resource on success and FALSE on an error, since the query works and there isn't an error, it returns a resource with 0 rows in it, not false. Therefore, checking for the resources existence will always be true.
Fixed by changing check to this:
if (!mysql_num_rows($result))
If there aren't any rows, it bails like it should.
Committed rev162