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


PHP UserStatus::removeMask方法代码示例

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


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

示例1: execute

 /**
  * Executes this pulse. Does the withdrawn search and emails the results.
  */
 public function execute()
 {
     // Reschedule the next run of this process
     $sp = $this->makeClone();
     $sp->execute_at = strtotime("tomorrow");
     $sp->save();
     // Load some classes
     PHPWS_Core::initModClass('hms', 'HMS.php');
     PHPWS_Core::initModClass('hms', 'WithdrawnSearch.php');
     PHPWS_Core::initModClass('hms', 'HMS_Email.php');
     PHPWS_Core::initModClass('hms', 'UserStatus.php');
     UserStatus::wearMask('HMS System');
     // The search is run over all future terms
     $terms = Term::getFutureTerms();
     $text = "";
     foreach ($terms as $term) {
         $search = new WithdrawnSearch($term);
         $search->doSearch();
         $text .= "\n\n=========== " . Term::toString($term) . " ===========\n\n";
         $text .= $search->getTextView();
     }
     $text = $search->getTextView();
     HMS_Email::sendWithdrawnSearchOutput($text);
     UserStatus::removeMask();
     HMS::quit();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:29,代码来源:WithdrawnSearchEmailCommand.php

示例2: execute

 /**
  * Executes this pulse. Checks for any pending reports and runs them.
  */
 public static function execute()
 {
     // Reschedule the next run of this process
     /*
      $sp = $this->makeClone();
      $sp->execute_at = strtotime("+1 minutes");
      $sp->save();
     * 
     */
     // Load necessary classes
     PHPWS_Core::initModClass('hms', 'UserStatus.php');
     PHPWS_Core::initModClass('hms', 'ReportFactory.php');
     PHPWS_Core::initModCLass('hms', 'HMS_Email.php');
     // Fake a user, in case we need that
     UserStatus::wearMask('HMS System');
     // Check for any pending reports (scheduled for any time up until now)
     $db = new PHPWS_DB('hms_report');
     $db->addWhere('completed_timestamp', null, 'IS');
     // not completed
     $db->addWhere('began_timestamp', null, 'IS');
     // not already running somewhere
     $db->addWhere('scheduled_exec_time', time(), '<=');
     // scheduled exec time is now or before
     $db->addOrder('scheduled_exec_time ASC');
     // Run in order scheduled
     $results = $db->select();
     // If there's nothing to do, quite nicely
     if (!isset($results) || is_null($results) || empty($results)) {
         UserStatus::removeMask();
         return 'No reports waiting.';
     }
     // Run each report
     foreach ($results as $row) {
         $report = null;
         try {
             // Load the proper controller for this report
             $reportCtrl = ReportFactory::getControllerById($row['id']);
             // Load this report's params
             $reportCtrl->loadParams();
             // Generate the report
             $reportCtrl->generateReport();
             $report = $reportCtrl->getReport();
         } catch (Exception $e) {
             // handle the exception nicely
             self::emailError(self::formatException($e));
             exit;
         }
         // Send success notification
         $username = $report->getCreatedBy();
         if ($username == 'jbooker') {
             $username = 'jb67803';
         }
         HMS_Email::sendReportCompleteNotification($username, $report->getFriendlyName());
     }
     // Remove the mask
     UserStatus::removeMask();
     // Exit cleanly
     return;
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:62,代码来源:ReportRunner.php

示例3: execute

 public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'login_as_student')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to login as a student.');
     }
     if (!UserStatus::isMasquerading()) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You are not currently masquerading as another user.');
     }
     $user = UserStatus::getUsername();
     UserStatus::removeMask();
     $cmd = CommandFactory::getCommand('ShowStudentProfile');
     $cmd->setUsername($user);
     $cmd->redirect();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:16,代码来源:RemoveMaskCommand.php


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