more info
ok so I've been trying to debug the confrim function in comprofiler.php hwne I clickon a vliad confirm link - I can verify the md5 is correct based on the id of the users record in the mos_comprofiler table
I made a few debug changes...
line 10 of the code below only had a == which I changed to ===
following this you can see I echo the sbsignature column which I know is populated - but it does not display anything. now something must be returned in $user from the select otherwise the "you not authorised to view the page" message would be shown and it isn't.
then I added DEBUG 1 to one ofhte mssages so I coud see the code was going where I thought and it is. so not only does the SELECT not work and teh approved flag not return the value it should, but the UPDATE doesn't work either
I'm pretty new to PHP but this still seems strange to me - any ideas?
[code:1]function confirm($confirmcode){
global $database,$my,$ueConfig,$_REQUEST,$_PLUGINS;
if($my->id < 1) {
$query = "SELECT * FROM #__comprofiler c, #__users u WHERE c.id=u.id AND md5(c.id) = '" . cbGetEscaped($confirmcode) . "'";
$database->setQuery($query);
$user = $database->loadObjectList();
if ($user===null) {
mosNotAuth();
return;
}
echo $user[0]->sbsignature . "<br>";
$_PLUGINS->loadPluginGroup('user');
$_PLUGINS->trigger( 'onBeforeUserConfirm', array($user[0]));
if($_PLUGINS->is_errors()) {
echo $_PLUGINS->getErrorMSG("<br />"«»);
exit();
}
$query = "UPDATE #__comprofiler SET confirmed = 1 WHERE md5(id) = '" . cbGetEscaped($confirmcode) . "'";
$database->setQuery($query);
if(mysql_affected_rows() == 0) {
if ($user===null) {
echo _UE_USER_NOTCONFIRMED . "<br>";
} else {
if ($user[0]->approved == 0) echo _UE_USER_CONFIRMED_NEEDAPPR . "DEBUG 1 <br>";
else echo _UE_USER_CONFIRMED . "<br>";
}
} else .........{[/code:1]