appconfig.php 998 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
  4. * This file is licensed under the Affero General Public License version 3 or later.
  5. * See the COPYING-README file.
  6. */
  7. OC_Util::checkAdminUser();
  8. OCP\JSON::callCheck();
  9. $action=isset($_POST['action'])?$_POST['action']:$_GET['action'];
  10. $result=false;
  11. switch($action) {
  12. case 'getValue':
  13. $result=OC_Appconfig::getValue($_GET['app'], $_GET['key'], $_GET['defaultValue']);
  14. break;
  15. case 'setValue':
  16. $result=OC_Appconfig::setValue($_POST['app'], $_POST['key'], $_POST['value']);
  17. break;
  18. case 'getApps':
  19. $result=OC_Appconfig::getApps();
  20. break;
  21. case 'getKeys':
  22. $result=OC_Appconfig::getKeys($_GET['app']);
  23. break;
  24. case 'hasKey':
  25. $result=OC_Appconfig::hasKey($_GET['app'], $_GET['key']);
  26. break;
  27. case 'deleteKey':
  28. $result=OC_Appconfig::deleteKey($_POST['app'], $_POST['key']);
  29. break;
  30. case 'deleteApp':
  31. $result=OC_Appconfig::deleteApp($_POST['app']);
  32. break;
  33. }
  34. OC_JSON::success(array('data'=>$result));