Beispiel #1
0
 function after_filter($action, $args)
 {
     parent::after_filter($action, $args);
     // send performance metric
     if (isset($this->performance_timer)) {
         $timer = $this->performance_timer;
         $timer('core.my_courses_time');
     }
 }
Beispiel #2
0
 /**
  * After filter of the controller actually transmit the file contents and
  * removes all files that were created or copied during the download
  * process.
  *
  * @param String $action Action that was executed
  * @param Array  $args   Arguments that were passed
  */
 public function after_filter($action, $args)
 {
     parent::after_filter($action, $args);
     if ($this->download_handle !== null && is_resource($this->download_handle)) {
         fpassthru($this->download_handle);
         fclose($this->download_handle);
     }
     if ($this->download_remove !== null && $this->download_remove && file_exists($this->download_remove)) {
         unlink($this->download_remove);
     }
 }
Beispiel #3
0
 function after_filter($action, $args)
 {
     if (Request::isXhr()) {
         if (PageLayout::getTitle()) {
             $this->response->add_header('X-Title', PageLayout::getTitle());
         }
     }
     parent::after_filter($action, $args);
 }
Beispiel #4
0
 function after_filter($action, $args)
 {
     if (Request::isXhr()) {
         foreach ($this->response->headers as $k => $v) {
             if ($k === 'Location') {
                 $this->response->headers['X-Location'] = $v;
                 unset($this->response->headers['Location']);
                 $this->response->set_status(200);
                 $this->response->body = '';
             }
         }
     }
     parent::after_filter($action, $args);
 }
Beispiel #5
0
 /**
  * The after filter handles the sending of private messages via email, if
  * present. Also, if an action requires the user to be logged out, this is
  * accomplished here.
  *
  * @param String $action Name of the action that has been invoked
  * @param Array  $args   Arguments of the action
  */
 public function after_filter($action, $args)
 {
     if ($this->restricted && count($this->private_messages) > 0) {
         setTempLanguage($this->user->user_id);
         $message = _("Ihre persönliche Seite wurde von Admin verändert.\n " . "Folgende Veränderungen wurden vorgenommen:\n \n") . '- ' . implode("\n- ", $this->private_messages);
         $subject = _('Systemnachricht:') . ' ' . _('Profil verändert');
         restoreLanguage();
         $messaging = new messaging();
         $messaging->insert_message($message, $this->user->username, '____%system%____', null, null, true, '', $subject);
     }
     // Check whether the user should be logged out, the token is
     // neccessary since the user could reload the page and will be logged
     // out immediately after, resulting in a login/logout-loop.
     $should_logout = $action === 'logout' && $this->flash['logout-token'] === Request::get('token');
     if ($should_logout) {
         $GLOBALS['sess']->delete();
         $GLOBALS['auth']->logout();
     }
     parent::after_filter($action, $args);
     if ($should_logout) {
         $GLOBALS['user']->set_last_action(time() - 15 * 60);
     }
 }