We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit a15f17df authored by Jonas Haraldsson's avatar Jonas Haraldsson

identify client through api key

parent 5e8a578b
......@@ -22,6 +22,7 @@ require_once('../../config.php');
require_once($install_path . '/database.php');
require_once($install_path . '/templating.php');
require_once($install_path . '/data/Server.php');
require_once($install_path . '/data/clientcodes.php');
function displayError($error_msg) {
global $smarty;
......@@ -126,4 +127,7 @@ if (!isset($_REQUEST['api_key']) || !(isset($_REQUEST['cb']) || isset($_REQUEST[
}
}
$client = getClientData('null', $_REQUEST['api_key']);
$smarty->assign('clientname', $client['name']);
$smarty->assign('clienturl', $client['url']);
$smarty->display('api_auth.tpl');
......@@ -7,11 +7,11 @@
<p>Thank you very much {$username}. Your authorization has been recorded.</p>
<p>You may now close this page.</p>
{else}
<p>Uknown client with<br />
{if $stage == 'webapp1'}
URL: <b>{$cb}</b><br />
{if $clientname == 'Unknown client'}
<p><a href="{$clienturl}">{$clientname}</a> with API key: <b>{$api_key}</b><br />
{else}
<p><a href="{$clienturl}">{$clientname}</a>
{/if}
API key: <b>{$api_key}</b><br />
wants your permission to talk with this service.</p>
<form method="post" action="">
<p>Your Username: <input type="text" name="username" /></p>
......
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