function user_uid_optional_to_arg

7.x user.module user_uid_optional_to_arg($arg)
6.x user.module user_uid_optional_to_arg($arg)

Returns the user id of the currently logged in user.

File

drupal-6.x/modules/user/user.module, line 1219
Enables the user registration and login system.

Code

function user_uid_optional_to_arg($arg) {
  // Give back the current user uid when called from eg. tracker, aka.
  // with an empty arg. Also use the current user uid when called from
  // the menu with a % for the current account link.
  return empty($arg) || $arg == '%' ? $GLOBALS['user']->uid : $arg;
}