aliroUserRequest Class Reference

Inheritance diagram for aliroUserRequest:

aliroAbstractRequest

List of all members.

Public Member Functions

 doControl ()
 isHome ()
 getTemplateObject ()
 notAuthorised ()

Static Public Member Functions

static getInstance ()

Protected Member Functions

 __construct ()
 userHeaders ()
 runTemplate ($template)
 runNonTemplate ($template)
 getComponentClass ($component)

Protected Attributes

 $prefix = 'user'
 $core_item = ''
 $path_side = 'front'
 $siteBaseURL = ''


Detailed Description

Definition at line 3 of file aliroUserRequest.php.


Constructor & Destructor Documentation

aliroUserRequest::__construct (  )  [protected]

Reimplemented from aliroAbstractRequest.

Definition at line 9 of file aliroUserRequest.php.

References aliroPathway::getInstance().

00009                                       {
00010         parent::__construct();
00011         $this->pathway = aliroPathway::getInstance();
00012         $this->siteBaseURL = $this->getCfg('live_site');
00013     }


Member Function Documentation

static aliroUserRequest::getInstance (  )  [static]

Definition at line 14 of file aliroUserRequest.php.

Referenced by aliroTemplateBase::__construct(), and aliroRequest::getInstance().

00014                                           {
00015         if (self::$instance == null) self::$instance = new aliroUserRequest();
00016         return self::$instance;
00017     }

aliroUserRequest::doControl (  ) 

detect first visit

Definition at line 20 of file aliroUserRequest.php.

References $_REQUEST, $sef, aliroAbstractRequest::getFormCheckError(), aliroMambotHandler::getInstance(), aliroSEF::getInstance(), aliroUserAuthenticator::getInstance(), aliroAbstractRequest::getParam(), aliroSessionFactory::getSession(), getTemplateObject(), aliroAbstractRequest::invokeComponent(), aliroSession::isAdminPresent(), isHome(), aliroAbstractRequest::redirect(), runNonTemplate(), runTemplate(), and userHeaders().

00020                                  {
00021         if ($this->option == 'login' OR $this->option == 'logout') {
00022             if ($this->formcheck) $this->redirect($_SERVER['REQUEST_URI'], $this->getFormCheckError(), _ALIRO_ERROR_WARN);
00023             $authenticator = aliroUserAuthenticator::getInstance();
00024             if ($this->option == 'logout') $authenticator->logout();
00025             else $authenticator->userLogin();
00026         }
00027         if (strlen($_SERVER['REQUEST_URI']) < 2) $this->isHome = true;
00028         aliroSessionFactory::getSession()->rememberMe($this);
00029         $this->configuration->setRedirectHere();
00030         $indextype = $this->getParam($_REQUEST, 'indextype', 1);
00031         if ($indextype == 2) $this->urlerror = 0;
00032         else {
00033             $sef = aliroSEF::getInstance();
00034             $this->urlerror = $sef->sefRetrieval();
00035             $indextype = 1;
00036             $this->option = $this->component_name = strtolower($this->getParam($_REQUEST, 'option'));
00037         }
00038         $this->bestmatch = $this->mhandler->matchURL();
00039         if ($this->configuration->getCfg('offline') AND (!aliroSession::isAdminPresent())) {
00040             @session_write_close();
00041             new aliroOffline();
00042             exit();
00043         }
00044         if ($indextype == 2 AND $this->getParam( $_REQUEST, 'do_pdf', 0 ) == 1 ) {
00045             include_once('includes/pdf.php');
00046             exit();
00047         }
00049         // Should there be a condition on this?
00050         // $editor = aliroEditor::getInstance();
00051         // $this->initeditor = $editor->initEditor();
00052         $diagnostics = ob_get_clean();
00053         $this->invokeComponent($this->bestmatch);
00054         $this->userHeaders();
00055         ob_start();
00056         $mambothandler = aliroMambotHandler::getInstance();
00057         // This is an opportunity for a mambot that writes additional headers
00058         $mambothandler->trigger('onHeaders', array($this));
00059         // Shouldn't be any real output, but flush any diagnostics now headers are written
00060         $diagnostics .= ob_get_clean();
00061         if ($this->do_gzip) ob_start('ob_gzhandler');
00062         echo trim($diagnostics);
00063         $template = $this->getTemplateObject();
00064         if ($indextype == 1) {
00065             $this->runTemplate($template);
00066             $mambothandler->trigger('afterTemplate', array($this->configuration));
00067         }
00068         elseif ($indextype == 2) $this->runNonTemplate($template);
00069         if ($this->do_gzip) ob_end_flush();
00070     }

aliroUserRequest::isHome (  ) 

Definition at line 72 of file aliroUserRequest.php.

Referenced by doControl().

00072                               {
00073         return $this->isHome;
00074     }

aliroUserRequest::userHeaders (  )  [protected]

Definition at line 76 of file aliroUserRequest.php.

Referenced by doControl().

00076                                       {
00077         header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
00078         header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
00079         header( 'Content-type: text/html; '._ISO);
00080         header( 'Cache-Control: no-store, no-cache, must-revalidate' );
00081         header( 'Cache-Control: post-check=0, pre-check=0', false );
00082         header( 'Pragma: no-cache' );
00083         if ('HEAD' == $_SERVER['REQUEST_METHOD']) exit;
00084     }

aliroUserRequest::runTemplate ( template  )  [protected]

Definition at line 86 of file aliroUserRequest.php.

References aliroScreenArea::prepareTemplate().

Referenced by doControl().

00086                                                {
00087         // loads template file
00088         aliroScreenArea::prepareTemplate($template);
00089         @session_write_close();
00090         $template->render();
00091         echo "<!-- ".time()." -->";
00092     }

aliroUserRequest::runNonTemplate ( template  )  [protected]

Definition at line 94 of file aliroUserRequest.php.

References $_REQUEST, and aliroAbstractRequest::getParam().

Referenced by doControl().

00094                                                   {
00095         @session_write_close();
00096         if ($this->getParam($_REQUEST, 'no_html')) echo $this->chandler->mosMainBody();
00097         else $template->component_render();
00098     }

aliroUserRequest::getTemplateObject (  ) 

Definition at line 100 of file aliroUserRequest.php.

References aliroTemplateHandler::getInstance().

Referenced by doControl().

00100                                          {
00101         if ($this->templateObject == null) {
00102             $templateclass = aliroTemplateHandler::getInstance()->getDefaultTemplateClass();
00103             $this->templateObject = new $templateclass();
00104         }
00105         return $this->templateObject;
00106     }

aliroUserRequest::getComponentClass ( component  )  [protected]

Definition at line 108 of file aliroUserRequest.php.

00108                                                       {
00109         return $component->class;
00110     }

aliroUserRequest::notAuthorised (  ) 

Definition at line 112 of file aliroUserRequest.php.

00112                                      {
00113         new aliroPage404();
00114     }


Member Data Documentation

aliroUserRequest::$prefix = 'user' [protected]

Definition at line 4 of file aliroUserRequest.php.

aliroUserRequest::$core_item = '' [protected]

Definition at line 5 of file aliroUserRequest.php.

aliroUserRequest::$path_side = 'front' [protected]

Definition at line 6 of file aliroUserRequest.php.

aliroUserRequest::$siteBaseURL = '' [protected]

Definition at line 7 of file aliroUserRequest.php.


The documentation for this class was generated from the following file:

Generated on Wed May 14 13:02:00 2008 for ALIRO by  doxygen 1.5.5