diff options
author | Friendika <info@friendika.com> | 2010-11-11 02:49:28 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-11-11 02:49:28 -0800 |
commit | 7be66b1d91f80c3cee0ed6f08392c3f3f1bffc1e (patch) | |
tree | 9c813130c32d83c440e145e514bb4e08f6fae0e3 | |
parent | 0abaa6724d6b2e7e3f5a3f8d81026cee9def0b10 (diff) | |
download | volse-hubzilla-7be66b1d91f80c3cee0ed6f08392c3f3f1bffc1e.tar.gz volse-hubzilla-7be66b1d91f80c3cee0ed6f08392c3f3f1bffc1e.tar.bz2 volse-hubzilla-7be66b1d91f80c3cee0ed6f08392c3f3f1bffc1e.zip |
ff account manager
-rw-r--r-- | boot.php | 1 | ||||
-rw-r--r-- | include/auth.php | 3 | ||||
-rw-r--r-- | index.php | 5 | ||||
-rw-r--r-- | mod/amcd.php | 26 | ||||
-rw-r--r-- | mod/profile.php | 2 | ||||
-rw-r--r-- | mod/session.php | 5 | ||||
-rw-r--r-- | view/xrd_host.tpl | 8 |
7 files changed, 44 insertions, 6 deletions
@@ -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']); } @@ -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 @@ +<?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(); +}
\ No newline at end of file diff --git a/mod/profile.php b/mod/profile.php index 99c775c4e..8dd7b8ebf 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -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'); 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 @@ +<?php + +function session_content(&$a) { + +} diff --git a/view/xrd_host.tpl b/view/xrd_host.tpl index 091c1541b..fae70dec9 100644 --- a/view/xrd_host.tpl +++ b/view/xrd_host.tpl @@ -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> |