Ejemplo n.º 1
0
Archivo: read.php Proyecto: riidt/rest
<?php

if (!defined('REST')) {
    exit('Access Denied');
}
include_once "class_pwd.php";
include_once "config_common.php";
include_once "config_sql.php";
include_once "class_response.php";
$restID = $_POST["rest_id"];
$restKey = $_POST["rest_key"];
$restName = $_POST["rest_name"];
if (!authorize($restID, $restKey, $restName)) {
    $response = new Response();
    $response->status = 0;
    $response->msg = "authorize failed";
} else {
    $pwd = new PWD();
    $response = $pwd->get();
}
echo $response;
Ejemplo n.º 2
0
Archivo: write.php Proyecto: riidt/rest
<?php

if (!defined('REST')) {
    exit('Access Denied');
}
include_once "class_pwd.php";
include_once "config_common.php";
include_once "config_sql.php";
include_once "class_response.php";
$restID = $_POST["rest_id"];
$restKey = $_POST["rest_key"];
$restName = $_POST["rest_name"];
$content = $_POST["content"];
if (!authorize($restID, $restKey, $restName)) {
    $response = new Response();
    $response->status = 0;
    $response->msg = "authorize failed";
} else {
    $pwd = new PWD();
    $response = $pwd->put($content);
}
echo $response;