You are here

function spaces_user_init in Spaces 7

Same name and namespace in other branches
  1. 6.3 spaces_user/spaces_user.module \spaces_user_init()
  2. 7.3 spaces_user/spaces_user.module \spaces_user_init()

Implements hook_init().

File

spaces_user/spaces_user.module, line 6

Code

function spaces_user_init() {
  if (arg(0) === 'user' && arg(1) !== 'autocomplete') {
    global $user;
    $uid = is_numeric(arg(1)) ? arg(1) : $user->uid;
    if ($uid) {
      spaces_init_space('user', $uid);
    }
  }
}