Commit f6f21c20 authored by Daniel Carden's avatar Daniel Carden

Add new file

parent 75bdbb8c
Pipeline #525 failed with stage
function doAuth($output,$dbADO) {
// include our OAuth2 Server object
$request = OAuth2\Request::createFromGlobals();
$response = new OAuth2\Response();
// validate the authorize request
if (!$server->validateAuthorizeRequest($request, $response)) {
if ($_SESSION['userLoggedIn']==true && !isset($_POST['authorisation_form'])) {
// display an authorization form
$form = '<form name="authform" id="authform" method="post" >
<label>Do You Authorize '.$_GET['client_id'].'?</label><br />
<input type="hidden" id="authorisation_form" name="authorisation_form" value="yes">
<input type="submit" name="authorized" value="yes">
<input type="submit" name="authorized" value="no">
} elseif ($_SESSION['userLoggedIn']==true && $_POST['authorized'] === 'yes'){
// print the authorization code if the user has authorized your client
$is_authorized = ($_POST['authorized'] === 'yes');
$server->handleAuthorizeRequest($request, $response, $is_authorized, $_SESSION['userID']);
} else {
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment