Access callback for path /user.
Displays user profile if user is logged in, or login form for anonymous users.
function user_page() {
global $user;
if ($user->uid) {
return new RedirectResponse(url('user/' . $user->uid, array(
'absolute' => TRUE,
)));
}
else {
return drupal_get_form('user_login_form');
}
}