Exemplo n.º 1
0
 /**
  * @see UserSession::__construct()
  */
 public function __construct($userID = null, $row = null, $username = null)
 {
     // user data
     $this->sqlSelects .= " lw_user.*, ";
     $this->sqlJoins .= " LEFT JOIN ugml" . LW_N . "_users\r\n\t\t\t\t\t\t\t\tAS lw_user\r\n\t\t\t\t\t\t\t\tON lw_user.id = user.userID ";
     // other selects
     $this->sqlSelects .= " lw_user.id AS lwUserID, ";
     parent::__construct($userID, $row, $username);
 }
Exemplo n.º 2
0
 /**
  * @see UserProfile::__construct()
  */
 public function __construct($userID = null, $row = null, $username = null, $email = null)
 {
     $this->sqlSelects .= ' lw_user.*, lw_stat.*, lw_user.password AS gamePassword, ';
     $this->sqlJoins .= ' LEFT JOIN ugml_users lw_user ON (lw_user.id = user.userID) ';
     $this->sqlJoins .= ' LEFT JOIN ugml_stat lw_stat ON (lw_stat.userID = user.userID) ';
     // new stats
     $this->sqlSelects .= " wot_stat.rank AS wotRank,\n\t\t\t\t\t\t\t\twot_stat.points AS wotPoints, ";
     $this->sqlJoins .= " LEFT JOIN ugml_stat_entry \n\t\t\t\t\t\t\t\tAS wot_stat\n\t\t\t\t\t\t\t\tON wot_stat.statTypeID = " . self::STAT_TYPE_ID . "\n\t\t\t\t\t\t\t\t\tAND wot_stat.relationalID = user.userID ";
     parent::__construct($userID, $row, $username, $email);
     $this->points = $this->wotPoints;
     $this->rank = $this->wotRank;
 }
    /**
     * Creates a new UserProfile object.
     * 
     * @see User::__construct()
     */
    public function __construct($userID = null, $row = null, $username = null, $email = null, $sqlSelects = '', $sqlJoins = '')
    {
        $this->sqlSelects .= $sqlSelects . "session.requestURI, session.requestMethod, session.ipAddress, session.userAgent,\n\t\t\t\t\t\trank.*, avatar.*,";
        $this->sqlJoins .= $sqlJoins . ' LEFT JOIN wcf' . WCF_N . '_avatar avatar ON (avatar.avatarID = user.avatarID) ' . ' LEFT JOIN wcf' . WCF_N . '_session session ON (session.userID = user.userID AND session.packageID = ' . PACKAGE_ID . ' AND session.lastActivityTime > ' . (TIME_NOW - USER_ONLINE_TIMEOUT) . ') ' . ' LEFT JOIN wcf' . WCF_N . '_user_rank rank ON (rank.rankID = user.rankID) ';
        if (WCF::getUser()->userID) {
            $this->sqlSelects .= 'hisWhitelist.userID AS buddy, hisBlacklist.userID AS ignoredUser,';
            $this->sqlJoins .= ' LEFT JOIN wcf' . WCF_N . '_user_whitelist hisWhitelist
							ON (hisWhitelist.userID = user.userID AND hisWhitelist.whiteUserID = ' . WCF::getUser()->userID . ' AND hisWhitelist.confirmed = 1) ' . ' LEFT JOIN wcf' . WCF_N . '_user_blacklist hisBlacklist
							ON (hisBlacklist.userID = user.userID AND hisBlacklist.blackUserID = ' . WCF::getUser()->userID . ') ';
        } else {
            $this->sqlSelects .= '0 AS buddy, 0 AS ignoredUser,';
        }
        parent::__construct($userID, $row, $username, $email);
    }
Exemplo n.º 4
0
 public function __construct($isAdmin = false, $timezone = 'America/New_York', $userId = 1)
 {
     parent::__construct($userId);
     $this->FirstName = 'first';
     $this->LastName = 'last';
     $this->Email = '*****@*****.**';
     $this->IsAdmin = $isAdmin;
     $this->Timezone = $timezone;
     $this->HomepageId = 1;
     $this->IsGroupAdmin = false;
     $this->IsResourceAdmin = true;
     $this->IsScheduleAdmin = false;
     $this->LanguageCode = 'en_US';
     $this->PublicId = 'public id';
     $this->ScheduleId = 19;
 }
Exemplo n.º 5
0
 /**
  * @see UserSession::__construct()
  */
 public function __construct($userID = null, $row = null, $username = null)
 {
     // user data
     $this->sqlSelects .= " wot_user.*, ";
     $this->sqlJoins .= " LEFT JOIN ugml" . LW_N . "_users\n\t\t\t\t\t\t\t\tAS wot_user\n\t\t\t\t\t\t\t\tON wot_user.id = user.userID ";
     // new stats
     $this->sqlSelects .= " wot_stat.rank AS wotRank,\n\t\t\t\t\t\t\t\twot_stat.points AS wotPoints, ";
     $this->sqlJoins .= " LEFT JOIN ugml_stat_entry \n\t\t\t\t\t\t\t\tAS wot_stat\n\t\t\t\t\t\t\t\tON wot_stat.statTypeID = " . self::STAT_TYPE_ID . "\n\t\t\t\t\t\t\t\t\tAND wot_stat.relationalID = user.userID ";
     // new stats 2
     $this->sqlSelects .= " GROUP_CONCAT(DISTINCT\n\t\t\t\t\t\t\t\t\tCONCAT(wot_stat2.statTypeID, ',', wot_stat2.rank, ',', wot_stat2.points)\n\t\t\t\t\t\t\t\t\tSEPARATOR ';')\n\t\t\t\t\t\t\t\tAS statStr,";
     $this->sqlJoins .= " LEFT JOIN ugml_stat_entry \n\t\t\t\t\t\t\t\tAS wot_stat2\n\t\t\t\t\t\t\t\tON wot_stat2.relationalID = user.userID ";
     // buddies
     $this->sqlSelects .= " CONCAT(\n\t\t\t\t\t\t\t\t\tCOALESCE(GROUP_CONCAT(DISTINCT wot_buddy1.owner SEPARATOR ','), ''),\n\t\t\t\t\t\t\t\t\t',',\n\t\t\t\t\t\t\t\t\tCOALESCE(GROUP_CONCAT(DISTINCT wot_buddy2.sender SEPARATOR ','), ''))\n\t\t\t\t\t\t\t\tAS buddy,";
     $this->sqlJoins .= " LEFT JOIN ugml_buddy\n\t\t\t\t\t\t\t\tAS wot_buddy1\n\t\t\t\t\t\t\t\tON wot_buddy1.sender = user.userID";
     $this->sqlJoins .= " LEFT JOIN ugml_buddy\n\t\t\t\t\t\t\t\tAS wot_buddy2\n\t\t\t\t\t\t\t\tON wot_buddy2.owner = user.userID";
     // settings
     $this->sqlSelects .= " GROUP_CONCAT(DISTINCT CONCAT(wot_setting.setting, ',', wot_setting.value) SEPARATOR '|') AS settingsStr,";
     $this->sqlJoins .= " LEFT JOIN ugml_user_setting\n\t\t\t\t\t\t\t\tAS wot_setting\n\t\t\t\t\t\t\t\tON user.userID = wot_setting.userID";
     // alliance
     $this->sqlSelects .= " wot_alliance.ally_tag AS allianceTag,\n\t\t\t\t\t\t\t\twot_alliance.ally_name AS allianceName,\n\t\t\t\t\t\t\t\twot_alliance.id AS allianceID,";
     $this->sqlJoins .= " LEFT JOIN ugml_alliance\n\t\t\t\t\t\t\t\tAS wot_alliance\n\t\t\t\t\t\t\t\tON wot_user.ally_id = wot_alliance.id";
     // other selects
     $this->sqlSelects .= " wot_user.id AS lwUserID, wot_user.current_planet AS actualPlanet, wot_user.banned AS wotBanned, ";
     parent::__construct($userID, $row, $username);
     $this->points = $this->wotPoints;
     $this->rank = $this->wotRank;
     // process settings
     $parts = explode('|', $this->settingsStr);
     foreach ($parts as $part) {
         if (!empty($part) && strpos($part, ',')) {
             list($setting, $value) = explode(',', $part);
             $this->settings[$setting] = $value;
         }
     }
     // process stats
     $parts = explode(';', $this->statStr);
     foreach ($parts as $part) {
         if (!empty($part) && strpos($part, ',')) {
             list($statTypeID, $rank, $points) = explode(',', $part);
             $this->stats[$statTypeID] = array('rank' => $rank, 'points' => $points);
         }
     }
     //$this->checkPlanetChange();
 }
Exemplo n.º 6
0
 /**
  * @see UserSession::__construct()
  */
 public function __construct($userID = null, $row = null, $username = null)
 {
     // user data
     $this->sqlSelects .= " lw_user.*, ";
     $this->sqlJoins .= " LEFT JOIN ugml" . LW_N . "_users\r\n\t\t\t\t\t\t\t\tAS lw_user\r\n\t\t\t\t\t\t\t\tON lw_user.id = user.userID ";
     // new stats
     $this->sqlSelects .= " wot_stat.rank AS wotRank,\r\n\t\t\t\t\t\t\t\twot_stat.points AS wotPoints, ";
     $this->sqlJoins .= " LEFT JOIN ugml_stat_entry \r\n\t\t\t\t\t\t\t\tAS wot_stat\r\n\t\t\t\t\t\t\t\tON wot_stat.statTypeID = " . self::STAT_TYPE_ID . "\r\n\t\t\t\t\t\t\t\t\tAND wot_stat.relationalID = user.userID ";
     // buddies
     $this->sqlSelects .= " CONCAT(\r\n\t\t\t\t\t\t\t\t\tCOALESCE(GROUP_CONCAT(DISTINCT wot_buddy1.owner SEPARATOR ','), ''),\r\n\t\t\t\t\t\t\t\t\t',',\r\n\t\t\t\t\t\t\t\t\tCOALESCE(GROUP_CONCAT(DISTINCT wot_buddy2.sender SEPARATOR ','), ''))\r\n\t\t\t\t\t\t\t\tAS buddy,";
     $this->sqlJoins .= " LEFT JOIN ugml_buddy\r\n\t\t\t\t\t\t\t\tAS wot_buddy1\r\n\t\t\t\t\t\t\t\tON wot_buddy1.sender = user.userID";
     $this->sqlJoins .= " LEFT JOIN ugml_buddy\r\n\t\t\t\t\t\t\t\tAS wot_buddy2\r\n\t\t\t\t\t\t\t\tON wot_buddy2.owner = user.userID";
     // other selects
     $this->sqlSelects .= " lw_user.id AS lwUserID, lw_user.current_planet AS actualPlanet, ";
     parent::__construct($userID, $row, $username);
     $this->points = $this->wotPoints;
     $this->rank = $this->wotRank;
     //$this->checkPlanetChange();
 }
Exemplo n.º 7
0
 public function __construct($id)
 {
     parent::__construct($id);
     $this->SessionToken = WebServiceSessionToken::Generate();
     $this->SessionExpiration = WebServiceExpiration::Create();
 }
Exemplo n.º 8
0
 public function __construct()
 {
     parent::__construct(0);
     $this->Timezone = Configuration::Instance()->GetDefaultTimezone();
 }