Ignore:
Timestamp:
09/23/07 23:49:33 (5 years ago)
Author:
hverton
Message:

changed copyright notice
added Smarty buttonlink function, to replace image buttons by real buttons using a locale for the button text

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/common/gallery/php-files/modules/gallery/classes/ExiteCMS/User.php

    r833 r836  
    2121 */ 
    2222 
    23 /* This class is written for phpBB2 and provides full integration of the phpbb users database 
     23/* This class is written for ExiteCMS and provides full integration of the users database 
    2424 * Instead of using or duplicating memberships manually in Gallery. 
    2525 * 
    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> 
    2828 * 
    29  * This file was modified for official integration into Gallery 1.4.3 by 
    30  * Jens Tkotz 
    3129*/ 
    3230 
    33 class phpbb_User extends Abstract_User { 
     31class ExiteCMS_User extends Abstract_User { 
    3432    var $db; 
    3533 
    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"}; 
    3937    } 
    4038 
    4139    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; 
    5454        } 
    5555    } 
    5656 
    5757    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; 
    7072        } 
    7173    } 
Note: See TracChangeset for help on using the changeset viewer.