fix remote and public.php

remotes/origin/stable45
Robin Appelman 13 years ago
parent 6ee228cac7
commit b45d3ced79
  1. 2
      apps/calendar/appinfo/version
  2. 2
      apps/contacts/appinfo/version
  3. 2
      apps/files/appinfo/version
  4. 2
      apps/files_sharing/appinfo/version
  5. 2
      apps/gallery/appinfo/version
  6. 2
      apps/media/appinfo/version
  7. 2
      lib/app.php
  8. 1
      public.php
  9. 10
      remote.php

@ -608,7 +608,7 @@ class OC_App{
//set remote/public handelers
$appData=self::getAppInfo($appid);
foreach($appData['remote'] as $name=>$path){
OCP\CONFIG::setAppValue('core', 'remote_'.$name, $path);
OCP\CONFIG::setAppValue('core', 'remote_'.$name, $appid.'/'.$path);
}
foreach($appData['public'] as $name=>$path){
OCP\CONFIG::setAppValue('core', 'public_'.$name, $appid.'/'.$path);

@ -10,6 +10,7 @@ if(is_null($file)){
$parts=explode('/',$file,2);
$app=$parts[0];
OC_Util::checkAppEnabled($app);
OC_App::loadApp($app);

@ -15,27 +15,25 @@ if (!$pos = strpos($path_info, '/', 1)) {
$pos = strlen($path_info);
}
$service=substr($path_info, 1, $pos-1);
$file = OC_AppConfig::getValue('core', 'remote_' . $service);
$file = preg_replace('/apps\//','', $file); //Todo Remove after Multiappdir migration
if(is_null($file)){
OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
exit;
}
$file = ltrim ($file, '/');
$parts=explode('/', $file, 2);
$app=$parts[0];
switch ($app) {
case 'core':
$file = OC::$SERVERROOT .'/'. $file;
break;
default:
OC_Util::checkAppEnabled($app);
OC_App::loadApp($app);
$file = OC_App::getAppPath($app) .'/'. $parts[1];
break;
case 'core':
$file = OC::$SERVERROOT .'/'. $file;
break;
}
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
require_once($file);

Loading…
Cancel
Save