Changeset 836 in ExiteCMS for modules/common/gallery/php-files/modules/gallery/classes/ExiteCMS/User.php
- Timestamp:
- 09/23/07 23:49:33 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/common/gallery/php-files/modules/gallery/classes/ExiteCMS/User.php
r833 r836 21 21 */ 22 22 23 /* This class is written for phpBB2 and provides full integration of the phpbbusers database23 /* This class is written for ExiteCMS and provides full integration of the users database 24 24 * Instead of using or duplicating memberships manually in Gallery. 25 25 * 26 * Gallery <-> phpBB2 integration ver. (www.snailsource.com)27 * Written by Martin Smallridge <info@snailsource.com>26 * Gallery <-> ExiteCMS integration 27 * Written by Harro 'WanWizard' Verton <wanwizard@gmail.com> 28 28 * 29 * This file was modified for official integration into Gallery 1.4.3 by30 * Jens Tkotz31 29 */ 32 30 33 class phpbb_User extends Abstract_User {31 class ExiteCMS_User extends Abstract_User { 34 32 var $db; 35 33 36 function phpbb_User() {37 global $gallery , $userdata;38 $this->db = $gallery->database{" phpbb"};34 function ExiteCMS_User() { 35 global $gallery; 36 $this->db = $gallery->database{"ExiteCMS"}; 39 37 } 40 38 41 39 function loadByUid($uid) { 42 global $userdata, $table_prefix; 43 $sql = "SELECT username, user_email FROM ".$table_prefix."users WHERE user_id='$uid'"; 44 $results = $this->db->query($sql); 45 $row = $this->db->fetch_row($results); 46 $this->username = $row[0]; 47 $this->fullname = $row[0]; 48 $this->email = $row[1]; 49 $this->uid = $uid; 50 51 if ($userdata['user_level'] == '1') { 52 $this->isAdmin = 1; 53 $this->canCreateAlbums = 1; 40 global $db_prefix; 41 if ($row = dbarray(dbquery("SELECT user_name, user_fullname, user_email FROM ".$db_prefix."users WHERE user_id='$uid'"))) { 42 $this->username = $row['user_name']; 43 $this->fullname = $row['user_fullname']; 44 $this->email = $row['user_email']; 45 $this->uid = $uid; 46 47 // WANWIZARD => Needs to be a group membership check 48 if (iSUPERADMIN) { 49 $this->isAdmin = 1; 50 $this->canCreateAlbums = 1; 51 } 52 } else { 53 $this->uid = -1; 54 54 } 55 55 } 56 56 57 57 function loadByUserName($uname) { 58 global $userdata, $table_prefix; 59 $results = $this->db->query("SELECT user_id, user_email FROM ".$table_prefix."users WHERE username='$uname'"); 60 $row = $this->db->fetch_row($results); 61 $this->uid = $row[0]; 62 $uid = $row[0]; 63 $this->fullname = $uname; 64 $this->email = $row[1]; 65 $this->username = $uname; 66 67 if ($userdata['user_level'] == '1') { 68 $this->isAdmin = 1; 69 $this->canCreateAlbums = 1; 58 global $db_prefix; 59 if ($row = dbarray(dbquery("SELECT user_id, user_fullname, user_email FROM ".$db_prefix."users WHERE user_name='$uname'"))) { 60 $this->uid = $row['user_id']; 61 $this->fullname = $row['user_fullname']; 62 $this->email = $row['user_email']; 63 $this->username = $uname; 64 65 // WANWIZARD => Needs to be a group membership check 66 if (iSUPERADMIN) { 67 $this->isAdmin = 1; 68 $this->canCreateAlbums = 1; 69 } 70 } else { 71 $this->uid = -1; 70 72 } 71 73 }
Note: See TracChangeset
for help on using the changeset viewer.
