Public contacts are not permitted for suggestions or mails

This commit is contained in:
Michael 2018-04-01 05:07:35 +00:00
parent 7dd64dd465
commit f51a254ed0

View file

@ -2681,6 +2681,10 @@ class DFRN
return true; return true;
} }
} else { // $entrytype == DFRN_TOP_LEVEL } else { // $entrytype == DFRN_TOP_LEVEL
if ($importer["readonly"]) {
logger('ignoring read-only contact '.$importer["id"]);
return;
}
if ($importer["uid"] == 0) { if ($importer["uid"] == 0) {
logger("Contact ".$importer["id"]." isn't known to user ".$importer["importer_uid"].". The post will be ignored.", LOGGER_DEBUG); logger("Contact ".$importer["id"]." isn't known to user ".$importer["importer_uid"].". The post will be ignored.", LOGGER_DEBUG);
return; return;
@ -2857,13 +2861,7 @@ class DFRN
self::processRelocation($xpath, $relocation, $importer); self::processRelocation($xpath, $relocation, $importer);
} }
if ($importer["readonly"]) { if (($importer["uid"] != 0) && !$importer["readonly"]) {
// We aren't receiving stuff from this person. But we will quietly ignore them
// rather than a blatant "go away" message.
logger('ignoring contact '.$importer["id"]);
return 403;
}
$mails = $xpath->query("/atom:feed/dfrn:mail"); $mails = $xpath->query("/atom:feed/dfrn:mail");
foreach ($mails as $mail) { foreach ($mails as $mail) {
self::processMail($xpath, $mail, $importer); self::processMail($xpath, $mail, $importer);
@ -2873,6 +2871,7 @@ class DFRN
foreach ($suggestions as $suggestion) { foreach ($suggestions as $suggestion) {
self::processSuggestion($xpath, $suggestion, $importer); self::processSuggestion($xpath, $suggestion, $importer);
} }
}
$deletions = $xpath->query("/atom:feed/at:deleted-entry"); $deletions = $xpath->query("/atom:feed/at:deleted-entry");
foreach ($deletions as $deletion) { foreach ($deletions as $deletion) {