linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file class.user.php

Documentation is available at class.user.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage user
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  *  User Management
  10.  */
  11.  
  12. class user {
  13.   /* @param
  14.    * */
  15.   var $TDB_USER = T_USER// nom de la table.
  16.   var $URI_INPUT = "user/avatar/"// dossier racine de stockage des photos
  17.   var $NB_USERS = 30// affichage par défaut du nombre d'utilisateurs
  18.   var $UPLOAD_MAX_MO = 20480// taille maximale d'upload des avatars en octets
  19.   var $ID;
  20.   var $LOGIN;
  21.   var $PASSWORD;
  22.   var $COMMUNITY = USER_COMMUNITY;
  23.   var $CATEGORY;
  24.   var $RIGHT;
  25.   var $PROFILE;
  26.   var $DATE_CREA;
  27.   var $VALIDITY;
  28.   var $LAST_MODIFY;
  29.  
  30.   var $R_ID;
  31.   var $R_DASHBOARD;
  32.   var $R_WORKSHOP;
  33.   var $R_PROJECT;
  34.   var $R_PUBLICATION;
  35.   var $R_NEWS;
  36.   var $R_YELLOWPAGES;
  37.   var $R_THEME;
  38.   var $R_SCALE;
  39.   var $R_LEVEL;
  40.  
  41.   var $P_ID;
  42.   var $P_EMAIL;
  43.  
  44.   var $P_CITY;
  45.   var $P_BIRTHDATE;
  46.   var $P_LEISURES;
  47.   var $P_JOB;
  48.   var $P_AVATAR;
  49.   var $P_QUOTATION;
  50.   var $P_SIGNATURE;
  51.  
  52.   protected $dispatcher = null;
  53.  
  54.   public function __construct()
  55.   {
  56.     $this->dispatcher = $GLOBALS['dispatcher'];
  57.   }
  58.  
  59.   public function __call($method$arguments)
  60.   {
  61.     $event $this->dispatcher->notifyUntil(new sfEvent($this'user.extensible_function'array(
  62.       'method'    => $method,
  63.       'arguments' => $arguments
  64.     )));
  65.     if (!$event->isProcessed())
  66.     {
  67.       throw new Exception(sprintf('Call to undefined method %s::%s.'get_class($this)$method));
  68.     }
  69.  
  70.     return $event->getReturnValue();
  71.   }
  72.  
  73.   /**
  74.    * user::CheckDataIntegrity()
  75.    * Vérification intégrité des données
  76.    *
  77.    * @access public
  78.    * @param array $table : contient les composants d'un user
  79.    * @param object $sql_object 
  80.    * @return boolean si vrai renvoie true sinon message d'erreurs (string)
  81.    */
  82.   function CheckDataIntegrity($table$sql_object null)
  83.   {
  84.     if (isset($sql_object)) {
  85.       $result $this->_checkLoginValidity($table[0]$sql_object);
  86.       if (is_string($result)) return $result;
  87.     }
  88.     $result $this->_checkEmailValidity($table[1]);
  89.     if (is_string($result)) return $result;
  90.     return true;
  91.   }
  92.  
  93.   /**
  94.    * user::_checkLoginValidity()
  95.    * validation d'un login
  96.    *
  97.    * @access private
  98.    * @param string $login : login rentré par l'utilisateur
  99.    * @param object $sql_object 
  100.    * @return bool $result
  101.    *  si valide true sinon message d'erreur (string)
  102.    */
  103.   function _checkLoginValidity($login$sql_object)
  104.   {
  105.     $login trim($login);
  106.     if (!preg_match('|^[a-zA-Z0-9]+$|'$login)) return _t('user','login_prohibited');
  107.     if (strlen($login5return _t('user','login_tooshort');
  108.     if (strlen($login20_t('user','login_toolong');
  109.     $q "SELECT user_id FROM " $this->TDB_USER . " WHERE lower(user_login)= '" strtolower($login"' AND user_validity='Y';";
  110.  
  111.     $result $sql_object->DBSelect($q);
  112.  
  113.     if ($result != 0return _t('user','login_used');
  114.  
  115.     return true;
  116.   }
  117.  
  118.   /**
  119.    * user::checkPasswordValidity()
  120.    * validation d'un password
  121.    *
  122.    * @access publi
  123.    * @param string $password password rentre par l'utilisateur
  124.    * @param string $pass2 (option)
  125.    * @return bool si valide true sinon message d'erreur (string)
  126.    */
  127.   function checkPasswordValidity($password$pass2 = -1)
  128.   {
  129.     if (strlen($password5return _t('user','pass_tooshort');
  130.     if (strlen($password15return _t('user','pass_toolong');
  131.     if ($pass2 != -&& $password != $pass2return _t('user','pass_not_same');
  132.  
  133.     return true;
  134.   }
  135.  
  136.   /**
  137.    * user::_checkEmailValidity()
  138.    * validation d'un email
  139.    *
  140.    * @access private
  141.    * @param string $email email rentre par l'utilisateur
  142.    * @return string $result
  143.    *  return 1 si valide sinon message d'erreur (string)
  144.    */
  145.   function _checkEmailValidity($email)
  146.   {
  147.  
  148.     $is_valid validEmail($email);
  149.  
  150.     if(!$is_valid{
  151.       return _t('user','invalid_mail'" :'" $email "'";
  152.     else {
  153.       return true;
  154.     }
  155.  
  156.   }
  157.  
  158.   /**
  159.    * user::_setUserCategory()
  160.    * determine automatique la categorie d'un utilisateur en fonction de ses droits
  161.    * et renseigne l'objet
  162.    *
  163.    * @access private
  164.    * @param array $table_right tableau des droits de l'utilisateur
  165.    * @return bool $result
  166.    */
  167.   function _setUserCategory($table_right)
  168.   {
  169.     if (isset($table_right['category_user']&& $table_right['category_user'== 'A'$this->CATEGORY = 1;
  170.     else {
  171.       if(in_array('A'array_values($table_right))) $this->CATEGORY = 1;
  172.       elseif ($table_right['dashboard'== 'O' || $table_right['publication'== 'O' || $table_right['news'== 'O' || $table_right['workshop'== 'O'$this->CATEGORY = 2;
  173.       else $this->CATEGORY = 3;
  174.     }
  175.  
  176.     return true;
  177.   }
  178.  
  179.   /**
  180.    * user::_AddProfile()
  181.    * Ajout d'un profil
  182.    *
  183.    * @access private
  184.    * @param object $sql_object 
  185.    * @return integer $last_id
  186.    */
  187.   function _AddProfile($sql_object)
  188.   {
  189.     $q "INSERT INTO " T_PROFILE " (profile_email, profile_email_display, profile_city, profile_birthdate, profile_leisures, profile_job, profile_avatar, profile_quotation, profile_signature, profile_date_crea) VALUES ('" $this->P_EMAIL . "', '" $this->P_EMAIL_DISPLAY . "','', '0001-01-01', '', '', '', '', '', NOW());";
  190.     $last_id $sql_object->DBInsert ($q1);
  191.     return $last_id;
  192.   }
  193.  
  194.   /**
  195.    * user::_AddRight()
  196.    * stockage des droits d' un utilisateur BDD
  197.    *
  198.    * @access private
  199.    * @param array $table_right contient les droits
  200.    * @param object $sql_object 
  201.    * @return integer $last_id
  202.    */
  203.   function _AddRight($table_right$sql_object)
  204.   {
  205.     $this->R_DASHBOARD = $table_right['dashboard'];
  206.     $this->R_WORKSHOP = $table_right['workshop'];
  207.     $this->R_PROJECT = $table_right['project'];
  208.     $this->R_PUBLICATION = $table_right['publication'];
  209.     $this->R_NEWS = $table_right['news'];
  210.     $this->R_YELLOWPAGES = $table_right['yellowpages'];
  211.     $this->R_THEME = $table_right['theme'];
  212.     $this->R_SCALE = $table_right['scale'];
  213.     $this->R_LEVEL = $table_right['level'];
  214.     $this->R_CATEGORY_USER = $table_right['category_user'];
  215.     $q "INSERT INTO " T_RIGHT " (rights_dashboard, rights_workshop, rights_project, rights_publication, rights_news, rights_yellowpages, rights_theme, rights_scale, rights_level, rights_category_user, rights_date_crea)VALUES ('" $this->R_DASHBOARD . "', '" $this->R_WORKSHOP . "', '" $this->R_PROJECT . "', '" $this->R_PUBLICATION . "', '" $this->R_NEWS . "', '" $this->R_YELLOWPAGES . "', '" $this->R_THEME . "', '" $this->R_SCALE . "', '" $this->R_LEVEL . "', '" $this->R_CATEGORY_USER . "', NOW());";
  216.     $last_id $sql_object->DBInsert ($q1);
  217.     return $last_id;
  218.   }
  219.  
  220.   /**
  221.    * user::GetUserWorkshops()
  222.    * Ajout d'un utilisateur à un ou plusieurs workshops
  223.    *
  224.    * @access public
  225.    * @param int $user_id identifiant du workshop
  226.    * @param array $workgroups workgroups ID
  227.    * @param string $user_right droit confié a l'utilisateur sur le workshop
  228.    * @param object $sql_object 
  229.    * @return integer $last_id
  230.    */
  231.   function GetUserWorkshops($user_id$sql_object)
  232.   {
  233.     if (is_numeric($user_id)) {
  234.       $this->ID = $user_id;
  235.     else return false;
  236.  
  237.     $q "SELECT jwu_workshop_id, workshop_denomination, jwu_user_right FROM ".J_WORK_USERS."
  238.               LEFT OUTER JOIN " T_WORK " ON jwu_workshop_id=workshop_id
  239.               WHERE jwu_user_id=".$this->ID.";";
  240.     $r $sql_object->DBSelect ($q);
  241.  
  242.     return $r;
  243.   }
  244.  
  245.   /**
  246.    * user::DeleteWorkshops()
  247.    * Remove all workshops for a given user
  248.    *
  249.    * @access public
  250.    * @param object $sql_object 
  251.    * @return integer $last_id
  252.    */
  253.   function DeleteWorkshops($user_id$user_right$sql_object)
  254.   {
  255.     if (is_numeric($user_id)) {
  256.       $this->ID = $user_id;
  257.     else return false;
  258.  
  259.     $q "DELETE FROM " J_WORK_USERS " WHERE jwu_user_id=" $this->ID . " AND jwu_user_right='".$user_right."';";
  260.     $r $sql_object->DBQuery ($q);
  261.  
  262.     return $r;
  263.   }
  264.  
  265.   /**
  266.    * user::AddWorkshops()
  267.    * Ajout d'un utilisateur à un ou plusieurs workshops
  268.    *
  269.    * @access public
  270.    * @param int $user_id identifiant du workshop
  271.    * @param array $workgroups workgroups ID
  272.    * @param string $user_right droit confié a l'utilisateur sur le workshop
  273.    * @param object $sql_object 
  274.    * @return integer $last_id
  275.    */
  276.   function AddWorkshops($user_id$workgroups$user_right $sql_object)
  277.   {
  278.     if (is_numeric($user_id)) {
  279.       $this->ID = $user_id;
  280.     else return false;
  281.  
  282.     if(count($workgroups)==0return true;
  283.  
  284.     for ($i 0;$i count($workgroups);$i++{
  285.       $q "INSERT INTO " J_WORK_USERS " (jwu_workshop_id, jwu_user_id, jwu_user_right) VALUES(" $workgroups[$i", " $this->ID . ",'" $user_right "');";
  286.       $last_id $sql_object->DBInsert ($q1);
  287.     }
  288.  
  289.     return $last_id;
  290.   }
  291.  
  292.   /**
  293.    * user::ModifiyWorkshops()
  294.    * Update workgroups for a given user
  295.    *
  296.    * @access public
  297.    * @param int $user_id identifiant du workshop
  298.    * @param array $workgroups workgroups to add
  299.    * @param string $user_right droit confié a l'utilisateur sur le workshop
  300.    * @param object $sql_object 
  301.    * @return integer $r
  302.    */
  303.   function ModifiyWorkshops($user_id$workgroups$user_right $sql_object)
  304.   {
  305.     if (is_numeric($user_id)) {
  306.       $this->ID = $user_id;
  307.     else return false;
  308.  
  309.     if($this->DeleteWorkshops($this->ID$user_right$sql_object)) {
  310.       $r $this->AddWorkshops($this->ID$workgroups$user_right$sql_object);
  311.     }
  312.  
  313.     return $r;
  314.   }
  315.  
  316.   /**
  317.    * user::generateNewPasskey()
  318.    * creation aleatoire d'un passkey
  319.    *
  320.    * @access public
  321.    * @param string $user_id 
  322.    * @param object $sql_object 
  323.    * @return string $password
  324.    */
  325.   function generateNewPasskey($user_id$sql_object)
  326.   {
  327.     $this->PASSKEY $this->GetNewPassword(30);
  328.     $q "UPDATE " $this->TDB_USER . " SET user_forget_passkey='" $this->PASSKEY "' WHERE user_id='" $user_id "';";
  329.  
  330.     $r $sql_object->DBQuery ($q);
  331.     if($rreturn $this->PASSKEY;
  332.     else return false;
  333.   }
  334.  
  335.   /**
  336.    * user::resetPasskey()
  337.    * creation aleatoire d'un passkey
  338.    *
  339.    * @access public
  340.    * @param string $user_id 
  341.    * @param object $sql_object 
  342.    * @return string $password
  343.    */
  344.   function resetPasskey($user_id$sql_object)
  345.   {
  346.     $q "UPDATE " $this->TDB_USER . " SET user_forget_passkey='' WHERE user_id='" $user_id "';";
  347.  
  348.     $r $sql_object->DBQuery ($q);
  349.     return $r;
  350.   }
  351.  
  352.   /**
  353.    * user::GetNewPassword()
  354.    * creation aleatoire d'un password
  355.    *
  356.    * @access public
  357.    * @param int $length taille du password
  358.    * @return string $password
  359.    */
  360.   function GetNewPassword($length PASSWD_LENGTH)
  361.   {
  362.     $str 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  363.     $password '';
  364.     for ($i 0$i $length$i++{
  365.       $password .= substr($strrand(0strlen($str1)1);
  366.     }
  367.     return $password;
  368.   }
  369.  
  370.   /**
  371.    * user::InitUserRight()
  372.    * formatage du tableau de droit suivant profil prédeterminé
  373.    *
  374.    * @access public
  375.    * @param string $type niveau utilisateur : SIMPLE_USER ou ADMIN_USER
  376.    * @return array $table_right : tableau des droits de l'utilisateur
  377.    */
  378.   function InitUserRight($type 'SIMPLE_USER')
  379.   {
  380.     $table_user array ("dashboard" => 'U'"workshop" => 'U'"publication" => 'U'"project" => 'U',
  381.             "news" => 'U'"yellowpages" => 'U'"theme" => 'U',
  382.             "scale" => 'U'"level" => 'U'"category_user" => 'U');
  383.  
  384.     switch ($type{
  385.       case 'SIMPLE_USER':
  386.         $table_right $table_user;
  387.         break;
  388.       case 'ADMIN_USER':
  389.         $table_right array ("dashboard" => 'A'"workshop" => 'A'"publication" => 'A',
  390.                     "project" => 'A'"news" => 'A'"yellowpages" => 'A',
  391.                     "theme" => 'A'"scale" => 'A'"level" => 'A',
  392.                     "category_user" => 'A');
  393.         break;
  394.       default:
  395.         $table_right $table_user;
  396.         break;
  397.     }
  398.  
  399.     return $table_right;
  400.   }
  401.  
  402.  
  403.   /**
  404.    * user::UpdateUserPassword()
  405.    * changement de password (mise à jour) dans la bdd
  406.    *
  407.    * @access public
  408.    * @param int $ID identifiant utilisateur
  409.    * @param string $pass nouveau password non crypté
  410.    * @param object $sql_object 
  411.    * @return bool $result
  412.    */
  413.   function UpdateUserPassword($ID$pass$sql_object)
  414.   {
  415.     if (is_numeric($ID)) {
  416.       $this->ID = $ID;
  417.     else exit;
  418.     $this->PASSWORD = crypt($passSALT_CRYPT);
  419.     $q "UPDATE " $this->TDB_USER . " SET user_password='" $this->PASSWORD . "' WHERE user_id='" $this->ID . "';";
  420.     $result $sql_object->DBQuery ($q);
  421.  
  422.     return $result;
  423.   }
  424.  
  425.   /**
  426.    * user::AddUser()
  427.    * Ajout d'un utilisateur
  428.    *
  429.    * @access public
  430.    * @param array $table_user contient les composants de l'utilisateur
  431.    * @param array $table_right contient les droits attribués au nouvel utilisateur
  432.    * @param object $sql_object 
  433.    * @return integer $last_id
  434.    *  renvoie un message d'erreur ou un numerique id de l'insertion
  435.    */
  436.   function AddUser($table_user$table_right$sql_object)
  437.   {
  438.     $table_user=$sql_object->DBescape($table_user);
  439.  
  440.     $this->LOGIN = strip_input(trim($table_user[0]));
  441.     $this->P_EMAIL = strtolower($table_user[1]);
  442.     $this->P_EMAIL_DISPLAY = $table_user[2];
  443.     $this->PASSWORD = crypt($table_user[3]SALT_CRYPT);
  444.     $this->_SetUserCategory($table_right);
  445.     $this->PROFILE = $this->_AddProfile($sql_object);
  446.     $this->RIGHT = $this->_AddRight($table_right$sql_object);
  447.     $q "INSERT INTO " $this->TDB_USER . " (user_login, user_password, user_community, user_category, user_rights, user_profile, user_date_crea) VALUES ('" $this->LOGIN . "', '" $this->PASSWORD . "', " $this->COMMUNITY . ", " $this->CATEGORY . ", " $this->RIGHT . ", " $this->PROFILE . ", NOW());";
  448.  
  449.     $res $sql_object->DBInsert ($q1);
  450.  
  451.     if($res && (defined('NEWSLETTER_AUTO_SUB'&& NEWSLETTER_AUTO_SUB == 1)) {
  452.       include_once('../class/class.newsletter.php');
  453.       $newsletter new newsletter;
  454.       $newsletter->AddEmail($this->P_EMAIL$sql_object);
  455.     }
  456.  
  457.     return $res;
  458.   }
  459.  
  460.   /**
  461.    * user::DeleteUser()
  462.    * suppression d'un utilisateur
  463.    *
  464.    * @access public
  465.    * @param int $ID identifiant de l'utilisateur
  466.    * @param object $sql_object 
  467.    * @return bool $result
  468.    */
  469.   function DeleteUser($ID$sql_object)
  470.   {
  471.     if (is_numeric($ID)) {
  472.       $this->ID = $ID;
  473.     else return false;
  474.     $q "UPDATE " $this->TDB_USER . " SET user_validity='N' WHERE user_id=" $this->ID . ";";
  475.     $result $sql_object->DBQuery ($q);
  476.     $q "DELETE FROM " J_WORK_USERS " WHERE jwu_user_id=" $this->ID . ";";
  477.     $res $sql_object->DBQuery ($q);
  478.  
  479.     return $res;
  480.   }
  481.  
  482.   /**
  483.    * user::ModifyProfile()
  484.    * modification d'un profil utilisateur
  485.    *
  486.    * @access public
  487.    * @param int $id identifiant d'un profil
  488.    * @param object $sql_object 
  489.    * @param array $table_profile contient les composants d'un profil
  490.    * @return bool $result
  491.    */
  492.   function ModifyProfile($ID$table_profile$sql_object)
  493.   {
  494.     $table_profile=$sql_object->DBescape($table_profile);
  495.  
  496.     if (is_numeric($ID)) {
  497.       $this->ID = $ID;
  498.     else return false;
  499.  
  500.     $this->P_EMAIL = strtolower($table_profile[0]);
  501.  
  502.     $q "UPDATE " $this->TDB_USER . " SET user_last_modify=NOW() WHERE user_id='" $this->ID . "';";
  503.     $result $sql_object->DBSelect ($q);
  504.  
  505.     $q "SELECT user_profile FROM " $this->TDB_USER . " WHERE user_id='" $this->ID . "' LIMIT 1;";
  506.     $data $sql_object->DBSelect ($q'OBJECT');
  507.     if ($data!=&& count($data== 1{
  508.       $this->P_ID = $data[0]->user_profile;
  509.     else return false;
  510.     $this->P_EMAIL_DISPLAY = strtoupper($table_profile[1]);
  511.     $this->P_CITY = strip_input(ucfirst(trim($table_profile[2])));
  512.     $this->P_BIRTHDATE = ($table_profile[3]=='--''0001-01-01' formatDate($table_profile[3]true);
  513.     $this->P_LEISURES = strip_input(trim($table_profile[4]));
  514.     $this->P_JOB = strip_input(trim($table_profile[5]));
  515.     $this->P_QUOTATION = strip_input(trim($table_profile[6]));
  516.     $this->P_SIGNATURE = strip_input(trim($table_profile[7]));
  517.     $this->P_AVATAR = strip_input($table_profile[8]);
  518.  
  519.     $q "UPDATE " T_PROFILE " SET profile_email='" $this->P_EMAIL . "', profile_email_display='" $this->P_EMAIL_DISPLAY . "', profile_city='" $this->P_CITY . "', profile_birthdate='" $this->P_BIRTHDATE . "', profile_leisures='" $this->P_LEISURES . "', profile_job='" $this->P_JOB . "', profile_quotation='" $this->P_QUOTATION . "', profile_signature='" $this->P_SIGNATURE . "', profile_avatar='" $this->P_AVATAR . "' WHERE profile_id='" $this->P_ID . "';";
  520.  
  521.     $result $sql_object->DBQuery ($q);
  522.  
  523.     return $result;
  524.   }
  525.  
  526.   /**
  527.    * user::ModifyRight()
  528.    * modification des droits d'un utilisateur
  529.    *
  530.    * @access public
  531.    * @param int $ID identifiant de l'utilisateur
  532.    * @param object $sql_object 
  533.    * @param array $table_right contient un tableau associatif de droit
  534.    * @return bool $result
  535.    */
  536.   function ModifyRight($ID$table_right$sql_object)
  537.   {
  538.     if (is_numeric($ID)) {
  539.       $this->ID = $ID;
  540.     else return false;
  541.  
  542.     $update '';
  543.     $sep ', ';
  544.     if (isset($table_right['dashboard'])) {
  545.       $this->R_DASHBOARD = $table_right['dashboard'];
  546.       $update .= "rights_dashboard='" $this->R_DASHBOARD . "'";
  547.     }
  548.     if (isset($table_right['project'])) {
  549.       $this->R_PROJECT = $table_right['project'];
  550.       $update .= $sep "rights_project='" $this->R_PROJECT . "'";
  551.     }
  552.     if (isset($table_right['publication'])) {
  553.       $this->R_PUBLICATION = $table_right['publication'];
  554.       $update .= $sep "rights_publication='" $this->R_PUBLICATION . "'";
  555.     }
  556.     if (isset($table_right['workshop'])) {
  557.       $this->R_WORKSHOP = $table_right['workshop'];
  558.       $update .= $sep "rights_workshop='" $this->R_WORKSHOP . "'";
  559.     }
  560.     if (isset($table_right['news'])) {
  561.       $this->R_NEWS = $table_right['news'];
  562.       $update .= $sep "rights_news='" $this->R_NEWS . "'";
  563.     }
  564.     if (isset($table_right['yellowpages'])) {
  565.       $this->R_YELLOWPAGES = $table_right['yellowpages'];
  566.       $update .= $sep "rights_yellowpages='" $this->R_YELLOWPAGES . "'";
  567.     }
  568.     if (isset($table_right['theme'])) {
  569.       $this->R_THEME = $table_right['theme'];
  570.       $update .= $sep "rights_theme='" $this->R_THEME . "'";
  571.     }
  572.     if (isset($table_right['scale'])) {
  573.       $this->R_SCALE = $table_right['scale'];
  574.       $update .= $sep "rights_scale='" $this->R_SCALE . "'";
  575.     }
  576.     if (isset($table_right['level'])) {
  577.       $this->R_LEVEL = $table_right['level'];
  578.       $update .= $sep "rights_level='" $this->R_LEVEL . "'";
  579.     }
  580.     if (isset($table_right['category_user'])) {
  581.       $this->R_CATEGORY_USER = $table_right['category_user'];
  582.       $update .= $sep "rights_category_user='" $this->R_CATEGORY_USER . "'";
  583.     }
  584.  
  585.     $q "UPDATE " $this->TDB_USER . " SET user_last_modify=NOW() WHERE user_id='" $this->ID . "';";
  586.     $result $sql_object->DBSelect ($q);
  587.     $q "SELECT user_rights FROM " $this->TDB_USER . " WHERE user_id='" $this->ID . "';";
  588.     $result $sql_object->DBSelect ($q);
  589.  
  590.     if ($result == 0return false;
  591.     if (count($result== 1{
  592.       $this->R_ID = $result[0]['user_rights'];
  593.     else return false;
  594.     $q "UPDATE " T_RIGHT " SET " $update " WHERE rights_id='" $this->R_ID . "';";
  595.     $result $sql_object->DBQuery ($q);
  596.  
  597.     if ($result{
  598.       $this->_SetUserCategory($table_right);
  599.       $q "UPDATE " $this->TDB_USER . " SET user_category='" $this->CATEGORY . "' WHERE user_id='" $this->ID . "';";
  600.  
  601.       $result $sql_object->DBQuery ($q);
  602.     }
  603.     return $result;
  604.   }
  605.  
  606.  
  607. }
  608.  
  609. ?>

Documentation generated on Fri, 01 Apr 2011 09:29:37 +0200 by phpDocumentor 1.4.1