Esempio n. 1
0
<?php

include 'editprofile.logic.php';
$userid = getCurrentUID();
if (isset($_GET["uid"])) {
    $userid = GETSafe("uid");
}
if (streq("0", $userid)) {
    $master->AddError("You must login to edit your profile!");
} else {
    $user = new Lan_users();
    if ($user->get($userid)) {
        $master->Smarty->assign("theuser", $user);
    } else {
        $master->AddError("Unknown user!");
    }
}
Esempio n. 2
0
<?php

if (isset($_GET["uid"])) {
    $user = new Lan_users();
    if ($user->get(GETSafe("uid"))) {
        $user->updateSteamData();
        $user->update();
        if (strlen($user->avatar) == 0) {
            $user->avatar = Config::$webPath . "images/other.png";
        }
        $master->Smarty->assign("steamdata", $user->getSteamData());
        $master->Smarty->assign("user", $user);
        //Find if attending this lan
        $attendance = new Lan_attendees();
        $attendance->user_id = $user->user_id;
        $attendance->lan_id = getCurrentLID();
        $master->Smarty->assign("attending", $attendance->count() != 0);
        //Get seat
        if ($attendance->count() != 0) {
            $seat = new lan_seats();
            $seat->user_id = $user->user_id;
            $seat->lan_id = getCurrentLID();
            $seat->find();
            if ($seat->fetch()) {
                $master->Smarty->assign("seat", $seat);
            }
        }
        //Find if arrived
        $arrivals = new Lan_arrivals();
        $arrivals->user_id = $user->user_id;
        $arrivals->lan_id = getCurrentLID();
Esempio n. 3
0
function startSession($id, $username)
{
    setCurrentUser($id);
    $_SESSION['username'] = $username;
    // Store User IP
    $user = new Lan_users();
    if (0 != $user->get($id)) {
        $user->ip = $_SERVER['REMOTE_ADDR'];
        $_SESSION['steamprofile'] = $user->steamprofile;
        $_SESSION['profilepic'] = $user->smallavatar;
        $user->update();
    }
    SetupGroups();
}