Commit 833dcac7 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Added JSON error response; removed beta version logo

parent 401641ea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ clients:
    id: aao-dev
    secret: 2a97516c354b68848cdbd8f54a226a0a55b21ed138e207ad6c5cbb9c00aa5aea
    redirect: http://localhost:8081/aao/login
    scope: "openid read:userspace write:userspace read:fileserver write:fileserver read:gms"
    scope: "openid read:userspace write:userspace read:fileserver write:fileserver read:gms read:rap"
    home: http://localhost:8081/aao
    icon: asiago.gif
    showInHome: true
+0 −3
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@
            <div class="page-title-wrapper">
                <h1 class="text-center">
                    <a href="<?php echo $contextRoot; ?>/">Remote Authentication Portal</a>
                    <span class="circle-wrapper">
                        <div class="circle">beta<br/>version!</div>
                    </span>
                </h1>
            </div>
        </header>
+17 −6
Original line number Diff line number Diff line
@@ -52,12 +52,23 @@ Flight::map('error', function($ex) {
        }
    }

    $headers = apache_request_headers();
    $useJson = false;
    if (array_key_exists('Accept', $headers)) {
        $accept = $headers['Accept'];
        $useJson = ($accept === 'application/json' || $accept === 'text/json');
    }

    if ($useJson) {
        echo json_encode(["error" => $message]);
    } else {
        global $locator;
        Flight::render('error.php', array('title' => 'Error',
            'version' => $locator->getVersion(), 'error' => $message,
            'contactEmail' => isset($locator->config->contactEmail) ? $locator->config->contactEmail : null,
            'contactLabel' => isset($locator->config->contactLabel) ? $locator->config->contactLabel : null,
            'contextRoot' => $locator->config->contextRoot));
    }
});

// Starting Flight framework