Have tried modifying the code above as follows:
PHP Code:
// ############################### start enter password ###############################
if ($_REQUEST['do'] == 'doenterpwd')
{
globalize($_REQUEST, array('forumid' => INT, 'newforumpwd' => STR, 'url' => STR, 'postvars'));
// ################### Check for valid org pwd in profile ##################
// ################### before requesting forum password ##################
// rem out original line: $foruminfo = verify_id('forum', $forumid, 1, 1);
if ($post['field5'] == $vbphrase[org_password])
{
$newforumpwd = $vbphrase[org_password];
}
else
{
$foruminfo = verify_id('forum', $forumid, 1, 1);
}
// ################### END check for valid org pwd in profile ##############
if ($foruminfo['password'] == $newforumpwd)
{
....
Doesn't have the desired effect - with correct org pwd in the custom profile field, it doesn't satisfy the "if" test and proceeds to pop up the forum password request.
I've considered that the "if" test works okay and sets $newforumpwd, my problem might be that $foruminfo doesn't get defined. But looking further down the code, that should trigger an "incorrect password" response rather than showing a forum password request.
My guess is the $post['field5'] or $vbphrase[org_password] variable (or both) is not defined in forumdisplay.php. Both work fine in postbits. I'm guessing $post['field5'] is not the correct way to reference this variable outside of postbits, whereas I defined $vbphrase[org_password] as global.
Of course if I can get the "if" test working, it could be that not getting $foruminfo defined will still jump up and bite me.
Can anyone point me in the right direction?