Example #1
0
        } catch (Exception $ex) {
            header(' ', true, 500);
            echo 'Unable to reset password:'******'REQUEST_METHOD'] == "DELETE") {
    $id = Utility::getRequestVariable('id', 0);
    if ($id == 0) {
        header(' ', true, 400);
        echo "No user ID specified.";
        die;
    }
    // To do: what permissions are needed to delete a user?
    try {
        $class = new User($id, $tenantID);
        $class->deleteEntity($id, $userID, $tenantID);
    } catch (Exception $ex) {
        header(' ', true, 500);
        echo 'Unable to delete user:'******'{"result": "deleted"}';
    header('Content-Type: application/json');
    header('Access-Control-Allow-Origin: *');
    echo $set;
} else {
    header(' ', true, 400);
    echo "Unsupported HTTP method.";
    die;
}