lrdd link on profile page (for salmon m/e), remove dfrn-template, qualify some contact lookups, some cleanup of app/boot

This commit is contained in:
Mike Macgirvin 2010-10-19 15:51:56 -07:00
parent 3876cab8ea
commit 0b2d85891e
4 changed files with 16 additions and 18 deletions

View file

@ -122,13 +122,9 @@ class App {
$this->page = array(); $this->page = array();
$this->pager= array(); $this->pager= array();
$this->scheme = ((isset($_SERVER['HTTPS']) $this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) ? 'https' : 'http' );
&& ($_SERVER['HTTPS'])) ? 'https' : 'http' ); $this->hostname = $_SERVER['SERVER_NAME'];
$this->hostname = str_replace('www.','', set_include_path("include/$this->hostname" . PATH_SEPARATOR . 'include' . PATH_SEPARATOR . '.' );
$_SERVER['SERVER_NAME']);
set_include_path("include/$this->hostname"
. PATH_SEPARATOR . 'include'
. PATH_SEPARATOR . '.' );
if(substr($_SERVER['QUERY_STRING'],0,2) == "q=") if(substr($_SERVER['QUERY_STRING'],0,2) == "q=")
$_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'],2); $_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'],2);
@ -157,9 +153,7 @@ class App {
if(strlen($this->baseurl)) if(strlen($this->baseurl))
return $this->baseurl; return $this->baseurl;
$this->baseurl = (($ssl) ? 'https' : $this->scheme) . "://" . $this->hostname $this->baseurl = (($ssl) ? 'https' : $this->scheme) . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
. ((isset($this->path) && strlen($this->path))
? '/' . $this->path : '' );
return $this->baseurl; return $this->baseurl;
} }
@ -177,7 +171,7 @@ class App {
} }
function set_path($p) { function set_path($p) {
$this->path = ltrim(trim($p),'/'); $this->path = trim(trim($p),'/');
} }
function get_path() { function get_path() {
@ -1159,3 +1153,5 @@ function load_view_file($s) {
return file_get_contents("$d/$lang/$b"); return file_get_contents("$d/$lang/$b");
return file_get_contents($s); return file_get_contents($s);
}} }}

View file

@ -44,7 +44,7 @@ function dfrn_request_post(&$a) {
if(x($dfrn_url)) { if(x($dfrn_url)) {
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1", $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `self` = 0 LIMIT 1",
intval(local_user()), intval(local_user()),
dbesc($dfrn_url) dbesc($dfrn_url)
); );
@ -198,7 +198,7 @@ function dfrn_request_post(&$a) {
if($network === 'dfrn') { if($network === 'dfrn') {
$ret = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1", $ret = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `self` = 0 LIMIT 1",
intval($uid), intval($uid),
dbesc($url) dbesc($url)
); );

View file

@ -61,10 +61,11 @@ function profile_init(&$a) {
$profile = $a->argv[1]; $profile = $a->argv[1];
} }
profile_load($a,$which,$profile); profile_load($a,$which,$profile);
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/dfrn_poll/' . $which .'" />' . "\r\n" ;
$a->page['htmlhead'] .= '<meta name="dfrn-template" content="' . $a->get_baseurl() . "/profile/%s" . '" />' . "\r\n" ;
$a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n" ; $a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\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->user['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";
$dfrn_pages = array('request', 'confirm', 'notify', 'poll'); $dfrn_pages = array('request', 'confirm', 'notify', 'poll');

View file

@ -83,6 +83,7 @@ function pubsub_init(&$a) {
} }
} }
require_once('include/security.php');
function pubsub_post(&$a) { function pubsub_post(&$a) {