[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/action/admin/ -> admindefaultaction.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/action/action.class.php" );
   4      lt_include( PLOG_CLASS_PATH."class/view/admin/admindefaultview.class.php" );
   5      lt_include( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
   6  
   7      /**
   8       * \ingroup Action
   9       * @private
  10       *
  11       * Sample action on how to develop our own actions.
  12       *
  13       * Please also refer to SampleView.class.php for more information
  14       */
  15      class AdminDefaultAction extends Action 
  16      {
  17  
  18          var $_blogInfo;
  19          var $_userInfo;
  20  
  21          /**
  22           * Constructor. If nothing else, it also has to call the constructor of the parent
  23           * class, BlogAction with the same parameters
  24           */
  25          function AdminDefaultAction( $actionInfo, $request )
  26          {
  27              $this->Action( $actionInfo, $request );
  28          }
  29  
  30          function sessionInfoAvailable()
  31          {
  32              $session = HttpVars::getSession();
  33  
  34              if( isset($session["SessionInfo"])) {
  35                  $sessionInfo = $session["SessionInfo"];
  36                  $this->_blogInfo    = $sessionInfo->getValue( "blogInfo" );
  37                  $this->_userInfo    = $sessionInfo->getValue( "userInfo" );
  38                  if( empty($this->_blogInfo) || empty($this->_userInfo) )
  39                      return false;
  40                  else
  41                      return true;
  42              }
  43              else
  44                  return false;
  45          }
  46  
  47          /**
  48           * Carries out the specified action
  49           */
  50          function perform()
  51          {
  52              // initialize the view, but we first check if there is session information avaible
  53              // since in that case we will not make the user choose enter user and pass again, but
  54              // show the main menu page straight away
  55              
  56              if( $this->sessionInfoAvailable()) {
  57                  AdminController::setForwardAction( "emptyAction" );
  58                  // launch the event since we have all the info we need
  59                  $pm =& PluginManager::getPluginManager();
  60                  $pm->setBlogInfo( $this->_blogInfo );
  61                  $pm->setUserInfo( $this->_userInfo );
  62                  $pm->notifyEvent( EVENT_LOGIN_SUCCESS );                            
  63              }
  64              else {
  65                  $this->_view = new AdminDefaultView();
  66              }
  67  
  68              // better to return true if everything fine
  69              return true;
  70          }
  71      }
  72  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics