Przeglądaj źródła

ff account manager

tags/2.1
Friendika 10 lat temu
rodzic
commit
7be66b1d91
7 zmienionych plików z 44 dodań i 6 usunięć
  1. +1
    -0
      boot.php
  2. +3
    -0
      include/auth.php
  3. +4
    -1
      index.php
  4. +26
    -0
      mod/amcd.php
  5. +1
    -1
      mod/profile.php
  6. +5
    -0
      mod/session.php
  7. +4
    -4
      view/xrd_host.tpl

+ 1
- 0
boot.php Wyświetl plik

@@ -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'];


+ 3
- 0
include/auth.php Wyświetl plik

@@ -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']);
}


+ 4
- 1
index.php Wyświetl plik

@@ -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
- 0
mod/amcd.php Wyświetl plik

@@ -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();
}

+ 1
- 1
mod/profile.php Wyświetl plik

@@ -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
- 0
mod/session.php Wyświetl plik

@@ -0,0 +1,5 @@
<?php

function session_content(&$a) {

}

+ 4
- 4
view/xrd_host.tpl Wyświetl plik

@@ -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>

Ładowanie…
Anuluj
Zapisz