当前位置: 首页>>代码示例>>PHP>>正文


PHP eZUser::isAnonymous方法代码示例

本文整理汇总了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;
开发者ID:rantoniazzi,项目名称:xrowmetadata,代码行数:67,代码来源:xrowsitemaptools.php


注:本文中的eZUser::isAnonymous方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。