i'm building membership website, and i want to build pages only for users that logged in. What i'm writing in the access callback to give access only to logged in users?
'access callback' => '?'
Thank you.
i'm building membership website, and i want to build pages only for users that logged in. What i'm writing in the access callback to give access only to logged in users?
'access callback' => '?'
Thank you.
You can use the user_is_logged_in() function to check if a user is logged in. Like this:
$items['custmomenu'] => array(
'title' => 'yourtitle',
'page callback' => 'yourcallback function',
'access callback' => 'user_is_logged_in',
);
You need to use the following access callback as shown below:
$items['mypage'] => array(
'title' => 'My Page',
'page callback' => 'mypage_callback',
'access callback' = > 'user_is_logged_in',
);
More info about checking if a user is logged in:
http://oliverdavies.co.uk/blog/2013/01/09/checking-if-user-logged-drupal-right-way