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

   1  <?php
   2  
   3      lt_include( PLOG_CLASS_PATH."class/dao/status/genericstatuslist.class.php" );
   4      
   5      define( "USER_STATUS_ALL", -1, true ); 
   6      define( "USER_STATUS_ACTIVE", 1, true );
   7      define( "USER_STATUS_DISABLED", 2, true );
   8      define( "USER_STATUS_UNCONFIRMED", 3, true );
   9      
  10      /**

  11       * This class keeps track of all the possible status that a user can have. If plugins dynamically 

  12       * register new user statuses, this class will still be able to handle them

  13       * 

  14       * \ingroup DAO

  15       */    
  16      class UserStatus extends GenericStatusList
  17      {
  18      
  19          /**

  20           * returns a list with all the user statuses that have been defined

  21           * so far in the code.

  22           *

  23           * @return Returns an array where every position is an array with two

  24           * keys: "constant" and "value", where "constant" is the name of the constant

  25           * that defines this status and "value" is the value assigned to it

  26           */
  27          function getStatusList( $includeStatusAll = false )
  28          {
  29              return( GenericStatusList::getStatusList( "USER_STATUS_", "USER_STATUS_ALL", $includeStatusAll ));
  30          }
  31          
  32          /**

  33           * @param status The status code we'd like to check

  34           * 

  35           * @return Returns true if the status is valid or false otherwise

  36           */
  37          function isValidStatus( $status )
  38          {
  39              $statusList = UserStatus::getStatusList( true );
  40              return( in_array( $status, $statusList ));
  41          }
  42          
  43          /**

  44           * returns the default status code for this class

  45           *

  46           * @return The default status

  47           */
  48          function getDefaultStatus()
  49          {
  50               return( USER_STATUS_ALL );   
  51          }
  52      }
  53  ?>


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