Esempio n. 1
0
/* START CALLING NECESSARY CLASSES */
$operation = new Operations($hostname, $username, $password, $dbname);
/* END CALLING NECESSARY CLASSES */
/* START GET WHAT TO DO */
if (isset($_GET['function'])) {
    switch ($_GET['function']) {
        case "get_auth":
            if (isset($_GET['password'])) {
                echo $operation->get_auth($_GET['password']);
            } else {
                exit($operation->encode_output(array('status' => 0, 'message' => "Lack of parameters!", 'data' => NULL)));
            }
            break;
        case "add_auth":
            if (isset($_GET['password'])) {
                echo $operation->add_auth($_GET['password']);
            } else {
                exit($operation->encode_output(array('status' => 0, 'message' => "Lack of parameters!", 'data' => NULL)));
            }
            break;
        case "del_auth":
            if (isset($_GET['password'])) {
                echo $operation->del_auth($_GET['password']);
            } else {
                exit($operation->encode_output(array('status' => 0, 'message' => "Lack of parameters!", 'data' => NULL)));
            }
            break;
        case "add_room":
            if (isset($_GET['rooms_name'])) {
                if (isset($_GET['rooms_port'])) {
                    if (isset($_GET['rooms_status'])) {