diff options
author | zottel <github@zottel.net> | 2012-03-29 10:23:45 +0200 |
---|---|---|
committer | zottel <github@zottel.net> | 2012-03-29 10:23:45 +0200 |
commit | 953840cf822718cba66a0727b576c674c6e44875 (patch) | |
tree | a924cf0031d16f6f15b7d84d5f519ca4257042b4 /mod/dfrn_notify.php | |
parent | fb817a29a934a68f194a42c29d3ed11da2da558f (diff) | |
parent | 3ee529d095ac7e83ae1e71d86cbe6d443885d54e (diff) | |
download | volse-hubzilla-953840cf822718cba66a0727b576c674c6e44875.tar.gz volse-hubzilla-953840cf822718cba66a0727b576c674c6e44875.tar.bz2 volse-hubzilla-953840cf822718cba66a0727b576c674c6e44875.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'mod/dfrn_notify.php')
-rwxr-xr-x | mod/dfrn_notify.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 71860ac3b..8e4ce0671 100755 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -158,6 +158,7 @@ function dfrn_notify_post(&$a) { ); } + logger('dfrn_notify: received notify from ' . $importer['name'] . ' for ' . $importer['username']); logger('dfrn_notify: data: ' . $data, LOGGER_DATA); @@ -174,6 +175,13 @@ function dfrn_notify_post(&$a) { } + + // If we are setup as a soapbox we aren't accepting input from this person + + if($importer['page-flags'] == PAGE_SOAPBOX) + xml_status(0); + + if(strlen($key)) { $rawkey = hex2bin(trim($key)); logger('rino: md5 raw key: ' . md5($rawkey)); @@ -261,7 +269,7 @@ function dfrn_notify_content(&$a) { break; // NOTREACHED } - $r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` + $r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`page-flags` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` WHERE `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `user`.`nickname` = '%s' AND `user`.`account_expired` = 0 $sql_extra LIMIT 1", dbesc($a->argv[1]) @@ -299,6 +307,12 @@ function dfrn_notify_content(&$a) { if(! $rino_enable) $rino = 0; + if((($r[0]['rel']) && ($r[0]['rel'] != CONTACT_IS_SHARING)) || ($r[0]['page-flags'] == PAGE_COMMUNITY)) { + $perm = 'rw'; + } + else { + $perm = 'r'; + } header("Content-type: text/xml"); @@ -306,7 +320,8 @@ function dfrn_notify_content(&$a) { . '<dfrn_notify>' . "\r\n" . "\t" . '<status>' . $status . '</status>' . "\r\n" . "\t" . '<dfrn_version>' . DFRN_PROTOCOL_VERSION . '</dfrn_version>' . "\r\n" - . "\t" . '<rino>' . $rino . '</rino>' . "\r\n" + . "\t" . '<rino>' . $rino . '</rino>' . "\r\n" + . "\t" . '<perm>' . $perm . '</perm>' . "\r\n" . "\t" . '<dfrn_id>' . $encrypted_id . '</dfrn_id>' . "\r\n" . "\t" . '<challenge>' . $challenge . '</challenge>' . "\r\n" . '</dfrn_notify>' . "\r\n" ; |