pull/2487/head
jmontoyaa 9 years ago
parent 4ccb9802e3
commit ea78eb4902
  1. 4
      main/inc/lib/api.lib.php

@ -1260,13 +1260,13 @@ function api_is_self_registration_allowed()
*
* example: The function can be used to check if a user is logged in
* if (api_get_user_id())
* @return integer the id of the current user, 0 if is empty
* @return int the id of the current user, 0 if is empty
*/
function api_get_user_id()
{
$userInfo = Session::read('_user');
if ($userInfo && isset($userInfo['user_id'])) {
return $userInfo['user_id'];
return (int) $userInfo['user_id'];
}
return 0;
}

Loading…
Cancel
Save