ff account manager
This commit is contained in:
parent
0abaa6724d
commit
7be66b1d91
1
boot.php
1
boot.php
|
@ -163,6 +163,7 @@ class App {
|
||||||
if($this->cmd === '.well-known/host-meta')
|
if($this->cmd === '.well-known/host-meta')
|
||||||
require_once('include/hostxrd.php');
|
require_once('include/hostxrd.php');
|
||||||
|
|
||||||
|
|
||||||
$this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
|
$this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
|
||||||
$this->pager['itemspage'] = 50;
|
$this->pager['itemspage'] = 50;
|
||||||
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
|
$this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
|
||||||
|
|
|
@ -49,6 +49,7 @@ if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && ((! (x($_POST,'auth-p
|
||||||
$_SESSION['cid'] = $a->cid;
|
$_SESSION['cid'] = $a->cid;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] .'"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -98,6 +99,8 @@ else {
|
||||||
$a->cid = $r[0]['id'];
|
$a->cid = $r[0]['id'];
|
||||||
$_SESSION['cid'] = $a->cid;
|
$_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']))
|
if(($a->module !== 'home') && isset($_SESSION['return_url']))
|
||||||
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
|
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,12 @@ $a->init_pagehead();
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
|
||||||
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')))
|
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
|
||||||
require("auth.php");
|
require("auth.php");
|
||||||
|
|
||||||
|
if(! x($_SESSION,'authenticated'))
|
||||||
|
header('X-Account-Management-Status: none');
|
||||||
|
|
||||||
if(! x($_SESSION,'sysmsg'))
|
if(! x($_SESSION,'sysmsg'))
|
||||||
$_SESSION['sysmsg'] = '';
|
$_SESSION['sysmsg'] = '';
|
||||||
|
|
||||||
|
|
26
mod/amcd.php
Normal file
26
mod/amcd.php
Normal 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();
|
||||||
|
}
|
|
@ -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" ;
|
$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 : ''));
|
$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";
|
$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');
|
$dfrn_pages = array('request', 'confirm', 'notify', 'poll');
|
||||||
|
|
5
mod/session.php
Normal file
5
mod/session.php
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
function session_content(&$a) {
|
||||||
|
|
||||||
|
}
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
<hm:Host>$domain</hm:Host>
|
<hm:Host>$domain</hm:Host>
|
||||||
|
|
||||||
<Link rel='lrdd'
|
<Link rel='lrdd' template='http://$domain/xrd/?uri={uri}' />
|
||||||
template='http://$domain/xrd/?uri={uri}'>
|
<Link rel='acct-mgmt' href='http://$domain/amcd' />
|
||||||
<Title>Resource Descriptor</Title>
|
<Link rel='http://services.mozilla.com/amcd/0.1' href='http://$domain/amcd' />
|
||||||
</Link>
|
|
||||||
</XRD>
|
</XRD>
|
||||||
|
|
Loading…
Reference in a new issue