remote.php 699 B

12345678910111213141516171819202122232425
  1. <?php
  2. $RUNTIME_NOSETUPFS = true;
  3. $RUNTIME_NOAPPS = TRUE;
  4. require_once('lib/base.php');
  5. if (array_key_exists('PATH_INFO', $_SERVER)){
  6. $path_info = $_SERVER['PATH_INFO'];
  7. }else{
  8. $path_info = substr($_SERVER['PHP_SELF'], strpos($_SERVER['PHP_SELF'], basename(__FILE__)) + strlen(basename(__FILE__)));
  9. }
  10. if (!$pos = strpos($path_info, '/', 1)) {
  11. $pos = strlen($path_info);
  12. }
  13. $service=substr($path_info, 1, $pos-1);
  14. $file = OC_AppConfig::getValue('core', 'remote_' . $service);
  15. if(is_null($file)){
  16. header('HTTP/1.0 404 Not Found');
  17. exit;
  18. }
  19. $parts=explode('/',$file);
  20. $app=$parts[2];
  21. OC_App::loadApp($app);
  22. $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
  23. require_once(OC::$APPSROOT . $file);