From 7be66b1d91f80c3cee0ed6f08392c3f3f1bffc1e Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 11 Nov 2010 02:49:28 -0800 Subject: [PATCH] ff account manager --- boot.php | 1 + include/auth.php | 3 +++ index.php | 5 ++++- mod/amcd.php | 26 ++++++++++++++++++++++++++ mod/profile.php | 2 +- mod/session.php | 5 +++++ view/xrd_host.tpl | 8 ++++---- 7 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 mod/amcd.php create mode 100644 mod/session.php diff --git a/boot.php b/boot.php index 2ac6ee791..948cca46d 100644 --- a/boot.php +++ b/boot.php @@ -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']; diff --git a/include/auth.php b/include/auth.php index c0a747def..ccaa970de 100644 --- a/include/auth.php +++ b/include/auth.php @@ -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']); } diff --git a/index.php b/index.php index 46f001738..abb528f95 100644 --- a/index.php +++ b/index.php @@ -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'] = ''; diff --git a/mod/amcd.php b/mod/amcd.php new file mode 100644 index 000000000..01c6b92da --- /dev/null +++ b/mod/amcd.php @@ -0,0 +1,26 @@ +page['htmlhead'] .= '' . "\r\n" ; $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : '')); $a->page['htmlhead'] .= '' . "\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'); diff --git a/mod/session.php b/mod/session.php new file mode 100644 index 000000000..22c855edb --- /dev/null +++ b/mod/session.php @@ -0,0 +1,5 @@ +$domain - - Resource Descriptor - + + + +