當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。