- Joined
- 2 Dec 2001
- Messages
- 18,694
Here is the function that I think is causing all the problems:
Late last night I had to remove both
and
To trick the frontpage into working correctly.
Really needed Tingle's help with this but he is offline at the moment.
the issue comes from vBulletin switching the flag on whether a user is banned. ie what once was 0 is now 1, so Virtuanews thinks the user is banned. Quite annoying. I am pretty sure all the other Virtuanews functions are working fine.
Anyone that can make head or tail of this?
PHP:
function validateuser($userid,$userpassword) {
global $inadmin,$vb_prefix,$vb_license,$HTTP_POST_VARS;
if ($userid > 0) {
$userinfo = query_first("SELECT
".$vb_prefix."user.usergroupid,
".$vb_prefix."user.username,
".$vb_prefix."user.salt,
".$vb_prefix."user.userid,
".$vb_prefix."user.password,
".$vb_prefix."user.email,
".$vb_prefix."user.options,
".$vb_prefix."user.pmunread,
".$vb_prefix."usergroup.genericoptions,
news_staff.*
FROM ".$vb_prefix."user
INNER JOIN ".$vb_prefix."usergroup ON ".$vb_prefix."user.usergroupid = ".$vb_prefix."usergroup.usergroupid
LEFT JOIN news_staff ON ".$vb_prefix."user.userid = news_staff.userid
WHERE ".$vb_prefix."user.userid = $userid");
if ($userinfo) {
if ($inadmin & !empty($HTTP_POST_VARS[username])) {
$userpassword = md5(md5($userpassword.$userinfo[salt]).$vb_license);
}
if ((md5($userinfo[password] . $vb_license)) == $userpassword) {
if (($userinfo[usergroupid] != 3) & ($userinfo[usergroupid] != 4)) {
if ($userinfo[genericoptions] & 32) {
unset($userinfo);
if ($inadmin) {
return false;
} else {
standarderror("user_banned");
}
}
if ($GLOBALS[getpmmsg] & !$inadmin) {
$GLOBALS[num_private_msgs] = $userinfo[pmunread];
}
$userinfo[viewsigs] = iif($userinfo[options] & 1,1,0);
$userinfo[activated] = 1;
$userinfo[moderated] = 1;
$userinfo[showemail] = iif($userinfo[options] & 256,1,0);
$userinfo[emailnotification] = iif($userinfo[options] & 16384,1,0);
$userinfo[commentdefault] = $GLOBALS[commentreplydefault];
return $userinfo;
} else { // Account not activated
unset($userinfo);
return false;
}
} else { // Password wrong
unset($userinfo);
return false;
}
} else { // Userid wrong
unset($userinfo);
return false;
}
} else { // No userid
unset($userinfo);
return false;
}
}
Late last night I had to remove both
Code:
} elseif ($userinfo[bandate] & (($userinfo[liftdate] == 0) | (time() < $userinfo[liftdate]))) {
$error = "user_banned";
and
Code:
} else {
standarderror("user_banned");
To trick the frontpage into working correctly.
Really needed Tingle's help with this but he is offline at the moment.
the issue comes from vBulletin switching the flag on whether a user is banned. ie what once was 0 is now 1, so Virtuanews thinks the user is banned. Quite annoying. I am pretty sure all the other Virtuanews functions are working fine.
Anyone that can make head or tail of this?
Last edited: