-
Ok great after understanding the code a bit more, I think you guys are beyond Awesome :)
Here is another one now. On each successful login action, I'd like to update a unique website name value in sys_accounts table in the same row against user name and password, this would be useful to identify which website this profile belongs to and whether certain actions need to be taken for that particular user depending on the value. This value is being passed as hidden field from login form and I have added column for this value too.
I'd like to know what would be best way to update this new hidden value from login form in sys_accounts table after user is verified? Is there any other place too, where I need to perform this action?
Here is what I had in mind, please check the bold statement :
/**
* Check if user is logged in (necessary cookies are present) and set some global variables
*/
function check_logged()
{
$aAccTypes = array(
BX_DOL_ROLE_ADMIN => 'admin',
BX_DOL_ROLE_MEMBER => 'member'
);$sID = isset($_COOKIE['memberID']) ? bx_process_input($_COOKIE['memberID']) : false;
$sPassword = isset($_COOKIE['memberPassword']) ? bx_process_input($_COOKIE['memberPassword']) : false;$bLogged = false;
foreach ($aAccTypes as $iRole => $sValue) {
if ($GLOBALS['logged'][$sValue] = ($sID && !bx_check_login($sID, $sPassword, $iRole))) {
$bLogged = true;// Update website value here in sys_accounts table... (My question is, can I access $iWebsite, which is hidden value in sys-form-login form and run update query here something like update sys_accounts with $iWebsite value where UserID = $sID?)
break;
}
}if ((isset($_COOKIE['memberID']) || isset($_COOKIE['memberPassword'])) && !$bLogged)
bx_logout(false);
}