Commit 48a103c5 authored by Daniel Carden's avatar Daniel Carden

Delete authorize.php

parent 0b566b98
Pipeline #520 canceled with stage
// include our OAuth2 Server object
function doAuth($output,$dbADO){
foreach($_GET as $key => $value) {
$urlArray[] = $key."=".$value;
$urlString = implode("&", $urlArray);
require_once __DIR__.'/server.php';
$request = OAuth2\Request::createFromGlobals();
$response = new OAuth2\Response();
// validate the authorize request
if (!$server->validateAuthorizeRequest($request, $response)) {
// display an authorization form
if (empty($_POST)) {
<h2>Welcome to the Linuxmce API! </h2>
Please login to authorize this<br>
app using you Linuxmce web admin credentials
<div id="login_form">
<form name="f1" method="post" action="index.php?section=authorizeApp'.$urlString.'" id="login_form">
<input type="hidden" name="state" value="'.$_GET['state'].' id="state" >
<input type="submit" name="login" value="Authorize" style="font-size:18px;" />
// print the authorization code if the user has authorized your client
$is_authorized = true; //($_POST['authorized'] === 'yes');
$server->handleAuthorizeRequest($request, $response, $is_authorized, $_SESSION['userID']);
if ($is_authorized) {
// this is only here so that you get to see your code in the cURL request. Otherwise, we'd redirect back to the client
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
echo("SUCCESS! Authorization Code: $code");
$output->setMenuTitle($TEXT_FILES_AND_MEDIA_CONST.' |');
$output->setTitle("Authorize External Application");
\ 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