ff account manager

This commit is contained in:
Friendika 2010-11-11 02:49:28 -08:00
parent 0abaa6724d
commit 7be66b1d91
7 changed files with 44 additions and 6 deletions

View file

@ -163,6 +163,7 @@ class App {
if($this->cmd === '.well-known/host-meta')
require_once('include/hostxrd.php');
$this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
$this->pager['itemspage'] = 50;
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];

View file

@ -49,6 +49,7 @@ if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && ((! (x($_POST,'auth-p
$_SESSION['cid'] = $a->cid;
}
header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] .'"');
}
}
else {
@ -98,6 +99,8 @@ else {
$a->cid = $r[0]['id'];
$_SESSION['cid'] = $a->cid;
}
header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] .'"');
if(($a->module !== 'home') && isset($_SESSION['return_url']))
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
}

View file

@ -31,9 +31,12 @@ $a->init_pagehead();
session_start();
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')))
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
require("auth.php");
if(! x($_SESSION,'authenticated'))
header('X-Account-Management-Status: none');
if(! x($_SESSION,'sysmsg'))
$_SESSION['sysmsg'] = '';

26
mod/amcd.php Normal file
View file

@ -0,0 +1,26 @@
<?php
function amcd_content(&$a) {
header("Content-type: text/json");
echo <<< EOT
{
"methods": {
"username-password-form": {
"connect": {
"method":"POST",
"path":"/login",
"params": {
"username":"login-name",
"password":"password"
}
},
"disconnect": {
"method":"GET",
"path":"/logout"
}
}
}
}
EOT;
killme();
}

View file

@ -70,7 +70,7 @@ function profile_init(&$a) {
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/dfrn_poll/' . $which .'" />' . "\r\n" ;
$uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
$a->page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
header('Link: <' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"');
header('Link: <' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
$dfrn_pages = array('request', 'confirm', 'notify', 'poll');

5
mod/session.php Normal file
View file

@ -0,0 +1,5 @@
<?php
function session_content(&$a) {
}

View file

@ -4,8 +4,8 @@
<hm:Host>$domain</hm:Host>
<Link rel='lrdd'
template='http://$domain/xrd/?uri={uri}'>
<Title>Resource Descriptor</Title>
</Link>
<Link rel='lrdd' template='http://$domain/xrd/?uri={uri}' />
<Link rel='acct-mgmt' href='http://$domain/amcd' />
<Link rel='http://services.mozilla.com/amcd/0.1' href='http://$domain/amcd' />
</XRD>