You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

remote.php 960B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. $RUNTIME_NOAPPS = true;
  3. require_once 'lib/base.php';
  4. $path_info = OC_Request::getPathInfo();
  5. if ($path_info === false || $path_info === '') {
  6. OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
  7. exit;
  8. }
  9. if (!$pos = strpos($path_info, '/', 1)) {
  10. $pos = strlen($path_info);
  11. }
  12. $service=substr($path_info, 1, $pos-1);
  13. $file = OC_AppConfig::getValue('core', 'remote_' . $service);
  14. if(is_null($file)) {
  15. OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
  16. exit;
  17. }
  18. $file=ltrim($file, '/');
  19. $parts=explode('/', $file, 2);
  20. $app=$parts[0];
  21. switch ($app) {
  22. case 'core':
  23. $file = OC::$SERVERROOT .'/'. $file;
  24. break;
  25. default:
  26. OC_Util::checkAppEnabled($app);
  27. OC_App::loadApp($app);
  28. if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
  29. $file = OC_App::getAppPath($app) .'/'. $parts[1];
  30. }else{
  31. $file = '/' . OC_App::getAppPath($app) .'/'. $parts[1];
  32. }
  33. break;
  34. }
  35. $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
  36. require_once $file;