aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-07-08 07:03:25 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-07-08 07:03:25 -0700
commit9a6a60a9c1c7f781790849173e309ac0664d7b35 (patch)
treeb0597e8aeaa20d6ded493b2c053e3e976a53115a /mod
parente98aaa3cbd2c14ab2f1b8534c8c63708086fe0f1 (diff)
downloadvolse-hubzilla-9a6a60a9c1c7f781790849173e309ac0664d7b35.tar.gz
volse-hubzilla-9a6a60a9c1c7f781790849173e309ac0664d7b35.tar.bz2
volse-hubzilla-9a6a60a9c1c7f781790849173e309ac0664d7b35.zip
mucho progress on notifier, email style dfrn url's
Diffstat (limited to 'mod')
-rw-r--r--mod/dfrn_notify.php4
-rw-r--r--mod/dfrn_request.php9
-rw-r--r--mod/home.php2
-rw-r--r--mod/item.php4
-rw-r--r--mod/profile.php2
5 files changed, 17 insertions, 4 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index c078afe38..2d9d06fd1 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -66,8 +66,8 @@ function dfrn_notify_content(&$a) {
$challenge = '';
openssl_private_encrypt($hash,$challenge,$r[0]['prvkey']);
-
- echo '<?xml version=1.0" encoding="UTF-8"?><dfrn_notify><status>' .$status . '</status><dfrn_id>' . $_GET['dfrn_id'] . '</dfrn_id>'
+ $challenge = bin2hex($challenge);
+ echo '<?xml version="1.0" encoding="UTF-8"?><dfrn_notify><status>' .$status . '</status><dfrn_id>' . $_GET['dfrn_id'] . '</dfrn_id>'
. '<challenge>' . $challenge . '</challenge></dfrn_notify>' . "\r\n" ;
session_write_close();
exit;
diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php
index b6ae4346d..7fb55c4bf 100644
--- a/mod/dfrn_request.php
+++ b/mod/dfrn_request.php
@@ -166,6 +166,15 @@ function dfrn_request_post(&$a) {
return;
}
+ if(strstr($url,'@')) {
+ $username = substr($url,0,strpos($url,'@'));
+ $hostname = substr($url,strpos($url,'@') + 1);
+ require_once('Scrape.php');
+
+ $parms = scrape_meta('http://' . $url);
+ if((x($parms,'dfrn-template')) && strstr($parms['dfrn-template'],'%s'))
+ $url = sprintf($parms['dfrn-template'],$username);
+ }
$ret = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' LIMIT 1",
intval($uid),
diff --git a/mod/home.php b/mod/home.php
index 44f2a9888..a60e96ccb 100644
--- a/mod/home.php
+++ b/mod/home.php
@@ -9,6 +9,8 @@ function home_init(&$a) {
else
goaway( $a->get_baseurl() . "/profile/" . $_SESSION['uid'] );
}
+ $a->page['htmlhead'] .= "<meta name=\"dfrn-template\" content=\"" . $a->get_baseurl() . "/profile/%s" . "\" />\r\n";
+
}}
diff --git a/mod/item.php b/mod/item.php
index 23917161b..4314719fb 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -58,8 +58,8 @@ function item_post(&$a) {
intval($post_id));
}
-
- proc_close(proc_open("php include/notifier.php $post_id > notify.log &",
+ $url = bin2hex($a->get_baseurl());
+ proc_close(proc_open("php include/notifier.php $url $post_id > notify.log &",
array(),$foo));
// notifier($a,$post_id,$parent);
diff --git a/mod/profile.php b/mod/profile.php
index 1caa3478f..e5bc92f5b 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -58,10 +58,12 @@ function profile_init(&$a) {
}
profile_load($a,$which);
+ $a->page['htmlhead'] .= "<meta name=\"dfrn-template\" content=\"" . $a->get_baseurl() . "/profile/%s" . "\" />\r\n";
$dfrn_pages = array('request', 'confirm', 'notify', 'poll');
foreach($dfrn_pages as $dfrn)
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
+
}
function item_display(&$a, $item,$template,$comment) {