Exemplo n.º 1
0
        // list with order, index, count and where
        case "enumerate":
            $result = $users->enumerate();
            break;
            // list with where
        // list with where
        case "login":
            $result = $am->login($user, $pass, $sid);
            break;
        case "pwcheck":
            $result = $am->checkPassword($user, $pass);
            break;
            // just check pass, dont create session
        // just check pass, dont create session
        case "logout":
            $result = $am->logout();
            break;
        default:
            throw new Exception("userFunctions:: invalid operation: '{$operation}' provided");
    }
    if ($result === null) {
        throw new Exception($users->errormsg);
    }
    if ($result === "") {
        $response = array('success' => true, 'insert_id' => $users->conn->insert_id, 'affected_rows' => $users->conn->affected_rows);
    } else {
        $response = $result;
    }
} catch (Exception $e) {
    do_log($e->getMessage());
    $response = array('errorMsg' => $e->getMessage());
Exemplo n.º 2
0
<?php

require_once 'AjaxTools.php';
AuthManager::logout();
json_success('OK');