Access Callback user_is_anonymous与之相反? [英] What is the opposite of Access Callback user_is_anonymous?
问题描述
我有一个页面,我只想访问登录的用户。
谢谢
这是 user_is_logged_in()功能,它基本上检查用户的ID($ GLOBALS ['user'] - > uid)大于零。
该函数将uid转换为布尔类型,并为任何登录的用户返回TRUE,因为它们的uid为正数。 Drupal将匿名用户分配为0,在转换为布尔值时为FALSE。
I know that is used in a drupal module to specify that only anonymous users can see that module. What would be the callback that specifies only logged in users ?
I have a page that I only want accessible to logged in users.
Thank You
It is the user_is_logged_in() function, which basically checks that the user's ID ($GLOBALS['user']->uid) is greater than zero.
The function converts the uid into a Boolean type and returns TRUE for any user that is logged in, because they would have a uid that is a positive number. Drupal assigns anonymous users a uid of 0, which is FALSE when converted into a Boolean.
这篇关于Access Callback user_is_anonymous与之相反?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!