public static function get_user($username, $password)
 {
     return DAL::getUser($username, $password);
 }
예제 #2
0
 public static function getUser($username, $pwd)
 {
     $pwd_hash = hash("md5", $pwd);
     return DAL::getUser($username, $pwd_hash);
 }
예제 #3
0
<?php

if (array_key_exists('callback', $_REQUEST)) {
    $callback = $_REQUEST['callback'];
} else {
    die('Missing parameters');
}
include 'dal.php';
if (array_key_exists('userId', $_REQUEST)) {
    $userId = $_REQUEST['userId'];
}
header('Content-type: application/x-javascript; charset=utf-8');
$dal = new DAL();
if (isset($userId)) {
    $result = $dal->getUser($userId);
} else {
    $result = $dal->getUsers();
}
echo sprintf("%s(%s)", $callback, json_encode($result));