I'm Using phpfox with userplane webchat and this function is to grab sessionGuid from the database Original function is: Function 1:
function get_current_online_session_login() {
$oSrvSec = &App::getModuleService('Account', 'Security');
$login = $oSrvSec->getCurrentUserLogin();
$aReq = getRow(App::getT('online_session'), 'online_session_user = "' . $login . '"');
// return $aReq['online_session_login'];
return $aReq['online_session_id'];
}
And i make change's in it so it return the salted hash but Chat is not working and show error that you are not authorized to enter in chat. Here is what i make change in this code:
function get_current_online_session_login() {
$oSrvSec = &App::getModuleService('Account', 'Security');
$login = $oSrvSec->getCurrentUserLogin();
$aReq = getRow(App::getT('online_session'), 'online_session_user = "' . $login . '"');
$salt='waka_waka_shaka_laka_8342394';
// return $aReq['online_session_login'];
$umSar = $aReq['online_session_id'];
$saltedHash = md5($umSar . $salt);
return $saltedHash;
}
in this file have 2 function for session_id so i am not sure how to resolve this issue here is the 2nd session_id function: Function 2
function get_user_with_session_id($session_id) {
$session = getRow(App::getT('online_session'), "online_session_id = '$session_id'");
// $session = getRow(App::getT('online_session'), "online_session_login = '$session_id'");
$oSecurityService = &App::getModuleService('Account', 'Security');
$user = $oSecurityService->getUserByName($session['online_session_user']);
return isset($user) ? $user->aData['id'] : null;
}
Please i need help. You can see function 1: and function 2: are original function in my common.php file and this function return the normal figure's for session_id and i want to return session_id as md5 salted hash or base_64. Thanks