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 841B

123456789101112131415161718192021222324252627282930313233343536
  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. $file = '/' . OC_App::getAppPath($app) .'/'. $parts[1];
  29. break;
  30. }
  31. $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
  32. require_once $file;