}
// Confirms a user account
-function doConfirmUserAccount () {
+function doConfirmUserAccount ($hash) {
// Init content
$content = array(
'message' => '{--GUEST_CONFIRMED_FAILED--}',
// Search for an unconfirmed or confirmed account
$result = SQL_QUERY_ESC("SELECT `userid`, `email`, `refid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1",
- array(getRequestParameter('hash')), __FILE__, __LINE__);
+ array($hash), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Ok, he want's to confirm now so we load some data
list($userid, $email, $refid) = SQL_FETCHROW($result);
`user_hash`='%s' AND
`status`='UNCONFIRMED'
LIMIT 1",
- array(getRequestParameter('hash')), __FILE__, __LINE__);
+ array($hash), __FILE__, __LINE__);
+
+ // Was it updated?
if (SQL_AFFECTEDROWS() == 1) {
// Send email if updated
$message = loadEmailTemplate('confirm-member', $content, bigintval($userid));