From: <jhe...@us...> - 2002-08-08 13:50:20
|
Update of /cvsroot/upcase-project/UpCase/lib In directory usw-pr-cvs1:/tmp/cvs-serv1193 Modified Files: uc_accounts.php Log Message: added methods to UcUser to set user's first name, last name and email Index: uc_accounts.php =================================================================== RCS file: /cvsroot/upcase-project/UpCase/lib/uc_accounts.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** uc_accounts.php 5 Aug 2002 08:15:24 -0000 1.3 --- uc_accounts.php 8 Aug 2002 13:50:17 -0000 1.4 *************** *** 11,14 **** --- 11,17 ---- var $groups; var $db; + var $firstName; + var $lastName; + var $email; function UcUser() *************** *** 83,86 **** --- 86,115 ---- } + function setFirstName($name) + { + global $ucsql_userfirstname; + $query = sprintf($ucsql_userfirstname, $name, $this->uid); + $this->db->Execute($query) or die("Unable to set user's first name: " + . $this->db->ErrorMsg()); + $this->firstName = $name; + } + + function setLastName($name) + { + global $ucsql_userlastname; + $query = sprintf($ucsql_userlastname, $name, $this->uid); + $this->db->Execute($query) or die("Unable to set user's last name : " + . $this->db->ErrorMsg()); + $this->lastName = $name; + } + + function setEmail($email) + { + global $ucsql_useremail; + $query = sprintf($ucsql_useremail, $email, $this->uid); + $this->db->Execute($query) or die("Unable to set user's email: " + . $this->db->ErrorMsg()); + $this->email = $email; + } } *************** *** 111,114 **** --- 140,146 ---- $user->lang = $o->PREFERRED_LANG; $user->groups = $user->getSecondaryGroups(); + $user->firstName = $o->FIRSTNAME; + $user->lastName = $o->LASTNAME; + $user->email = $o->EMAIL; return $user; |