if(count($args) && $args[0] === 'php')
$args[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
- for($x = 0; $x < count($args); $x ++)
+
+ // add baseurl to args. cli scripts can't construct it
+ $args[] = $a->get_baseurl();
+
+ for($x = 0; $x < count($args); $x ++)
$args[$x] = escapeshellarg($args[$x]);
+
+
$cmdline = implode($args," ");
if(get_config('system','proc_windows'))
- proc_close(proc_open('cmd /c start /b ' . $cmdline,array(),$foo));
+ proc_close(proc_open('cmd /c start /b ' . $cmdline,array(),$foo,dirname(__FILE__)));
else
- proc_close(proc_open($cmdline." &",array(),$foo));
+ proc_close(proc_open($cmdline." &",array(),$foo,dirname(__FILE__)));
}
}
$recipients[] = $suggest[0]['cid'];
$item = $suggest[0];
}
+ elseif($cmd === 'removeme') {
+ $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($item_id));
+ $user = $r[0];
+ $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1", intval($item_id));
+ $self = $r[0];
+ $r = q("SELECT * FROM `contact` WHERE `self` = 0 AND `uid` = %d", intval($item_id));
+ if(! count($r))
+ return;
+ require_once('include/Contact.php');
+ foreach($r as $contact) {
+ terminate_friendship($user, $self, $contact);
+ }
+ return;
+ }
+ elseif($cmd === 'relocate') {
+ $normal_mode = false;
+ $relocate = true;
+ $uid = $item_id;
+ }
else {
--
// find ancestors
$r = q("SELECT * FROM `item` WHERE `id` = %d and visible = 1 and moderated = 0 LIMIT 1",
intval($item_id)