コード例 #1
0
ファイル: logons.php プロジェクト: progervlad/utils
require_once $_SERVER["DOCUMENT_ROOT"] . "/subs.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/conf.inc.php";
$db = new DBLayer($CNF["db_host"], $CNF["db_user"], $CNF["db_pass"], $CNF["db_name"]);
$db->query("SET NAMES utf8");
$action = checkRequest("action");
$domain = checkRequest("domain");
$username = checkRequest("username");
$user_id = getUserByUsername($username)['uid'];
if ($user_id < 1) {
    $user_id = createUser($username);
}
$workstation = mb_strtolower(checkRequest("workstation"), "UTF-8");
$ip = trim(checkRequest("ip"));
$workstation_id = strlen($workstation) > 0 ? checkWorkstation($workstation, $ip) : null;
switch ($action) {
    case "start":
        logonWorkstation($workstation_id, $ip);
        break;
    case "shutdown":
        echo "ws: {$workstation_id}, IP: {$ip}";
        logoffWorkstation($workstation_id);
        break;
    case "logon":
        echo $workstation_id;
        logonWorkstation($workstation_id, $ip);
        logonUser($user_id, $domain, $workstation_id);
        break;
    case "logoff":
        logoffUser($user_id);
        break;
}
コード例 #2
0
ファイル: request.php プロジェクト: jorgalga/AgoraTable
<?php

require_once "includes/conf.php";
header('Content-type: text/xml');
header("Cache-Control: no-cache, must-revalidate");
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
if (isset($_REQUEST["cmd"])) {
    switch ($_REQUEST["cmd"]) {
        case 'getStrings':
            getStrings();
            break;
        case 'getData':
            getData();
            break;
        case 'logonUser':
            logonUser();
            break;
        case 'registerUser':
            registerUser();
            break;
        case 'addUserPhoto':
            addUserPhoto();
            break;
        case 'getUser':
            getUser();
            break;
        case 'beginSession':
            beginSession();
            break;
        case 'getSession':
            getSession();