diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php index 9241dc8ddf..d66aab5896 100644 --- a/apps/bookmarks/ajax/addBookmark.php +++ b/apps/bookmarks/ajax/addBookmark.php @@ -30,6 +30,6 @@ $RUNTIME_NOSETUPFS=true; OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('bookmarks'); -require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php'); +require_once(OC_App::getAppPath('bookmarks').'/bookmarksHelper.php'); $id = addBookmark($_GET['url'], $_GET['title'], $_GET['tags']); OCP\JSON::success(array('data' => $id)); \ No newline at end of file diff --git a/apps/calendar/appinfo/remote.php b/apps/calendar/appinfo/remote.php index 3bd8737ee9..7ab546245f 100644 --- a/apps/calendar/appinfo/remote.php +++ b/apps/calendar/appinfo/remote.php @@ -7,8 +7,8 @@ */ OCP\App::checkAppEnabled('calendar'); -if(substr($_SERVER["REQUEST_URI"],0,strlen(OC::$APPSWEBROOT . '/apps/calendar/caldav.php')) == OC::$APPSWEBROOT . '/apps/calendar/caldav.php'){ - $baseuri = OC::$APPSWEBROOT . '/apps/calendar/caldav.php'; +if(substr($_SERVER["REQUEST_URI"],0,strlen(OC_App::getAppWebPath('calendar').'/caldav.php')) == OC_App::getAppWebPath('calendar'). '/caldav.php'){ + $baseuri = OC_App::getAppWebPath('calendar').'/caldav.php'; } // only need authentication apps diff --git a/apps/media/remote.php b/apps/media/remote.php index 01add42b31..0535077cef 100644 --- a/apps/media/remote.php +++ b/apps/media/remote.php @@ -5,7 +5,7 @@ $RUNTIME_APPTYPES=array('filesystem','authentication'); OC_App::loadApps($RUNTIME_APPTYPES); if($path_info == '/ampache' || $path_info == '/ampache/'){ - require_once(OC::$APPSROOT . '/apps/media/index.php'); + require_once(OC_App::getAppPath('media').'/index.php'); }else{ - require_once(OC::$APPSROOT . '/apps/media/server/xml.server.php'); + require_once(OC_App::getAppPath('media').'/server/xml.server.php'); } diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php index 6cb6c91ca0..796da130a4 100644 --- a/apps/media/server/xml.server.php +++ b/apps/media/server/xml.server.php @@ -22,8 +22,8 @@ */ OCP\App::checkAppEnabled('media'); - require_once(OC::$APPSROOT . '/apps/media/lib_collection.php'); - require_once(OC::$APPSROOT . '/apps/media/lib_ampache.php'); + require_once(OC_App::getAppPath('media').'/lib_collection.php'); + require_once(OC_App::getAppPath('media').'/lib_ampache.php'); $arguments=$_POST; if(!isset($_POST['action']) and isset($_GET['action'])){ diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php index e75c546c2c..67cbba54a4 100644 --- a/apps/user_webfinger/webfinger.php +++ b/apps/user_webfinger/webfinger.php @@ -59,7 +59,7 @@ echo "{\"links\":["; $apps = OC_Appconfig::getApps(); foreach($apps as $app) { if(OCP\App::isEnabled($app)) { - if(is_file(OC::$APPSROOT . '/apps/' . $app . '/appinfo/webfinger.php')) { + if(is_file(OC_App::getAppPath($app). '/appinfo/webfinger.php')) { require($app . '/appinfo/webfinger.php'); } } diff --git a/lib/app.php b/lib/app.php index 5883a29bb0..43d60f3a68 100755 --- a/lib/app.php +++ b/lib/app.php @@ -571,10 +571,10 @@ class OC_App{ //set remote/public handelers $appData=self::getAppInfo($appid); foreach($appData['remote'] as $name=>$path){ - OCP\CONFIG::setAppValue('core', 'remote_'.$name, '/apps/'.$appid.'/'.$path); + OCP\CONFIG::setAppValue('core', 'remote_'.$name, $path); } foreach($appData['public'] as $name=>$path){ - OCP\CONFIG::setAppValue('core', 'public_'.$name, '/apps/'.$appid.'/'.$path); + OCP\CONFIG::setAppValue('core', 'public_'.$name, $appid.'/'.$path); } self::setAppTypes($appid); diff --git a/lib/helper.php b/lib/helper.php index 550bf9771e..3cf5107eea 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -40,7 +40,7 @@ class OC_Helper { if( $app != '' ){ $app .= '/'; // Check if the app is in the app folder - if( file_exists( OC_App::getAppPath($app).$file )){ + if( file_exists( OC_App::getAppPath($app).'/'.$file )){ if(substr($file, -3) == 'php' || substr($file, -3) == 'css'){ if(substr($app, -1, 1) == '/'){ $app = substr($app, 0, strlen($app) - 1); diff --git a/lib/installer.php b/lib/installer.php index afe0b9e1bb..bfa34de2a7 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -197,10 +197,10 @@ class OC_Installer{ //set remote/public handelers foreach($info['remote'] as $name=>$path){ - OCP\CONFIG::setAppValue('core', 'remote_'.$name, '/apps/'.$info['id'].'/'.$path); + OCP\CONFIG::setAppValue('core', 'remote_'.$name, $app.'/'.$path); } foreach($info['public'] as $name=>$path){ - OCP\CONFIG::setAppValue('core', 'public_'.$name, '/apps/'.$info['id'].'/'.$path); + OCP\CONFIG::setAppValue('core', 'public_'.$name, $app.'/'.$path); } OC_App::setAppTypes($info['id']); @@ -287,22 +287,24 @@ class OC_Installer{ * This function installs all apps found in the 'apps' directory that should be enabled by default; */ public static function installShippedApps(){ - $dir = opendir( OC::$APPSROOT."/apps" ); - while( false !== ( $filename = readdir( $dir ))){ - if( substr( $filename, 0, 1 ) != '.' and is_dir(OC::$APPSROOT."/apps/$filename") ){ - if( file_exists( OC::$APPSROOT."/apps/$filename/appinfo/app.php" )){ - if(!OC_Installer::isInstalled($filename)){ - $info=OC_App::getAppInfo($filename); - $enabled = isset($info['default_enable']); - if( $enabled ){ - OC_Installer::installShippedApp($filename); - OC_Appconfig::setValue($filename,'enabled','yes'); + foreach(OC::$APPSROOTS as $app_dir) { + $dir = opendir( $app_dir['path'] ); + while( false !== ( $filename = readdir( $dir ))){ + if( substr( $filename, 0, 1 ) != '.' and is_dir($app_dir['path']."/$filename") ){ + if( file_exists( $app_dir['path']."/$filename/appinfo/app.php" )){ + if(!OC_Installer::isInstalled($filename)){ + $info=OC_App::getAppInfo($filename); + $enabled = isset($info['default_enable']); + if( $enabled ){ + OC_Installer::installShippedApp($filename); + OC_Appconfig::setValue($filename,'enabled','yes'); + } } } } } + closedir( $dir ); } - closedir( $dir ); } /** @@ -325,10 +327,10 @@ class OC_Installer{ //set remote/public handelers foreach($info['remote'] as $name=>$path){ - OCP\CONFIG::setAppValue('core', 'remote_'.$name, '/apps/'.$app.'/'.$path); + OCP\CONFIG::setAppValue('core', 'remote_'.$name, $app.'/'.$path); } foreach($info['public'] as $name=>$path){ - OCP\CONFIG::setAppValue('core', 'public_'.$name, '/apps/'.$app.'/'.$path); + OCP\CONFIG::setAppValue('core', 'public_'.$name, $app.'/'.$path); } OC_App::setAppTypes($info['id']); diff --git a/public.php b/public.php index f974e1c50d..19c02a7a02 100644 --- a/public.php +++ b/public.php @@ -8,8 +8,8 @@ if(is_null($file)){ exit; } -$parts=explode('/',$file); -$app=$parts[2]; +$parts=explode('/',$file,2); +$app=$parts[0]; OC_App::loadApp($app); -require_once(OC::$APPSROOT . $file); +require_once(OC_App::getAppPath($app) .'/'. $parts[1]); diff --git a/remote.php b/remote.php index 7131dfc940..55b088d775 100644 --- a/remote.php +++ b/remote.php @@ -17,9 +17,9 @@ if(is_null($file)){ exit; } -$parts=explode('/',$file); -$app=$parts[2]; +$parts=explode('/', $file, 2); +$app=$parts[0]; OC_App::loadApp($app); $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; -require_once(OC::$APPSROOT . $file); \ No newline at end of file +require_once(OC_App::getAppPath($app) .'/'. $parts[1]); \ No newline at end of file