Blame view
sources/apps/notify/ajax/deleteRead.php
448 Bytes
|
42e4f8d60
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?php
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled("notify");
// FIXME CSRF !!
if(isset($_POST["read"])) {
$read = (strtolower($_POST["read"]) != "false" and (bool)$_POST["read"]);
} else {
OCP\JSON::error(array("message" => "Missing argument"));
exit;
}
try {
$num = OC_Notify::deleteByRead(null, $read);
OCP\JSON::success(array("num" => $num));
} catch(Exception $e) {
OCP\JSON::error(array("message" => $e->getMessage()));
}
exit;
|