mucho progress on notifier, email style dfrn url's

This commit is contained in:
Mike Macgirvin 2010-07-08 07:03:25 -07:00
commit 9a6a60a9c1
9 changed files with 181 additions and 34 deletions

View file

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

View file

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

View file

@ -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";
}}

View file

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

View file

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