本文整理汇总了PHP中eZUser::isAnonymous方法的典型用法代码示例。如果您正苦于以下问题:PHP eZUser::isAnonymous方法的具体用法?PHP eZUser::isAnonymous怎么用?PHP eZUser::isAnonymous使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZUser
的用法示例。
在下文中一共展示了eZUser::isAnonymous方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkAccess
//.........这里部分代码省略.........
// we need to match against all possible languages (which
// is all bits set, ie. -1).
$languageMask = -1;
}
} else {
if ($language !== false) {
if ($languageList === false) {
$languageMask = (int) $contentobject->attribute('language_mask');
// We are restricting language check to just one language
$languageMask &= (int) $language;
// If the resulting mask is 0 it means that the user is trying to
// edit a language which does not exist, ie. translating.
// The mask will then become the language trying to edit.
if ($languageMask == 0) {
$languageMask = $language;
}
}
} else {
$languageMask = -1;
}
}
// Fetch limit mask for limitation list
$limitMask = eZContentLanguage::maskByLocale($limitationArray[$key]);
if (($languageMask & $limitMask) != 0) {
$access = 'allowed';
} else {
$access = 'denied';
$limitationList = array('Limitation' => $key, 'Required' => $limitationArray[$key]);
}
break;
case 'Owner':
case 'ParentOwner':
// if limitation value == 2, anonymous limited to current session.
if (in_array(2, $limitationArray[$key]) && $user->isAnonymous()) {
$createdObjectIDList = eZPreferences::value('ObjectCreationIDList');
if ($createdObjectIDList && in_array($contentobject->ID, unserialize($createdObjectIDList))) {
$access = 'allowed';
}
} else {
if ($contentobject->attribute('owner_id') == $userID || $contentobject->ID == $userID) {
$access = 'allowed';
}
}
if ($access != 'allowed') {
$access = 'denied';
$limitationList = array('Limitation' => $key, 'Required' => $limitationArray[$key]);
}
break;
case 'Group':
case 'ParentGroup':
$access = $contentobject->checkGroupLimitationAccess($limitationArray[$key], $userID);
if ($access != 'allowed') {
$access = 'denied';
$limitationList = array('Limitation' => $key, 'Required' => $limitationArray[$key]);
}
break;
case 'State':
if (count(array_intersect($limitationArray[$key], $contentobject->attribute('state_id_array'))) == 0) {
$access = 'denied';
$limitationList = array('Limitation' => $key, 'Required' => $limitationArray[$key]);
} else {
$access = 'allowed';
}
break;
case 'Node':
$accessNode = false;