user_is_logged_in

6 user.module user_is_logged_in()
7 user.module user_is_logged_in()
8 user.module user_is_logged_in()

1 string reference to 'user_is_logged_in'

File

modules/user/user.module, line 872
Enables the user registration and login system.

Code

function user_is_logged_in() {
  return (bool) $GLOBALS['user']->uid;
}

Comments

check login

this is good solution when we want check the menu only for users login , can use this in access callback menu property like this

<?php

mymodule_menu
(){
$items=array();
$items['custmomenu'] => array(
     
'title' => 'yourtitle',
     
'page callback' => 'yourcallback function' ,
     
'access callback' = > user_is_logged_in(),
   );
}
?>

the usefull and short solution

Login or register to post comments