diff options
author | friendica <info@friendica.com> | 2012-03-28 17:21:56 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-03-28 17:21:56 -0700 |
commit | 7956c2d08e209635c40ca62e2a37d46fd41869af (patch) | |
tree | edb271bb2f113f1686ae0c502163f01fc38d5e84 /mod | |
parent | a2b1aca27c936991d02ab10d97f1f7980500c460 (diff) | |
download | volse-hubzilla-7956c2d08e209635c40ca62e2a37d46fd41869af.tar.gz volse-hubzilla-7956c2d08e209635c40ca62e2a37d46fd41869af.tar.bz2 volse-hubzilla-7956c2d08e209635c40ca62e2a37d46fd41869af.zip |
improved rw notifications
Diffstat (limited to 'mod')
-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" ; |