當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZUser::removeSessionData方法代碼示例

本文整理匯總了PHP中eZUser::removeSessionData方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZUser::removeSessionData方法的具體用法?PHP eZUser::removeSessionData怎麽用?PHP eZUser::removeSessionData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZUser的用法示例。


在下文中一共展示了eZUser::removeSessionData方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setAttribute

 function setAttribute($attr, $val)
 {
     switch ($attr) {
         case 'is_enabled':
             if (!$val) {
                 $user = eZUser::fetch($this->UserID);
                 if ($user) {
                     eZUser::removeSessionData($this->UserID);
                 }
             }
             eZUser::purgeUserCacheByUserId($this->UserID);
             break;
     }
     parent::setAttribute($attr, $val);
 }
開發者ID:CG77,項目名稱:ezpublish-legacy,代碼行數:15,代碼來源:ezusersetting.php

示例2: removeUser

 static function removeUser($userID)
 {
     $user = eZUser::fetch($userID);
     if (!$user) {
         eZDebug::writeError("unable to find user with ID {$userID}", __METHOD__);
         return false;
     }
     eZUser::removeSessionData($userID);
     eZSubtreeNotificationRule::removeByUserID($userID);
     eZCollaborationNotificationRule::removeByUserID($userID);
     eZUserSetting::removeByUserID($userID);
     eZUserAccountKey::removeByUserID($userID);
     eZForgotPassword::removeByUserID($userID);
     eZWishList::removeByUserID($userID);
     eZGeneralDigestUserSettings::removeByUserId($userID);
     eZPersistentObject::removeObject(eZUser::definition(), array('contentobject_id' => $userID));
     return true;
 }
開發者ID:brookinsconsulting,項目名稱:ezecosystem,代碼行數:18,代碼來源:ezuser.php

示例3: removeUser

 static function removeUser($userID)
 {
     $user = eZUser::fetch($userID);
     if (!$user) {
         eZDebug::writeError("unable to find user with ID {$userID}", __METHOD__);
         return false;
     }
     eZUser::removeSessionData($userID);
     eZSubtreeNotificationRule::removeByUserID($userID);
     eZCollaborationNotificationRule::removeByUserID($userID);
     eZUserSetting::removeByUserID($userID);
     eZUserAccountKey::removeByUserID($userID);
     eZForgotPassword::removeByUserID($userID);
     eZWishList::removeByUserID($userID);
     // only remove general digest setting if there are no other users with the same e-mail
     $email = $user->attribute('email');
     $usersWithEmailCount = eZPersistentObject::count(eZUser::definition(), array('email' => $email));
     if ($usersWithEmailCount == 1) {
         eZGeneralDigestUserSettings::removeByAddress($email);
     }
     eZPersistentObject::removeObject(eZUser::definition(), array('contentobject_id' => $userID));
     return true;
 }
開發者ID:netbliss,項目名稱:ezpublish,代碼行數:23,代碼來源:ezuser.php

示例4: activation

 /**
  * Activate user with user or deactivate and create new eZUserAccountKey with user hash
  * depending on $enableUser being true or not.
  *
  * @param int $userID
  * @param string $userHash
  * @param bool $enableUser
  *
  * @return array An array with operation status, always true if userID is ok
  */
 public static function activation($userID, $userHash, $enableUser = false)
 {
     $user = eZUser::fetch($userID);
     $userSetting = eZUserSetting::fetch($userID);
     if ($user && $userSetting) {
         $userChange = $userSetting->attribute('is_enabled') != $enableUser;
         if ($enableUser) {
             $userSetting->setAttribute('is_enabled', 1);
             $userSetting->store();
             eZUserAccountKey::removeByUserID($userID);
         } else {
             $userSetting->setAttribute('is_enabled', 0);
             $userSetting->store();
             $accountKey = eZUserAccountKey::createNew($userID, $userHash, time());
             $accountKey->store();
         }
         if ($userChange) {
             if (!$enableUser) {
                 eZUser::removeSessionData($userID);
             }
             eZContentCacheManager::clearContentCacheIfNeeded($userID);
         }
         return array('status' => true);
     } else {
         eZDebug::writeError("Failed to activate user {$userID} (could not fetch)", __METHOD__);
         return array('status' => false);
     }
 }
開發者ID:jordanmanning,項目名稱:ezpublish,代碼行數:38,代碼來源:ezuseroperationcollection.php

示例5: removeThis

 function removeThis()
 {
     $ini = eZINI::instance();
     $object = $this->object();
     $nodeID = $this->attribute('node_id');
     $objectID = $object->attribute('id');
     if (eZAudit::isAuditEnabled()) {
         // Set audit params.
         $objectName = $object->attribute('name');
         eZAudit::writeAudit('content-delete', array('Node ID' => $nodeID, 'Object ID' => $objectID, 'Content Name' => $objectName, 'Comment' => 'Removed the current node: eZContentObjectTreeNode::removeNode()'));
     }
     $db = eZDB::instance();
     $db->begin();
     $nodePath = $this->attribute('path_string');
     $childrensPath = $nodePath;
     $pathString = " path_string like '{$childrensPath}%' ";
     $urlAlias = $this->attribute('url_alias');
     // Remove static cache
     if ($ini->variable('ContentSettings', 'StaticCache') == 'enabled') {
         $optionArray = array('iniFile' => 'site.ini', 'iniSection' => 'ContentSettings', 'iniVariable' => 'StaticCacheHandler');
         $options = new ezpExtensionOptions($optionArray);
         $staticCacheHandler = eZExtension::getHandlerClass($options);
         $staticCacheHandler->removeURL("/" . $urlAlias);
         $staticCacheHandler->generateAlwaysUpdatedCache();
         $parent = $this->fetchParent();
     }
     $db->query("DELETE FROM ezcontentobject_tree\n                            WHERE {$pathString} OR\n                            path_string = '{$nodePath}'");
     // Re-cache parent node
     if ($ini->variable('ContentSettings', 'StaticCache') == 'enabled') {
         if ($parent) {
             $staticCacheHandler->cacheURL("/" . $parent->urlAlias());
         }
     }
     // Clean up URL alias entries
     eZURLAliasML::removeByAction('eznode', $nodeID);
     // Clean up content cache
     eZContentCacheManager::clearContentCacheIfNeeded($this->attribute('contentobject_id'));
     // clean up user cache
     if (in_array($object->attribute('contentclass_id'), eZUser::contentClassIDs())) {
         eZUser::removeSessionData($objectID);
         eZUser::purgeUserCacheByUserId($objectID);
     }
     $parentNode = $this->attribute('parent');
     if (is_object($parentNode)) {
         eZContentCacheManager::clearContentCacheIfNeeded($parentNode->attribute('contentobject_id'));
         $parentNode->updateAndStoreModified();
         eZNodeAssignment::purgeByParentAndContentObjectID($parentNode->attribute('node_id'), $objectID);
     }
     // Clean up policies and limitations
     eZRole::cleanupByNode($this);
     // Clean up recent items
     eZContentBrowseRecent::removeRecentByNodeID($nodeID);
     // Clean up bookmarks
     eZContentBrowseBookmark::removeByNodeID($nodeID);
     // Clean up tip-a-friend counter
     eZTipafriendCounter::removeForNode($nodeID);
     // Clean up view counter
     eZViewCounter::removeCounter($nodeID);
     $db->commit();
 }
開發者ID:brookinsconsulting,項目名稱:ezecosystem,代碼行數:60,代碼來源:ezcontentobjecttreenode.php


注:本文中的eZUser::removeSessionData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。