RvTwoClasses
[ class tree: RvTwoClasses ] [ index: RvTwoClasses ] [ all elements ]

Source for file user.php

Documentation is available at user.php

  1. <?php
  2. /**
  3.  * <b>Class Description</b>: Class representing a user of the system and the user's access rights to
  4.  * various parts of the system *
  5.  * @since : 29/04/2009
  6.  * @author Jan van der Breggen
  7.  * @package RvTwoClasses
  8.  * 
  9.  ***/
  10. class User
  11. {
  12.     private $id;
  13.     private $first;
  14.     private $last;
  15.     private $email;
  16.     private $roles;
  17.     private $uiAccess;
  18.     
  19.     function __construct($id$first$last$email$roles)
  20.     {
  21.         $this->id = $id;
  22.         $this->first = $first;
  23.         $this->last = $last;
  24.         $this->email = $email;
  25.         foreach($roles as $role)
  26.         {
  27.             $this->roles[$role['group_uid']]=$role['cat_name'];
  28.         }
  29.         
  30.         $this->setUiAccess();
  31.         
  32.     }
  33.     
  34.     /**
  35.      * retrieves the restricted ui elements from the database
  36.      * and determines the type of access (select, update, insert, delete or a combination of these)
  37.      * the user has to each element. the result is stored in the array $uiAccess
  38.      *
  39.      */
  40.     function setUiAccess()
  41.     {
  42.         
  43.     }
  44.     
  45.     function getUiAccess($elementName)
  46.     {
  47.         return $this->uiAccess[$elementName];
  48.     }
  49.     
  50.     function hasRole($roleId)
  51.     {
  52.        if (isSet($this->roles[$roleId]))
  53.        {
  54.            return true
  55.        }
  56.        
  57.        return false;
  58.     }
  59. }
  60. ?>

Documentation generated on Mon, 18 May 2009 11:22:23 +0200 by phpDocumentor 1.4.1