Blame view

sources/apps/notify/ajax/blacklist.php 429 Bytes
42e4f8d60   Kload   add all apps
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['id']) and isset($_POST['block']))) {
  	OCP\JSON::error(array('message' => 'Missing arguments'));
  	exit;
  }
  $id = (int)$_POST['id'];
  $block = (bool)$_POST['block'];
  try {
  	OC_Notify::setBlacklist(null, $id, $block);
  	OCP\JSON::success();
  } catch(Exception $e) {
  	OCP\JSON::error(array("message" => $e->getMessage()));
  }
  exit;