]> git.mxchange.org Git - friendica.git/commitdiff
lrdd link on profile page (for salmon m/e), remove dfrn-template, qualify some contac...
authorMike Macgirvin <mike@macgirvin.com>
Tue, 19 Oct 2010 22:51:56 +0000 (15:51 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Tue, 19 Oct 2010 22:51:56 +0000 (15:51 -0700)
boot.php
mod/dfrn_request.php
mod/profile.php
mod/pubsub.php

index b3d116a50a0e72ec57d861d4e6feaebd0adcbbf7..d347e6009d2f2f5a404e3ce6a4a380f2c3a8a56d 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -122,15 +122,11 @@ class App {
                $this->page = array();
                $this->pager= array();
 
-               $this->scheme = ((isset($_SERVER['HTTPS']) 
-                               && ($_SERVER['HTTPS'])) ?  'https' : 'http' );
-               $this->hostname = str_replace('www.','',
-                               $_SERVER['SERVER_NAME']);
-               set_include_path("include/$this->hostname" 
-                               . PATH_SEPARATOR . 'include' 
-                               . PATH_SEPARATOR . '.' );
-
-                if(substr($_SERVER['QUERY_STRING'],0,2) == "q=")
+               $this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']))      ?  'https' : 'http' );
+               $this->hostname = $_SERVER['SERVER_NAME'];
+               set_include_path("include/$this->hostname" . PATH_SEPARATOR . 'include' . PATH_SEPARATOR . '.' );
+
+               if(substr($_SERVER['QUERY_STRING'],0,2) == "q=")
                        $_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'],2);
                $this->cmd = trim($_GET['q'],'/');
 
@@ -157,9 +153,7 @@ class App {
                if(strlen($this->baseurl))
                        return $this->baseurl;
 
-               $this->baseurl = (($ssl) ? 'https' : $this->scheme) . "://" . $this->hostname
-                       . ((isset($this->path) && strlen($this->path)) 
-                       ? '/' . $this->path : '' );
+               $this->baseurl = (($ssl) ? 'https' : $this->scheme) . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' );
                return $this->baseurl;
        }
 
@@ -177,7 +171,7 @@ class App {
        }
 
        function set_path($p) {
-               $this->path = ltrim(trim($p),'/');
+               $this->path = trim(trim($p),'/');
        } 
 
        function get_path() {
@@ -1158,4 +1152,6 @@ function load_view_file($s) {
        if($lang && file_exists("$d/$lang/$b"))
                return file_get_contents("$d/$lang/$b");
        return file_get_contents($s);
-}}
\ No newline at end of file
+}}
+
+
index 7a3060ff4fc01ffb5b55586f2ee6995193ea0a58..6e8171d50ae28ea0cd7813c6b2e874565349953a 100644 (file)
@@ -44,7 +44,7 @@ function dfrn_request_post(&$a) {
        
                        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()),
                                        dbesc($dfrn_url)
                                );
@@ -198,7 +198,7 @@ function dfrn_request_post(&$a) {
 
 
                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),
                                dbesc($url)
                        );
index 5576b49dd128c4bc25da766d6cd27bda4cb9a59a..8fa25cdbf8f39eb470fc9816dcb31dcd2008881d 100644 (file)
@@ -61,10 +61,11 @@ function profile_init(&$a) {
                $profile = $a->argv[1];         
        }
        profile_load($a,$which,$profile);
+        $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";
 
-        $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" ;
   
        
        $dfrn_pages = array('request', 'confirm', 'notify', 'poll');
index b47b2eedf3fc5cf3194e81ba55f558b0c77a3a6d..1b69cc5f935db2658d9257bbca6511f640ea89f8 100644 (file)
@@ -83,6 +83,7 @@ function pubsub_init(&$a) {
        }
 }
 
+require_once('include/security.php');
 
 function pubsub_post(&$a) {