コード例 #1
0
ファイル: AdminHMS.php プロジェクト: jlbooker/homestead
 public function process()
 {
     $this->context->setDefault('action', 'ShowAdminMaintenanceMenu');
     parent::process();
     $view = new hms\UserView();
     $view->setMain($this->context->getContent());
     $nv = new hms\NotificationView();
     $nv->popNotifications();
     $view->addNotifications($nv->show());
     $view->show();
     $this->saveState();
 }
コード例 #2
0
ファイル: GuestHMS.php プロジェクト: jlbooker/homestead
 public function process()
 {
     $this->context->setDefault('action', 'ShowFrontPage');
     parent::process();
     PHPWS_Core::initModClass('hms', 'GuestView.php');
     $view = new hms\GuestView();
     $view->setMain($this->context->getContent());
     $nv = new hms\NotificationView();
     $nv->popNotifications();
     $view->addNotifications($nv->show());
     $view->show();
     $this->saveState();
 }
コード例 #3
0
ファイル: HMS.php プロジェクト: jlbooker/homestead
 public function process()
 {
     // This hack is the most awful hack ever.  Fix phpWebSite so that
     // user logins are logged separately.
     if (Current_User::isLogged() && !isset($_SESSION['HMS_LOGGED_THE_LOGIN'])) {
         $username = strtolower(Current_User::getUsername());
         HMS_Activity_Log::log_activity($username, ACTIVITY_LOGIN, $username, NULL);
         $_SESSION['HMS_LOGGED_THE_LOGIN'] = $username;
     }
     if (!Current_User::isLogged() && $this->context->get('action') != 'ShowFrontPage') {
         NQ::simple('hms', hms\NotificationView::ERROR, 'You must be logged in to do that.');
         $action = 'ShowFrontPage';
     } else {
         $action = $this->context->get('action');
     }
     $cmd = CommandFactory::getCommand($action);
     if (HMS_DEBUG) {
         $cmd->execute($this->context);
     } else {
         try {
             $cmd->execute($this->context);
         } catch (PermissionException $p) {
             NQ::Simple('hms', hms\NotificationView::ERROR, 'You do not have permission to perform that action. If you believe this is an error, please contact University Housing.');
             $nv = new hms\NotificationView();
             $nv->popNotifications();
             Layout::add($nv->show());
         } catch (Exception $e) {
             try {
                 $message = $this->formatException($e);
                 NQ::Simple('hms', hms\NotificationView::ERROR, 'An internal error has occurred, and the authorities have been notified.  We apologize for the inconvenience.');
                 $this->emailError($message);
                 $nv = new hms\NotificationView();
                 $nv->popNotifications();
                 Layout::add($nv->show());
             } catch (Exception $e) {
                 $message2 = $this->formatException($e);
                 echo "HMS has experienced a major internal error.  Attempting to email an admin and then exit.";
                 $message = "Something terrible has happened, and the exception catch-all threw an exception.\n\nThe first exception was:\n\n{$message}\n\nThe second exception was:\n\n{$message2}";
                 mail(FROM_ADDRESS, 'A Major HMS Error Has Occurred', $message);
                 exit;
             }
         }
     }
 }