Help
Ask questions about how to do or fix things in Arrowchat
User avatar
SixGuns
Customer
 
Posts: 7
Joined: 11 May 2016, 09:21

 

by SixGuns 01 Jul 2016, 08:35

I need to modify the get user id function to match our environment but I am a bit unfamiliar with php. I was hoping that someone could tell me where the initial cookie value comes from? It is looking for the session with the value of id I am assuming but I can't find where it gets the id value from or where it sets the cookie???

Any help would be greatly appreciated!

function get_user_id()
{

global $db;

$userid = NULL;

if (!empty($_SESSION['id']))
{
$userid = $_SESSION['id'];
}

else
{
$result = $db->execute("
SELECT useridfk
FROM cfmbb_sessions
LIMIT 1
");

if ($row = $db->fetch_array($result))
{
if (!empty($row['useridfk']))
{
$userid = $row['useridfk'];
}
}
}

return $userid;
}