Merge branch 'pull'
This commit is contained in:
commit
c9d17c78a6
2 changed files with 26 additions and 8 deletions
|
@ -323,20 +323,31 @@
|
|||
api_register_func('api/account/verify_credentials','api_account_verify_credentials', true);
|
||||
|
||||
|
||||
/**
|
||||
* get data from $_POST or $_GET
|
||||
*/
|
||||
function requestdata($k){
|
||||
if (isset($_POST[$k])){
|
||||
return $_POST[$k];
|
||||
}
|
||||
if (isset($_GET[$k])){
|
||||
return $_GET[$k];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// TODO - media uploads
|
||||
|
||||
function api_statuses_update(&$a, $type) {
|
||||
if (local_user()===false) return false;
|
||||
$user_info = api_get_user($a);
|
||||
|
||||
// convert $_POST array items to the form we use for web posts.
|
||||
|
||||
$_POST['body'] = urldecode($_POST['status']);
|
||||
$_POST['parent'] = $_POST['in_reply_to_status_id'];
|
||||
if($_POST['lat'] && $_POST['long'])
|
||||
$_POST['coord'] = sprintf("%s %s",$_POST['lat'],$_POST['long']);
|
||||
$_POST['body'] = urldecode(requestdata('status'));
|
||||
$_POST['parent'] = requestdata('in_reply_to_status_id');
|
||||
if(requestdata('lat') && requestdata('long'))
|
||||
$_POST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long'));
|
||||
$_POST['profile_uid'] = local_user();
|
||||
if($_POST['parent'])
|
||||
if(requestdata('parent'))
|
||||
$_POST['type'] = 'net-comment';
|
||||
else
|
||||
$_POST['type'] = 'wall';
|
||||
|
|
11
mod/ping.php
11
mod/ping.php
|
@ -31,11 +31,18 @@ function ping_init(&$a) {
|
|||
intval(local_user()),
|
||||
dbesc($myurl)
|
||||
);
|
||||
|
||||
$mail = $r[0]['total'];
|
||||
|
||||
if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){
|
||||
$r = q("SELECT COUNT(*) AS `total` FROM `register`");
|
||||
$register = $r[0]['total'];
|
||||
} else {
|
||||
$register = "0";
|
||||
}
|
||||
|
||||
|
||||
header("Content-type: text/xml");
|
||||
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<result><intro>$intro</intro><mail>$mail</mail><net>$network</net><home>$home</home></result>\r\n";
|
||||
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<result><intro>$intro</intro><mail>$mail</mail><net>$network</net><home>$home</home><register>$register</register></result>\r\n";
|
||||
|
||||
killme();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue