- if (isset($wrConditions[$condition])) return wrReportSandboxParse('[['. $input . '#' . $wrShowReportsSection . '|'. $wrConditions[$condition] . "]] <small>$date ''[[" . $input . '#' . $wrNewReportSection . "|Neu]]''</small>");
- return wrReportSandboxParse("<small>''[[" . $input . '#' . $wrNewReportSection . "|Bitte eintragen]]''</small>");
+ global $wgUser;
+ global $wgWrReportMode; // e.g. 'summer'
+ global $wgWrReportBlackListAll;
+ global $wgWrReportBlackListStrangers;
+
+ // Determine, whether the user is allowed to make a new report
+ $userMayReport = ($wgWrReportMode == 'allow' || ($wgWrReportMode == 'loggedin' && $wgUser->isLoggedIn()));
+ if ($userMayReport) {
+ if (in_array($titleText, $wgWrReportBlackListAll)) $userMayReport = false;
+ if (!$wgUser->isLoggedIn() && in_array($titleText, $wgWrReportBlackListStrangers)) $userMayReport = false;
+ }
+
+ // Get the condition and create the response wiki text
+ if (isset($wrConditions[$condition])) {
+ $wikiText = '[['. $titleText . '#' . $wrShowReportsSection . '|'. $wrConditions[$condition] . "]] <small>$date";
+ if ($userMayReport) $wikiText .= " ''[[" . $titleText . '#' . $wrNewReportSection . "|Neu]]''";
+ $wikiText .= "</small>";
+ } else {
+ if ($userMayReport) $wikiText = "<small>''[[" . $titleText . '#' . $wrNewReportSection . "|Bitte eintragen]]''</small>";
+ else $wikiText = '--';
+ }
+ return wrReportSandboxParse($wikiText);