Browse Source

[svn r10003] bugfix for replacing $_uid with $_user['user_id']

Patrick Cool 18 years ago
parent
commit
bdba62ad53
1 changed files with 6 additions and 5 deletions
  1. 6 5
      main/inc/lib/main_api.lib.php

+ 6 - 5
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