From bdba62ad53b3309412f7f51fe3d154a563363cd1 Mon Sep 17 00:00:00 2001 From: Patrick Cool Date: Thu, 16 Nov 2006 10:47:07 +0100 Subject: [PATCH] [svn r10003] bugfix for replacing $_uid with $_user['user_id'] --- main/inc/lib/main_api.lib.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index 19c7f55f98..2f432bce13 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -344,14 +344,15 @@ function api_get_path($path_type) } /** -* note: this function was deprecated but turned out to be quite useful for -* API functions, so it will remain here. -* -* @return the id of the current user +* This function returns the id of the user which is stored in the $_user array. +* +* @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 */ function api_get_user_id() { - return $GLOBALS[$_user['user_id']]; + return $GLOBALS[$_user]['user_id']; } /** * @param $user_id (integer): the id of the user