fix remote and public.php

This commit is contained in:
Robin Appelman 2012-07-13 22:44:35 +02:00
parent 6ee228cac7
commit b45d3ced79
9 changed files with 12 additions and 13 deletions

View file

@ -1 +1 @@
0.5
0.5.2

View file

@ -1 +1 @@
0.2.1
0.2.3

View file

@ -1 +1 @@
1.1.1
1.1.3

View file

@ -1 +1 @@
0.2.1
0.2.2

View file

@ -1 +1 @@
0.5.0
0.5.1

View file

@ -1 +1 @@
0.4
0.4.1

View file

@ -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);

View file

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

View file

@ -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);