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

Commit 25510fda authored by Mike Sheldon's avatar Mike Sheldon

Merge branch 'master' of gitorious.org:~Elleo/foocorp/elleos-gnu-fm

parents c416787e 03a28a84
......@@ -397,6 +397,20 @@ class User {
}
/**
* Get details of any connections this user has setup to other services.
*
* @return An array of service connection details
*/
function getConnections() {
global $adodb;
$res = $adodb->GetAll('SELECT * FROM Service_Connections WHERE '
. ' userid = ' . $this->uniqueid);
return $res;
}
/**
* Get artists recommended for this yser
*
......
......@@ -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($_GET['token'] && $_GET['webservice_url'] && $logged_in == true) {
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(isset($_GET['token']) && isset($_GET['webservice_url'])) {
// 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,25 @@ 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);
}
if(isset($_GET['forward']) && isset($_GET['service'])) {
// Update the user's forwarding preferences
$adodb->Execute('UPDATE Service_Connections SET forward = ' . (int) ($_GET['forward'])
. ' WHERE userid = ' . $this_user->uniqueid
. ' AND webservice_url = ' . $adodb->qstr($_GET['service']));
}
} 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);
}
?>
$smarty->assign('connections', $this_user->getConnections());
$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