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 //set remote/public handelers
$appData=self::getAppInfo($appid); $appData=self::getAppInfo($appid);
foreach($appData['remote'] as $name=>$path){ 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){ foreach($appData['public'] as $name=>$path){
OCP\CONFIG::setAppValue('core', 'public_'.$name, $appid.'/'.$path); OCP\CONFIG::setAppValue('core', 'public_'.$name, $appid.'/'.$path);

View File

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

View File

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