]> git.mxchange.org Git - friendica.git/commitdiff
ff account manager
authorFriendika <info@friendika.com>
Thu, 11 Nov 2010 10:49:28 +0000 (02:49 -0800)
committerFriendika <info@friendika.com>
Thu, 11 Nov 2010 10:49:28 +0000 (02:49 -0800)
boot.php
include/auth.php
index.php
mod/amcd.php [new file with mode: 0644]
mod/profile.php
mod/session.php [new file with mode: 0644]
view/xrd_host.tpl

index 2ac6ee7914a89ad8af770c30c78be9d2036feef8..948cca46dc1383be8b466ab3a205907cde103974 100644 (file)
--- 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'];
index c0a747def8dc3578cb3447a80e58b35f2e160528..ccaa970de1e5bcb2272892c5a1b38dd98f1cd197 100644 (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']);
        }
index 46f001738f7b033a2b6df9db4c4246f99f6123fa..abb528f9517aa4dc491a4e96c4fc53d187ca2379 100644 (file)
--- 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 (file)
index 0000000..01c6b92
--- /dev/null
@@ -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
index 99c775c4eedb38fb5d122e1844dcc7657dd102db..8dd7b8ebf126feb92333650b9829fab3df87ec1a 100644 (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');
diff --git a/mod/session.php b/mod/session.php
new file mode 100644 (file)
index 0000000..22c855e
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+function session_content(&$a) {
+
+}
index 091c1541baf51dc85d306a9e30f0d48f44635474..fae70dec9eb325fd493175bf6308aff4cd151851 100644 (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>