no more url in cmdline

This commit is contained in:
Mike Macgirvin 2010-08-16 20:47:40 -07:00
parent ce515ac2e8
commit facca43e2d
7 changed files with 30 additions and 25 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1,015 B

View file

@ -1,6 +1,7 @@
<?php <?php
print_r($argv); $debugging = false;
require_once("boot.php"); require_once("boot.php");
$a = new App; $a = new App;
@ -13,19 +14,21 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
require_once("session.php"); require_once("session.php");
require_once("datetime.php"); require_once("datetime.php");
if($argc < 3) if($argc < 2)
exit; exit;
dbg(3);
$a->set_baseurl(get_config('system',url'));
$baseurl = $argv[1]; $baseurl = $argv[1];
$a->set_baseurl($argv[1]); $a->set_baseurl($argv[1]);
$cmd = $argv[2]; $cmd = $argv[1];
switch($cmd) { switch($cmd) {
case 'mail': case 'mail':
default: default:
$item_id = intval($argv[3]); $item_id = intval($argv[2]);
if(! $item_id) if(! $item_id)
killme(); killme();
break; break;
@ -233,7 +236,10 @@ dbg(3);
} }
} }
$atom .= "</feed>\r\n"; $atom .= "</feed>\r\n";
if($debugging)
echo $atom; echo $atom;
// create a clone of this feed but with comments disabled to send to those who can't respond. // create a clone of this feed but with comments disabled to send to those who can't respond.
$atom_nowrite = str_replace('<dfrn:comment-allow>1','<dfrn:comment-allow>0',$atom); $atom_nowrite = str_replace('<dfrn:comment-allow>1','<dfrn:comment-allow>0',$atom);
@ -265,7 +271,10 @@ echo $atom;
$url = $rr['notify'] . '?dfrn_id=' . $rr['dfrn-id']; $url = $rr['notify'] . '?dfrn_id=' . $rr['dfrn-id'];
$xml = fetch_url($url); $xml = fetch_url($url);
if($debugging)
echo $xml; echo $xml;
if(! $xml) if(! $xml)
continue; continue;
@ -302,6 +311,8 @@ echo $xml;
} }
$xml = post_url($rr['notify'],$postvars); $xml = post_url($rr['notify'],$postvars);
if($debugging)
echo $xml; echo $xml;
$res = simplexml_load_string($xml); $res = simplexml_load_string($xml);

View file

@ -15,10 +15,9 @@ require_once('datetime.php');
require_once('simplepie/simplepie.inc'); require_once('simplepie/simplepie.inc');
require_once('include/items.php'); require_once('include/items.php');
if($argc < 2)
exit;
dbg(3); $a->set_baseurl(get_config('system','url'));
$a->set_baseurl($argv[1]);
$contacts = q("SELECT * FROM `contact` WHERE `dfrn-id` != '' AND `self` = 0 AND `blocked` = 0 AND `readonly` = 0 ORDER BY RAND()"); $contacts = q("SELECT * FROM `contact` WHERE `dfrn-id` != '' AND `self` = 0 AND `blocked` = 0 AND `readonly` = 0 ORDER BY RAND()");

View file

@ -169,10 +169,9 @@ function dfrn_notify_post(&$a) {
intval($posted_id) intval($posted_id)
); );
$url = $a->get_baseurl();
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$url\" \"comment-import\" \"$posted_id\" &", proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"comment-import\" \"$posted_id\" &",
array(),$foo)); array(),$foo));
if(($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) { if(($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) {

View file

@ -238,10 +238,10 @@ function item_post(&$a) {
); );
} }
} }
$url = $a->get_baseurl();
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$url\" \"$notify_type\" \"$post_id\" &", proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &",
array(),$foo)); array(),$foo));
goaway($a->get_baseurl() . "/" . $_POST['return'] ); goaway($a->get_baseurl() . "/" . $_POST['return'] );
@ -307,13 +307,12 @@ function item_content(&$a) {
// ignore the result // ignore the result
} }
$url = $a->get_baseurl();
$drop_id = intval($item['id']); $drop_id = intval($item['id']);
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
// send the notification upstream/downstream as the case may be // send the notification upstream/downstream as the case may be
proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$url\" \"drop\" \"$drop_id\" &", proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" &",
array(),$foo)); array(),$foo));
goaway($a->get_baseurl() . '/' . $_SESSION['return_url']); goaway($a->get_baseurl() . '/' . $_SESSION['return_url']);

View file

@ -67,11 +67,10 @@ function message_post(&$a) {
if(count($r)) if(count($r))
$post_id = $r[0]['id']; $post_id = $r[0]['id'];
$url = $a->get_baseurl();
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
if($post_id) { if($post_id) {
proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$url\" \"mail\" \"$post_id\" &", proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"mail\" \"$post_id\" &",
array(),$foo)); array(),$foo));
notice( t('Message sent.') . EOL ); notice( t('Message sent.') . EOL );
} }
@ -134,11 +133,10 @@ function message_content(&$a) {
} }
if(($a->argc > 2) && ($a->argv[1] == 'redeliver') && intval($a->argv[2])) { if(($a->argc > 2) && ($a->argv[1] == 'redeliver') && intval($a->argv[2])) {
$url = $a->get_baseurl();
$post_id = intval($a->argv[2]); $post_id = intval($a->argv[2]);
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$url\" \"mail\" \"$post_id\" &", proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"mail\" \"$post_id\" &",
array(),$foo)); array(),$foo));
goaway($a->get_baseurl() . '/message' ); goaway($a->get_baseurl() . '/message' );
} }

View file

@ -122,14 +122,13 @@ function photos_post(&$a) {
intval($_SESSION['uid']) intval($_SESSION['uid'])
); );
$url = $a->get_baseurl();
$drop_id = intval($rr['id']); $drop_id = intval($rr['id']);
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
// send the notification upstream/downstream as the case may be // send the notification upstream/downstream as the case may be
if($rr['visible']) if($rr['visible'])
proc_close(proc_open("\"php_path\" \"include/notifier.php\" \"$url\" \"drop\" \"$drop_id\" & ", proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ",
array(),$foo)); array(),$foo));
} }
@ -166,7 +165,7 @@ function photos_post(&$a) {
// send the notification upstream/downstream as the case may be // send the notification upstream/downstream as the case may be
if($i[0]['visible']) if($i[0]['visible'])
proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"$url\" \"drop\" \"$drop_id\" & ", proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ",
array(),$foo)); array(),$foo));
} }
} }