Example #1
1
	        <tr><td><?php 
            print $_lang[TicketsPriority];
            ?>
:</td><td><?php 
            GetPrioritySelect($priority);
            ?>
</td></tr>
	        <tr><td valign=top><?php 
            print $_lang[TicketsTicketTypeMsg];
            ?>
:</td><td><textarea class=ticketsTextArea name=message cols=80 rows=12><?php 
            print $message;
            ?>
</textarea></td></tr>
		<?php 
            $user = GetUserById($_SESSION["userId"]);
            if (GetSetting("smsGateway") and GetSetting("smsUserTicketReply") and $user->mobile) {
                ?>
<tr><td></td><td><input type=checkbox name=sendsms value=1 class=input> <?php 
                print $_lang[TicketsSendSMS];
                ?>
</td></tr><?php 
            }
            if (GetSetting("ticketsUsersCanAttach")) {
                ?>
        		<tr><td colspan=2 align=center onclick="myShow('s1');" onmouseover="this.style.cursor='pointer'" class=<?php 
                print $font_head;
                ?>
><B><?php 
                print $_lang[TicketsAttachFiles];
                ?>
function UpdateUser()
{
    $user = GetUserById($_GET['id']);
    if (isset($_POST['is_admin']) && isset($_POST['is_banned'])) {
        $userArray = array('id' => $user->id, 'is_admin' => $_POST['is_admin'], 'is_banned' => $_POST['is_banned']);
        $result = ModelFacade::UpdateUser($userArray);
        switch ($result[0]) {
            case 0:
                $success = 'User ' . $user->username . ' updated successfully';
                break;
            default:
                $error = 'There was an error updating the users database';
                break;
        }
        $user = GetUserById($_GET['id']);
        include_once '/Views/Admin/User.html';
    } else {
        header("Location: /AdminUsers.php");
    }
}
Example #3
0
<?php

/**
* Created by PhpStorm.
* User: Hoan
* Date: 10/17/2015
* Time: 11:49 PM
Trang chỉnh sửa thành viên.
*/
session_start();
if (!isset($_SESSION['user'])) {
    header('location:login.php');
}
//Add các file cần thiết
require '../../configs/config.php';
require '../../libraries/connect.php';
require '../../models/user.php';
$user_id = $_GET['user_id'];
if ($_POST) {
    $data = array('username' => $_POST['username'], 'password' => empty($_POST['password']) ? null : $_POST['password'], 'fullname' => $_POST['fullname'], 'email' => $_POST['email'], 'status' => isset($_POST['status']) ? 1 : 0, 'modified' => date('Y-m-d H:i:s'));
    if (EditUser($data, $user_id) == 1) {
        echo "thanh cong";
        $_SESSION['success'] = true;
        //làm mới lại trang
        header('location:edit.php?user_id=' . $user_id);
    } else {
        echo "Cap nhat khong thanh cong";
    }
}
$user = GetUserById($user_id);
require '../../views/admin/user/v_edit.php';
Example #4
0
        }
        if ($userRank == -1) {
            DieError(-3);
        }
        //banned
        //TODO: implement these things
        $pp = 0;
        //TODO: implement pp
        $globalRank = 0;
        $totalScore = GetTotalScoreFromId($user['id']);
        $accuracy = GetAccuracyFromId($user['id']);
        $playCount = GetPlaycountFromId($user['id']);
        //5,000 / 3 * (4n^3 - 3n^2 - n) + 1.25 * 1.8^(n - 60)
        $experience = 0;
        //$totalscore;	//actually, nvm
        $toprint = array_merge(CreatePacket(92, 0), CreatePacket(5, $userId), CreatePacket(75, $protocolVersion), CreatePacket(71, $userRank), CreatePacket(72, array(1, 2)), CreatePacket(83, array('id' => $userId, 'playerName' => $userName, 'utcOffset' => 0 + 24, 'country' => 0, 'playerRank' => $userRank, 'longitude' => 0, 'latitude' => 0, 'globalRank' => $globalRank)), CreatePacket(11, array('id' => $userId, 'bStatus' => 0, 'string0' => '', 'string1' => '', 'mods' => 0, 'playmode' => 0, 'int0' => 0, 'score' => $totalScore, 'accuracy' => $accuracy, 'playcount' => $playCount, 'experience' => $experience, 'int1' => $globalRank, 'pp' => $pp)), CreatePacket(83, array('id' => 3, 'playerName' => GetUserById(3)['username'], 'utcOffset' => 0 + 24, 'country' => 1, 'playerRank' => 0, 'longitude' => 0, 'latitude' => 0, 'globalRank' => 0)), CreatePacket(96, array(0, $userId)), CreatePacket(89, null), CreatePacket(64, '#osu'), CreatePacket(64, '#news'), CreatePacket(65, array('#osu', 'Main channel', 2147483647 - 1)), CreatePacket(65, array('#news', 'This will contain announcements and info, while beta lasts.', 1)), CreatePacket(65, array('#kfc', 'Kawaii friends club', 0)), CreatePacket(65, array('#aqn', 'cuz f**k yeah', 1337)), CreatePacket(07, array('BanchoBob', 'This is a test message! First step to getting chat working!', '#osu', 3)));
    }
} else {
    //Get shit from database i guess
    $userId = 1;
    $userName = "******";
    $userRank = 15;
    $globalRank = 1;
    //TODO: implement other packets
    //TODO: create packets where currenttime-lastlogintime < 60?
    $toprint = array_merge(CreatePacket(83, array('id' => $userId, 'playerName' => $userName, 'utcOffset' => 0 + 24, 'country' => 0, 'playerRank' => $userRank, 'longitude' => 0, 'latitude' => 0, 'globalRank' => $globalRank)));
}
SetLastActiveForId($userId);
echo implode(array_map("chr", $toprint));
function GetOnlinePlayersPackets()
{
Example #5
-1
function CheckPassword($id, $hashed)
{
    $user = GetUserById($id);
    return CheckUserPassword($user, $hashed);
}