Skip to content

Commit cae4e1e

Browse files
committed
OCDE fix: owners cannot recommend their own caches
1 parent 9200009 commit cae4e1e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

okapi/services/logs/submit/WebService.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,18 @@ private static function _call(OkapiRequest $request)
238238
));
239239
}
240240

241+
if ($recommend && $user['uuid'] == $cache['owner']['uuid'])
242+
{
243+
# This is needed for OCDE, which allows to find own caches
244+
# and to recommend events. Won't hurt to check it for all branches.
245+
246+
self::$success_message .= " "._(
247+
"However, your cache recommendation was ignored, because ".
248+
"you may not recommend your own caches."
249+
);
250+
$recommend = null;
251+
}
252+
241253
if (in_array($logtype, array('Available', 'Temporarily unavailable', 'Archived')))
242254
{
243255
if ($user['uuid'] != $cache['owner']['uuid'])

0 commit comments

Comments
 (0)