[ 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/ -> adminuserprofileaction.class.php (source)

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
   4      lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
   5      lt_include( PLOG_CLASS_PATH."class/view/admin/adminsiteuserslistview.class.php" );
   6      lt_include( PLOG_CLASS_PATH."class/view/admin/admineditsiteuserview.class.php" );
   7      lt_include( PLOG_CLASS_PATH."class/dao/users.class.php" );
   8  
   9      /**
  10       * \ingroup Action
  11       * @private
  12       *
  13       * allows to edit the profile of a user
  14       */
  15      class AdminUserProfileAction extends AdminAction 
  16      {
  17  
  18          var $_userId;
  19  
  20      	function AdminUserProfileAction( $actionInfo, $request )
  21          {
  22              $this->AdminAction( $actionInfo, $request );
  23              
  24              // data validation
  25              $this->registerFieldValidator( "userId", new IntegerValidator());
  26              $view = new AdminSiteUsersListView( $this->_blogInfo );
  27              $view->setErrorMessage( $this->_locale->tr("error_invalid_user" ));
  28              $this->setValidationErrorView( $view );
  29              
  30              $this->requireAdminPermission( "update_user" );            
  31          }
  32  
  33          function perform()
  34          {
  35              // load the user settings
  36              $this->_userId = $this->_request->getValue( "userId" );
  37              $users = new Users();
  38              $user  = $users->getUserInfoFromId( $this->_userId );
  39  
  40              // if no info could be fetched, shown an error and quit
  41              if( !$user ) {
  42                  $this->_view = new AdminSiteUsersListView( $this->_blogInfo );
  43                  $this->_view->setErrorMessage( $this->_locale->tr("error_invalid_user"));
  44                  $this->setCommonData();
  45                  return false;
  46              }
  47              $this->notifyEvent( EVENT_USER_LOADED, Array( "user" => &$user ));
  48  
  49              // start the view and render it
  50              $this->_view = new AdminEditSiteUserView( $this->_blogInfo, $user );
  51              $this->setCommonData();
  52  
  53              return true;
  54          }
  55      }
  56  ?>


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