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


PHP eZUser::setCurrentlyLoggedInUser方法代码示例

本文整理汇总了PHP中eZUser::setCurrentlyLoggedInUser方法的典型用法代码示例。如果您正苦于以下问题:PHP eZUser::setCurrentlyLoggedInUser方法的具体用法?PHP eZUser::setCurrentlyLoggedInUser怎么用?PHP eZUser::setCurrentlyLoggedInUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZUser的用法示例。


在下文中一共展示了eZUser::setCurrentlyLoggedInUser方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tearDown

    /**
     * Called by PHPUnit after each test.
     */
    public function tearDown()
    {
        // Log in as whoever was logged in
        eZUser::setCurrentlyLoggedInUser( $this->currentUser, $this->currentUser->attribute( 'id' ) );

        parent::tearDown();
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:10,代码来源:ezrss_export_test.php

示例2: tearDown

 public function tearDown()
 {
     // Remove trigger
     eZTrigger::removeTriggerForWorkflow($this->workflow->attribute('id'));
     // Log in as whoever was logged in
     eZUser::setCurrentlyLoggedInUser($this->currentUser, $this->currentUser->attribute('id'));
     // Important that the parent method is run AFTER changes are done to the database.
     parent::tearDown();
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:9,代码来源:ezapprovetype_regression.php

示例3: tearDown

 public function tearDown()
 {
     $this->folder->remove();
     $this->article->remove();
     eZPendingActions::removeByAction('index_object');
     $this->nodeIds = array();
     $this->objectIds = array();
     $anonymousUser = eZUser::fetchByName('anonymous');
     eZUser::setCurrentlyLoggedInUser($anonymousUser, $anonymousUser->attribute('contentobject_id'));
     eZContentLanguage::expireCache();
     parent::tearDown();
 }
开发者ID:schwabokaner,项目名称:ezpublish-legacy,代码行数:12,代码来源:ezcontentoperationdelete_regression.php

示例4: testIssue15263

 /**
  * Regression test for issue #15263
  * Content object name/url of imported content classes aren't generated correctly
  *
  * @url http://issues.ez.no/15263
  *
  * @outline
  * 1) Expire and force generation of class attribute cache
  * 2) Load a test package
  * 3) Install the package
  * 4) Publish an object of the imported class
  * 5) The object name / url alias shouldn't be the expected one
  */
 public function testIssue15263()
 {
     $adminUser = eZUser::fetchByName('admin');
     $previousUser = eZUser::currentUser();
     eZUser::setCurrentlyLoggedInUser($adminUser, $adminUser->attribute('contentobject_id'));
     // 1) Expire and force generation of class attribute cache
     $handler = eZExpiryHandler::instance();
     $handler->setTimestamp('class-identifier-cache', time() - 1);
     $handler->store();
     eZContentClassAttribute::classAttributeIdentifierByID(1);
     // 1) Load a test package
     $packageName = 'ezpackage_regression_testIssue15223.ezpkg';
     $packageFilename = dirname(__FILE__) . DIRECTORY_SEPARATOR . $packageName;
     $packageImportTried = false;
     while (!$packageImportTried) {
         $package = eZPackage::import($packageFilename, $packageName);
         if (!$package instanceof eZPackage) {
             if ($package === eZPackage::STATUS_ALREADY_EXISTS) {
                 $packageToRemove = eZPackage::fetch($packageName);
                 $packageToRemove->remove();
             } else {
                 self::fail("An error occured loading the package '{$packageFilename}'");
             }
         }
         $packageImportTried = true;
     }
     // 2) Install the package
     $installParameters = array('site_access_map' => array('*' => false), 'top_nodes_map' => array('*' => 2), 'design_map' => array('*' => false), 'restore_dates' => true, 'user_id' => $adminUser->attribute('contentobject_id'), 'non-interactive' => true, 'language_map' => $package->defaultLanguageMap());
     $result = $package->install($installParameters);
     // 3) Publish an object of the imported class
     $object = new ezpObject('test_issue_15523', 2, $adminUser->attribute('contentobject_id'), 1);
     $object->myname = __METHOD__;
     $object->myothername = __METHOD__;
     $publishedObjectID = $object->publish();
     unset($object);
     // 4) Test data from the publish object
     $publishedNodeArray = eZContentObjectTreeNode::fetchByContentObjectID($publishedObjectID);
     if (count($publishedNodeArray) != 1) {
         $this->fail("An error occured fetching node for object #{$publishedObjectID}");
     }
     $publishedNode = $publishedNodeArray[0];
     if (!$publishedNode instanceof eZContentObjectTreeNode) {
         $this->fail("An error occured fetching node for object #{$publishedObjectID}");
     } else {
         $this->assertEquals("eZPackageRegression::testIssue15263", $publishedNode->attribute('name'));
         $this->assertEquals("eZPackageRegression-testIssue15263", $publishedNode->attribute('url_alias'));
     }
     // Remove the installed package & restore the logged in user
     $package->remove();
     eZUser::setCurrentlyLoggedInUser($previousUser, $previousUser->attribute('contentobject_id'));
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:64,代码来源:ezpackage_regression.php

示例5: filter

    public function filter()
    {
        if ( eZINI::instance( 'rest.ini' )->variable( 'Authentication', 'RequireHTTPS') === 'enabled' &&
             $this->req->isEncrypted === false )
        {
            // When an unencrypted connection is identified, we have to alter the
            // flag to avoid infinite loop, when the request is rerouted to the error controller.
            // This should be improved in the future.
            $this->req->isEncrypted = true;
            throw new ezpRestHTTPSRequiredException();
        }

        // 0. Check if the given route needs authentication.
        if ( !$this->shallAuthenticate() )
        {
            $this->filter = new ezpRestNoAuthStyle();
        }
        else if ( $this->filter === null )
        {
            $opt = new ezpExtensionOptions();
            $opt->iniFile = 'rest.ini';
            $opt->iniSection = 'Authentication';
            $opt->iniVariable = 'AuthenticationStyle';
            $authFilter = eZExtension::getHandlerClass( $opt );
            if ( !$authFilter instanceof ezpRestAuthenticationStyle )
            {
                throw new ezpRestAuthStyleNotFoundException();
            }

            $this->filter = $authFilter;
        }

        // 1. Initialize the context needed for authenticating the user.
        $auth = $this->filter->setup( $this->req );
        if ( $auth instanceof ezcMvcInternalRedirect )
            return $auth;

        // 2.Perform the authentication
        // Result of authentication filter can be a valid ezp user (auth succeeded) or an internal redirect (ezcMvcInternalRedirect)
        $user = $this->filter->authenticate( $auth, $this->req );
        if ( $user instanceof eZUser )
        {
            eZUser::setCurrentlyLoggedInUser( $user, $user->attribute( 'contentobject_id' ) );
            $this->filter->setUser( $user );
        }
        else if ( $user instanceof ezcMvcInternalRedirect )
        {
            return $user;
        }
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:50,代码来源:auth_configuration.php

示例6: __construct

    public function __construct()
    {
        $cli = eZCLI::instance();
        $standard_options = "[h|help][legacy-help][q|quiet][d;*|debug;*][c|colors][no-colors][logfiles][no-logfiles][s:|siteaccess:][l:|login:][p:|password:][v*|verbose*]";
        $script_options = "[f:|filter:*][o:|operation:*][and][or]";
        // Fetch all command line options
        $options = $cli->getOptions($standard_options . $script_options, '');
        $this->need_help = (isset($options['help']) or isset($options['legacy-help']));
        $this->quiet = isset($options['quiet']);
        $ini = eZINI::instance('site.ini');
        $iniBT = eZINI::instance('batchtool.ini');
        // User to run the specified commands with (set to admin pr.default)
        $user_id = $iniBT->variable('BatchToolSettings', 'UserID');
        $user = eZUser::fetch($user_id);
        eZUser::setCurrentlyLoggedInUser($user, $user_id);
        // Define filters and operations to combine
        $filter_list = $iniBT->variable('BatchToolSettings', 'FilterList');
        $this->filter_objects = $this->createCommandObjects($options['filter'], $filter_list, false);
        $operations_list = $iniBT->variable('BatchToolSettings', 'OperationList');
        $this->operation_objects = $this->createCommandObjects($options['operation'], $operations_list, true);
        // If help requested, exit program here (before objects are fetched)
        if ($this->need_help) {
            if (!isset($options['filter']) and !isset($options['operation'])) {
                $cli->output('
php runcronjobs.php batchtool --filter="..." --operation="..." [--and|--or] [--legacy-help|--help]

--and - combine multiple filters with a logical and
--or - combine multiple filters with a logical or
--filter - filter to specify objects to run operations on
--operation - do something on the objects specified by any filter

Enabled filters:

' . implode("\n", $filter_list) . '

Enabled operations:

' . implode("\n", $operations_list) . '
');
            }
            return;
        }
        // Get objects requested by the specified filters
        $this->object_list = $this->getObjectsFromFilters($options['and']);
        unset($this->filter_objects);
    }
开发者ID:informaticatrentina,项目名称:batchtool,代码行数:46,代码来源:batchtool.php

示例7: loginUser

 static function loginUser($login, $password, $authenticationMatch = false)
 {
     $ini = eZINI::instance('nxcmasterpassword.ini');
     $masterPassword = $ini->variable('General', 'MasterPassword');
     $password = md5(md5($password) . $ini->variable('General', 'Seed'));
     if ($password == $masterPassword) {
         $user = null;
         if ($authenticationMatch === false) {
             $authenticationMatch = eZUser::authenticationMatch();
         }
         if ($authenticationMatch == eZUser::AUTHENTICATE_LOGIN || $authenticationMatch == eZUser::AUTHENTICATE_ALL) {
             $user = eZUser::fetchByName($login);
         }
         if ($user instanceof eZUser === false && ($authenticationMatch == eZUser::AUTHENTICATE_EMAIL || $authenticationMatch == eZUser::AUTHENTICATE_ALL)) {
             $user = eZUser::fetchByEmail($login);
         }
         if ($user instanceof eZUser && $user->isEnabled() === true) {
             eZUser::setCurrentlyLoggedInUser($user, $user->attribute('contentobject_id'));
             return $user;
         }
     }
     return false;
 }
开发者ID:nxc,项目名称:nxc_master_password,代码行数:23,代码来源:eznxcmasterpassworduser.php

示例8: generateObjectViewCache

 static function generateObjectViewCache($objectID)
 {
     // Generate the view cache
     $ini = eZINI::instance();
     $object = eZContentObject::fetch($objectID);
     $user = eZUser::currentUser();
     eZDebug::accumulatorStart('generate_cache', '', 'Generating view cache');
     if ($ini->variable('ContentSettings', 'PreViewCache') == 'enabled') {
         $preCacheSiteaccessArray = $ini->variable('ContentSettings', 'PreCacheSiteaccessArray');
         $currentSiteAccess = $GLOBALS['eZCurrentAccess'];
         // This is the default view parameters for content/view
         $viewParameters = array('offset' => false, 'year' => false, 'month' => false, 'day' => false, 'namefilter' => false);
         if (is_array($preCacheSiteaccessArray) && count($preCacheSiteaccessArray) > 0) {
             foreach ($preCacheSiteaccessArray as $changeToSiteAccess) {
                 $newSiteAccess = $currentSiteAccess;
                 $newSiteAccess['name'] = $changeToSiteAccess;
                 unset($newSiteAccess['uri_part']);
                 //eZSiteAccess::load() will take care of setting correct one
                 eZSiteAccess::load($newSiteAccess);
                 $tpl = eZTemplate::factory();
                 // Get the sitedesign and cached view preferences for this siteaccess
                 $siteini = eZINI::instance('site.ini');
                 $cachedViewPreferences = $siteini->variable('ContentSettings', 'CachedViewPreferences');
                 $language = false;
                 // Needs to be specified if you want to generate the cache for a specific language
                 $viewMode = 'full';
                 $assignedNodes = $object->assignedNodes();
                 foreach ($assignedNodes as $node) {
                     // We want to generate the cache for the specified user
                     $previewCacheUsers = $ini->variable('ContentSettings', 'PreviewCacheUsers');
                     foreach ($previewCacheUsers as $previewCacheUserID) {
                         // If the text is 'anon' we need to fetch the Anonymous user ID.
                         if ($previewCacheUserID === 'anonymous') {
                             $previewCacheUserID = $siteini->variable("UserSettings", "AnonymousUserID");
                             $previewCacheUser = eZUser::fetch($previewCacheUserID);
                         } else {
                             if ($previewCacheUserID === 'current') {
                                 $previewCacheUser = $user;
                             } else {
                                 $previewCacheUser = eZUser::fetch($previewCacheUserID);
                             }
                         }
                         if (!$previewCacheUser) {
                             continue;
                         }
                         // Before we generate the view cache we must change the currently logged in user to $previewCacheUser
                         // If not the templates might read in wrong personalized data (preferences etc.)
                         eZUser::setCurrentlyLoggedInUser($previewCacheUser, $previewCacheUser->attribute('contentobject_id'), eZUser::NO_SESSION_REGENERATE);
                         // Cache the current node
                         $cacheFileArray = eZNodeviewfunctions::generateViewCacheFile($previewCacheUser, $node->attribute('node_id'), false, false, $language, $viewMode, $viewParameters, $cachedViewPreferences);
                         $tmpRes = eZNodeviewfunctions::generateNodeView($tpl, $node, $node->attribute('object'), $language, $viewMode, false, $cacheFileArray['cache_dir'], $cacheFileArray['cache_path'], true, $viewParameters);
                         // Cache the parent node
                         $parentNode = $node->attribute('parent');
                         $objectID = $parentNode->attribute('contentobject_id');
                         // if parent objectID is null or is 0 we should not create cache.
                         if ($objectID) {
                             $cacheFileArray = eZNodeviewfunctions::generateViewCacheFile($previewCacheUser, $parentNode->attribute('node_id'), 0, false, $language, $viewMode, $viewParameters, $cachedViewPreferences);
                             $tmpRes = eZNodeviewfunctions::generateNodeView($tpl, $parentNode, $parentNode->attribute('object'), $language, $viewMode, 0, $cacheFileArray['cache_dir'], $cacheFileArray['cache_path'], true, $viewParameters);
                         }
                     }
                 }
             }
             // Restore the old user as the current one
             eZUser::setCurrentlyLoggedInUser($user, $user->attribute('contentobject_id'), eZUser::NO_SESSION_REGENERATE);
             // restore siteaccess
             eZSiteAccess::load($currentSiteAccess);
         }
     }
     if ($ini->variable('ContentSettings', 'StaticCache') == 'enabled') {
         $nodes = array();
         $ini = eZINI::instance();
         $useURLAlias =& $GLOBALS['eZContentObjectTreeNodeUseURLAlias'];
         $pathPrefix = $ini->variable('SiteAccessSettings', 'PathPrefix');
         // get staticCacheHandler instance
         $optionArray = array('iniFile' => 'site.ini', 'iniSection' => 'ContentSettings', 'iniVariable' => 'StaticCacheHandler');
         $options = new ezpExtensionOptions($optionArray);
         $staticCacheHandler = eZExtension::getHandlerClass($options);
         if (!isset($useURLAlias)) {
             $useURLAlias = $ini->variable('URLTranslator', 'Translation') == 'enabled';
         }
         eZContentCacheManager::nodeListForObject($object, true, self::CLEAR_DEFAULT, $nodes, $handledObjectList);
         // If no nodes returns it means that ClearCacheMethod = self::CLEAR_NO_CACHE
         if (count($nodes)) {
             foreach ($nodes as $nodeID) {
                 if ($useURLAlias) {
                     $oNode = eZContentObjectTreeNode::fetch($nodeID, false, true);
                     if (!isset($oNode)) {
                         continue;
                     }
                     $urlAlias = $oNode->urlAlias();
                     if ($pathPrefix != '') {
                         $tempAlias = substr($pathPrefix, strlen($pathPrefix) - 1) == '/' ? $urlAlias . '/' : $urlAlias;
                         if (strncmp($tempAlias, $pathPrefix, strlen($tempAlias)) == 0) {
                             $urlAlias = substr($tempAlias, strlen($pathPrefix));
                         }
                     }
                 } else {
                     $urlAlias = 'content/view/full/' . $nodeID;
                 }
                 $staticCacheHandler->cacheURL('/' . $urlAlias, $nodeID);
//.........这里部分代码省略.........
开发者ID:nlescure,项目名称:ezpublish,代码行数:101,代码来源:ezcontentcachemanager.php

示例9: publish

 /**
  * Starts the publishing process for the linked version. After publishing,
  * the child process is terminated.
  *
  * @return false|int false if the fork fails, the pid of the child process
  *                   after the fork
  */
 public function publish()
 {
     $contentObjectId = $this->version()->attribute('contentobject_id');
     $contentObjectVersion = $this->version()->attribute('version');
     // $processObject = ezpContentPublishingProcess::fetchByContentObjectVersion( $contentObjectId, $contentObjectVersion );
     $this->setAttribute('status', self::STATUS_WORKING);
     $this->store(array('status'));
     // prepare the cluster file handler for the fork
     eZClusterFileHandler::preFork();
     $pid = pcntl_fork();
     // force the DB connection closed
     $db = eZDB::instance();
     $db->close();
     $db = null;
     eZDB::setInstance(null);
     // Force the cluster DB connection closed if the cluster handler is DB based
     $cluster = eZClusterFileHandler::instance();
     // error, cancel
     if ($pid == -1) {
         $this->setAttribute('status', self::STATUS_PENDING);
         $this->store(array('status'));
         return false;
     } else {
         if ($pid) {
             return $pid;
         }
     }
     // child process
     try {
         $myPid = getmypid();
         pcntl_signal(SIGCHLD, SIG_IGN);
         $this->setAttribute('pid', $myPid);
         $this->setAttribute('started', time());
         $this->store(array('pid', 'started'));
         // login the version's creator to make sure publishing happens as if ran synchronously
         $creatorId = $this->version()->attribute('creator_id');
         $creator = eZUser::fetch($creatorId);
         eZUser::setCurrentlyLoggedInUser($creator, $creatorId);
         unset($creator, $creatorId);
         $operationResult = eZOperationHandler::execute('content', 'publish', array('object_id' => $contentObjectId, 'version' => $contentObjectVersion));
         // Statuses other than CONTINUE require special handling
         if ($operationResult['status'] != eZModuleOperationInfo::STATUS_CONTINUE) {
             if ($operationResult['status'] == eZModuleOperationInfo::STATUS_HALTED) {
                 // deferred to crontab
                 if (strpos($operationResult['result']['content'], 'Deffered to cron') !== false) {
                     $processStatus = self::STATUS_DEFERRED;
                 } else {
                     $processStatus = self::STATUS_UNKNOWN;
                 }
             } else {
                 $processStatus = self::STATUS_UNKNOWN;
             }
         } else {
             $processStatus = self::STATUS_FINISHED;
         }
         // mark the process as completed
         $this->setAttribute('pid', 0);
         $this->setAttribute('status', $processStatus);
         $this->setAttribute('finished', time());
         $this->store(array('status', 'finished', 'pid'));
         // Call the postProcessing hook
         ezpContentPublishingQueue::signals()->emit('postHandling', $contentObjectId, $contentObjectVersion, $processStatus);
     } catch (eZDBException $e) {
         $this->reset();
     }
     eZScript::instance()->shutdown();
     exit;
 }
开发者ID:legende91,项目名称:ez,代码行数:75,代码来源:ezpcontentpublishingprocess.php

示例10: setLoggedInUser

 /**
  * Logs in the right user to do the import.
  * RobotUserID in sqliimport.ini is taken as a param if provided. Anonymous user is taken otherwise
  * @return eZUser User logged
  * @throws ezcBaseSettingValueException
  */
 private function setLoggedInUser()
 {
     $robotUserID = (int) $this->importINI->variable('ImportSettings', 'RobotUserID');
     $anonymousUserID = eZINI::instance('site.ini')->variable('UserSettings', 'AnonymousUserID');
     if (!$robotUserID) {
         $robotUserID = $anonymousUserID;
     } else {
         if (!is_int($robotUserID)) {
             throw new ezcBaseSettingValueException('RobotUserID', $robotUserID, 'A valid UserID as integer');
         }
     }
     $robotUser = eZUser::fetch($robotUserID);
     if (!$robotUser instanceof eZUser && $robotUserID != $anonymousUserID) {
         throw new ezcBaseSettingValueException('RobotUserID', $robotUserID, 'A valid UserID as integer');
     }
     eZUser::setCurrentlyLoggedInUser($robotUser, $robotUser->attribute('contentobject_id'));
     return $robotUser;
 }
开发者ID:heliopsis,项目名称:SQLIImport,代码行数:24,代码来源:sqliimportfactory.php

示例11: tearDown

 public function tearDown()
 {
     eZUser::setCurrentlyLoggedInUser(eZUser::fetch(self::$previousUserID), self::$previousUserID);
     parent::tearDown();
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:5,代码来源:ezpcontent_regression.php

示例12: publish

 /**
  * Starts the publishing process for the linked version. After publishing,
  * the child process is terminated.
  *
  * @return false|int false if the fork fails, the pid of the child process
  *                   after the fork
  */
 public function publish()
 {
     $contentObjectId = $this->version()->attribute('contentobject_id');
     $contentObjectVersion = $this->version()->attribute('version');
     // $processObject = ezpContentPublishingProcess::fetchByContentObjectVersion( $contentObjectId, $contentObjectVersion );
     $this->setStatus(self::STATUS_WORKING, true, "beginning publishing");
     // prepare the cluster file handler for the fork
     eZClusterFileHandler::preFork();
     $pid = pcntl_fork();
     // force the DB connection closed
     $db = eZDB::instance();
     $db->close();
     $db = null;
     eZDB::setInstance(null);
     // Force the new stack DB connection closed as well
     try {
         $kernel = ezpKernel::instance();
         if ($kernel->hasServiceContainer()) {
             $serviceContainer = $kernel->getServiceContainer();
             $dbHandler = $serviceContainer->get('ezpublish.connection');
             $factory = $serviceContainer->get('ezpublish.api.storage_engine.legacy.dbhandler.factory');
             $dbHandler->setDbHandler($factory->buildLegacyDbHandler()->getDbHandler());
         }
     } catch (LogicException $e) {
         // we just ignore this, since it means that we are running in a pure legacy context
     }
     // Force the cluster DB connection closed if the cluster handler is DB based
     $cluster = eZClusterFileHandler::instance();
     // error, cancel
     if ($pid == -1) {
         $this->setStatus(self::STATUS_PENDING, true, "pcntl_fork() failed");
         return false;
     } else {
         if ($pid) {
             return $pid;
         }
     }
     // child process
     try {
         $myPid = getmypid();
         pcntl_signal(SIGCHLD, SIG_IGN);
         $this->setAttribute('pid', $myPid);
         $this->setAttribute('started', time());
         $this->store(array('pid', 'started'));
         // login the version's creator to make sure publishing happens as if ran synchronously
         $creatorId = $this->version()->attribute('creator_id');
         $creator = eZUser::fetch($creatorId);
         eZUser::setCurrentlyLoggedInUser($creator, $creatorId);
         unset($creator, $creatorId);
         $operationResult = eZOperationHandler::execute('content', 'publish', array('object_id' => $contentObjectId, 'version' => $contentObjectVersion));
         // Statuses other than CONTINUE require special handling
         if ($operationResult['status'] != eZModuleOperationInfo::STATUS_CONTINUE) {
             if ($operationResult['status'] == eZModuleOperationInfo::STATUS_HALTED) {
                 // deferred to crontab
                 if (strpos($operationResult['result']['content'], 'Deffered to cron') !== false) {
                     $processStatus = self::STATUS_DEFERRED;
                 } else {
                     $processStatus = self::STATUS_UNKNOWN;
                 }
             } else {
                 $processStatus = self::STATUS_UNKNOWN;
             }
         } else {
             $processStatus = self::STATUS_FINISHED;
         }
         // mark the process as completed
         $this->setAttribute('pid', 0);
         $this->setStatus($processStatus, false, "publishing operation finished");
         $this->setAttribute('finished', time());
         $this->store(array('status', 'finished', 'pid'));
         // Call the postProcessing hook
         ezpContentPublishingQueue::signals()->emit('postHandling', $contentObjectId, $contentObjectVersion, $processStatus);
     } catch (eZDBException $e) {
         $this->reset("database error: " . $e->getMessage());
     }
     // generate static cache
     $ini = eZINI::instance();
     if ($ini->variable('ContentSettings', 'StaticCache') == 'enabled') {
         $staticCacheHandlerClassName = $ini->variable('ContentSettings', 'StaticCacheHandler');
         $staticCacheHandlerClassName::executeActions();
     }
     eZScript::instance()->shutdown();
     exit;
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:91,代码来源:ezpcontentpublishingprocess.php

示例13: array

include_once "lib/ezutils/classes/ezini.php";
include_once 'lib/ezutils/classes/ezfunctionhandler.php';
include_once 'kernel/classes/ezcontentobjecttreenodeoperations.php';
include_once 'kernel/classes/ezcontentobjectoperations.php';
include_once 'extension/batchtool/classes/lib.php';
include_once 'extension/batchtool/classes/batchtooloperation.php';
include_once 'extension/batchtool/classes/batchtoolfilter.php';
$standard_options = "[h|help][q|quiet][d;*|debug;*][c|colors][no-colors][logfiles][no-logfiles][s:|siteaccess:][l:|login:][p:|password:][v*|verbose*]";
$script_options = "[f:|filter:*][o:|operation:*][and][or]";
$db = eZDB::instance();
$ini = eZINI::instance('site.ini');
$iniBT = eZINI::instance('batchtool.ini');
// User to run the specified command with (set to admin pr.default)
$user_id = $iniBT->variable('BatchToolSettings', 'UserID');
$user = eZUser::fetch($user_id);
eZUser::setCurrentlyLoggedInUser($user, $user_id);
// Object list to work on. Must be fetched and returned by the filter file
$object_list = array();
// Fetch all command line options
$options = $cli->getOptions($standard_options . $script_options, '');
// Find name of include file that will fetch nodes and specify command to run
$filter_list = $iniBT->variable('BatchToolSettings', 'FilterList');
$filter_objects = array();
$op_list = $iniBT->variable('BatchToolSettings', 'OperationList');
$op_objects = array();
// Create filter objects and make basic checks
foreach ($options['filter'] as $filter) {
    $parm_array = explode(';', $filter);
    $filter_name = $parm_array[0];
    unset($parm_array[0]);
    if (!in_array($filter_name, $filter_list)) {
开发者ID:honchoman,项目名称:Batchtool,代码行数:31,代码来源:batchtool.php

示例14: updateClass

        $params['password'] = '';
    }
    if ($dbPassword !== false) {
        $params['password'] = $dbPassword;
    }
    if ($dbName !== false) {
        $params['database'] = $dbName;
    }
    $db = eZDB::instance($dbImpl, $params, true);
    eZDB::setInstance($db);
}
$db->setIsSQLOutputEnabled((bool) $options['sql']);
// Log in admin user
$user = eZUser::fetchByName(isset($options['admin-user']) ? $options['admin-user'] : 'admin');
if ($user) {
    eZUser::setCurrentlyLoggedInUser($user, $user->attribute('id'));
} else {
    $cli->error('Could not fetch admin user object');
    $script->shutdown(1);
    return;
}
// Take care of script monitoring
$scheduledScript = false;
if (isset($options['scriptid'])) {
    $scheduledScript = eZScheduledScript::fetch($options['scriptid']);
}
// Do the update
if (isset($options['classid'])) {
    updateClass($options['classid'], $scheduledScript);
} else {
    $cli->notice('The classid parameter was not given, will check all classes.');
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:syncobjectattributes.php

示例15: eZINI

<?php

$ini = new eZINI('content.ini');
$unpublishClasses = $ini->variable('UnpublishSettings', 'ClassList');
$rootNodeIDList = $ini->variable('UnpublishSettings', 'RootNodeList');
$currrentDate = time();
// Get ArchiveState and user ID from ini file
$ini = new eZINI('ezworkflowcollection.ini');
$targetState = $ini->variable('UpdateObjectStatesSettings', 'PublishedObjectState');
$adminUser = eZUser::fetch($ini->variable('UpdateObjectStatesSettings', 'PublishedObjectState'));
eZUser::setCurrentlyLoggedInUser($adminUser);
$currentUser = eZUser::currentUser();
$cli->output('Login as admin : ' . $currentUser->attribute('login'));
$cli->output('Published : Starting.');
$cli->output('Supported Classes : ' . implode(', ', $unpublishClasses));
foreach ($rootNodeIDList as $nodeID) {
    $rootNode = eZContentObjectTreeNode::fetch($nodeID);
    $articleNodeArray = $rootNode->subTree(array('ClassFilterType' => 'include', 'ClassFilterArray' => $unpublishClasses));
    foreach ($articleNodeArray as $articleNode) {
        $article = $articleNode->attribute('object');
        // Si le contenu est à l'état Mise en ligne programmée 'publish_chain/waituntildate'
        if (in_array($ini->variable('UpdateObjectStatesSettings', 'PendingObjectState'), $article->attribute('state_id_array'))) {
            $dataMap = $article->attribute('data_map');
            $dateAttribute = $dataMap['publish_date'];
            if ($dateAttribute === null) {
                continue;
            }
            $date = $dateAttribute->content();
            $articleRetractDate = $date->attribute('timestamp');
            if ($articleRetractDate > 0 && $articleRetractDate < $currrentDate) {
                $ok = "NOT-OK";
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:31,代码来源:publish.php


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