Blame view

sources/apps/notify/ajax/setAutoRefresh.php 356 Bytes
42e4f8d60   Kload   add all apps
1
2
3
4
5
6
7
8
9
10
11
12
13
  <?php
  OCP\JSON::checkLoggedIn();
  if(isset($_POST["flag"])) {
  	$flag = (bool)$_POST["flag"];
  } else {
  	OCP\JSON::error(array("message" => "Missing flag argument"));
  }
  try {
  	OCP\Config::setUserValue(OCP\User::getUser(), 'notify', 'autorefresh', $flag);
  	OCP\JSON::success();
  } catch(Exception $e) {
  	OCP\JSON::error(array("message" => $e->getMessage()));
  }