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

Commit 76b41d88 authored by Mike Sheldon's avatar Mike Sheldon

Merge foreign service callback into user connections page

parent 98dcd27e
......@@ -19,13 +19,22 @@
*/
require_once('database.php');
require_once('templating.php');
require_once('data/sanitize.php');
require_once('data/Server.php');
require_once('user-menu.php');
require_once('data/User.php');
require_once('data/TagCloud.php');
if($logged_in == false)
{
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Not logged in! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
}
if($_GET['token'] && $_GET['webservice_url'] && $logged_in == true) {
// Handle authentication callback from a foreign service
$token = $_GET['token'];
$webservice_url = $_GET['webservice_url'];
$sig = md5('api_key' . $lastfm_key . 'methodauth.getSession' . 'token' . $token . $lastfm_secret);
......@@ -61,14 +70,16 @@ if($_GET['token'] && $_GET['webservice_url'] && $logged_in == true) {
. $adodb->qstr($remote_key) . ', '
. $adodb->qstr($remote_username) . ')');
$smarty->assign('pageheading', 'Account connected');
$smarty->display('account-connected.tpl');
$smarty->assign('connection_added', true);
}
} else {
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'Sorry, we weren\'t able to authenticate your account.');
$smarty->display('error.tpl');
die();
if(isset($lastfm_key)) {
$smarty->assign('lastfm_key', $lastfm_key);
}
?>
$submenu = user_menu($this_user, 'Edit');
$smarty->assign('submenu', $submenu);
$smarty->assign('me', $this_user);
$smarty->assign('headerfile', 'maxiprofile.tpl');
$smarty->display('user-connections.tpl');
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