diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php index 1f7e42e0d3e3b282487bd2e811e032ef93b95788..4b4a7f8948d4d2bbd1a2a19fec65484b79fa1285 100644 --- a/apps/files/ajax/download.php +++ b/apps/files/ajax/download.php @@ -21,12 +21,6 @@ * */ -// only need filesystem apps -$RUNTIME_APPTYPES=array('filesystem'); - -// Init owncloud - - // Check if we are a user OCP\User::checkLoggedIn(); \OC::$session->close(); diff --git a/apps/files/ajax/getstoragestats.php b/apps/files/ajax/getstoragestats.php index 17415b6933f09d4b1ef35241bada4d35db3ec946..dd8af39bada3ec55abb2c0fde56b000463823faa 100644 --- a/apps/files/ajax/getstoragestats.php +++ b/apps/files/ajax/getstoragestats.php @@ -1,8 +1,5 @@ <?php -// only need filesystem apps -$RUNTIME_APPTYPES = array('filesystem'); - $dir = '/'; if (isset($_GET['dir'])) { diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 667209599a012a45a9c72c2a352ae42a40fa3d0f..3bb35579d5fd177f5e5e86818428347735af823a 100644 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -1,11 +1,5 @@ <?php -// only need filesystem apps -$RUNTIME_APPTYPES=array('filesystem'); - -// Init owncloud - - OCP\JSON::checkLoggedIn(); \OC::$session->close(); diff --git a/apps/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php index 6c2569e2ebbc903d86d196ce55561724e3ea407a..f18bbffb74af980339038515439244d787ec0634 100644 --- a/apps/files/ajax/rawlist.php +++ b/apps/files/ajax/rawlist.php @@ -1,8 +1,5 @@ <?php -// only need filesystem apps -$RUNTIME_APPTYPES = array('filesystem'); - OCP\JSON::checkLoggedIn(); \OC::$session->close(); diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php index 826f72fb0e61f3b75fd73973823e659bb22fd661..a8acfdb6e6e3c52ced7bf1c8603d97844c8905eb 100644 --- a/apps/files/appinfo/remote.php +++ b/apps/files/appinfo/remote.php @@ -22,12 +22,6 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ -// load needed apps -$RUNTIME_APPTYPES = array('filesystem', 'authentication', 'logging'); - -OC_App::loadApps($RUNTIME_APPTYPES); - -OC_Util::obEnd(); // Backends $authBackend = new OC_Connector_Sabre_Auth(); diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php index f334f29a939e3002600212d079b22b45c6087c5f..25ab70af3629a7d50940c589f1b6cd41c52dd62b 100644 --- a/apps/files/command/scan.php +++ b/apps/files/command/scan.php @@ -58,7 +58,6 @@ class Scan extends Command { protected function execute(InputInterface $input, OutputInterface $output) { if ($input->getOption('all')) { - \OC_App::loadApps('authentication'); $users = $this->userManager->search(''); } else { $users = $input->getArgument('user_id'); diff --git a/apps/files_trashbin/ajax/list.php b/apps/files_trashbin/ajax/list.php index 124a236bcbd505ea904181e4f2ce909766bb28b2..cec18c46525dd63dd61daccf2dc7695e05bb2ea2 100644 --- a/apps/files_trashbin/ajax/list.php +++ b/apps/files_trashbin/ajax/list.php @@ -1,11 +1,5 @@ <?php -// only need filesystem apps -$RUNTIME_APPTYPES=array('filesystem'); - -// Init owncloud - - OCP\JSON::checkLoggedIn(); // Load the files diff --git a/console.php b/console.php index 25b8b312539309e2c4ff8b4dcdb29d98602e7470..dd2c1026e477ef1d345062517204db0d712961db 100644 --- a/console.php +++ b/console.php @@ -8,7 +8,6 @@ use Symfony\Component\Console\Application; -$RUNTIME_NOAPPS = true; require_once 'lib/base.php'; // Don't do anything if ownCloud has not been installed yet @@ -22,6 +21,9 @@ if (!OC::$CLI) { exit(0); } +// load all apps to get all api routes properly setup +OC_App::loadApps(); + $defaults = new OC_Defaults; $application = new Application($defaults->getName(), \OC_Util::getVersionString()); require_once 'core/register_command.php'; diff --git a/core/ajax/share.php b/core/ajax/share.php index 3f04e1e4ad14691830b8f6d06ef6c7191aaa36b9..e667d9b5faae6a282845ff361976d4aabd31daca 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -21,7 +21,6 @@ OC_JSON::checkLoggedIn(); OCP\JSON::callCheck(); -OC_App::loadApps(); $defaults = new \OCP\Defaults(); diff --git a/core/ajax/update.php b/core/ajax/update.php index 2a0cbb2036d6e59be5121e57abfc60942a169a6e..55e8ab15ec22800be2aee0787a990577b21e2269 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -1,6 +1,5 @@ <?php set_time_limit(0); -$RUNTIME_NOAPPS = true; require_once '../../lib/base.php'; if (OC::checkUpgrade(false)) { diff --git a/core/command/upgrade.php b/core/command/upgrade.php index cfccfb5d2f0363928c3d5cb5242c09c6e47b9c61..ed72d136e24b3c461dd4bcbafe029d80171b0065 100644 --- a/core/command/upgrade.php +++ b/core/command/upgrade.php @@ -34,9 +34,6 @@ class Upgrade extends Command { * @param OutputInterface $output output interface */ protected function execute(InputInterface $input, OutputInterface $output) { - global $RUNTIME_NOAPPS; - - $RUNTIME_NOAPPS = true; //no apps, yet require_once \OC::$SERVERROOT . '/lib/base.php'; diff --git a/core/command/user/report.php b/core/command/user/report.php index 70c5a8566b722bf432504fd1b4df923766d08cd5..a5159310af1b45d6f17a0b8db84b37acc2fe4877 100644 --- a/core/command/user/report.php +++ b/core/command/user/report.php @@ -46,7 +46,6 @@ class Report extends Command { } private function countUsers() { - \OC_App::loadApps(array('authentication')); $userManager = \OC::$server->getUserManager(); return $userManager->countUsers(); } @@ -56,4 +55,4 @@ class Report extends Command { $userDirectories = $dataview->getDirectoryContent('/', 'httpd/unix-directory'); return count($userDirectories); } -} \ No newline at end of file +} diff --git a/cron.php b/cron.php index 05d47124da062764b0681b7c5622085df00ef3dc..8fa72a319c0122405cb40c34ae232da4c0faceed 100644 --- a/cron.php +++ b/cron.php @@ -48,6 +48,9 @@ try { require_once 'lib/base.php'; + // load all apps to get all api routes properly setup + OC_App::loadApps(); + \OC::$session->close(); $logger = \OC_Log::$object; diff --git a/index.php b/index.php index 0a2f15f9f5e74de24e2b5da2d908b8ee62796b00..bd94d0e908d641123a814246ffa59ccbc69cffd1 100755 --- a/index.php +++ b/index.php @@ -21,8 +21,6 @@ * */ -$RUNTIME_NOAPPS = true; //no apps, yet - try { require_once 'lib/base.php'; diff --git a/lib/base.php b/lib/base.php index 2515b9657cbc8e5b5af626340ea238c83bbc42ac..4f1a0f58ef20dd4c4c9cadaf6e78cce7acbbe71a 100644 --- a/lib/base.php +++ b/lib/base.php @@ -549,16 +549,10 @@ class OC { OC_User::logout(); } - // Load Apps - // This includes plugins for users and filesystems as well - global $RUNTIME_NOAPPS; - global $RUNTIME_APPTYPES; - if (!$RUNTIME_NOAPPS && !self::checkUpgrade(false)) { - if ($RUNTIME_APPTYPES) { - OC_App::loadApps($RUNTIME_APPTYPES); - } else { - OC_App::loadApps(); - } + // Load minimum set of apps - which is filesystem, authentication and logging + if (!self::checkUpgrade(false)) { + OC_App::loadApps(array('authentication')); + OC_App::loadApps(array('filesystem', 'logging')); } //setup extra user backends @@ -851,7 +845,7 @@ class OC { ) { return false; } - OC_App::loadApps(array('authentication')); + if (defined("DEBUG") && DEBUG) { OC_Log::write('core', 'Trying to login from cookie', OC_Log::DEBUG); } @@ -923,7 +917,7 @@ class OC { ) { return false; } - OC_App::loadApps(array('authentication')); + if (OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) { //OC_Log::write('core',"Logged in with HTTP Authentication", OC_Log::DEBUG); OC_User::unsetMagicInCookie(); @@ -934,11 +928,6 @@ class OC { } -// define runtime variables - unless this already has been done -if (!isset($RUNTIME_NOAPPS)) { - $RUNTIME_NOAPPS = false; -} - if (!function_exists('get_temp_dir')) { function get_temp_dir() { if ($temp = ini_get('upload_tmp_dir')) return $temp; @@ -957,4 +946,3 @@ if (!function_exists('get_temp_dir')) { } OC::init(); - diff --git a/lib/private/user.php b/lib/private/user.php index a89b7286c1009e48525cf039ccd4ac41228a9fe4..dc4c7ec3b611fb7cc278080a8dab615bb4b4f697 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -321,8 +321,6 @@ class OC_User { */ public static function isLoggedIn() { if (\OC::$session->get('user_id') && self::$incognitoMode === false) { - OC_App::loadApps(array('authentication')); - self::setupBackends(); return self::userExists(\OC::$session->get('user_id')); } return false; diff --git a/lib/private/util.php b/lib/private/util.php index 87e173fa765da6af5e10580ef03251fccc91370f..cd152234cc94b6c78f4b335769ebbfad215dc4d3 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -30,9 +30,7 @@ class OC_Util { } // load all filesystem apps before, so no setup-hook gets lost - if(!isset($RUNTIME_NOAPPS) || !$RUNTIME_NOAPPS) { - OC_App::loadApps(array('filesystem')); - } + OC_App::loadApps(array('filesystem')); // the filesystem will finish when $user is not empty, // mark fs setup here to avoid doing the setup from loading diff --git a/ocs/v1.php b/ocs/v1.php index 5d360c530a9d35faa9f407decbac89f643f7b2b1..62a3511e611b6a40bb8d20f4295899a420b385db 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -21,11 +21,15 @@ * */ -require_once('../lib/base.php'); +require_once '../lib/base.php'; + use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\Exception\MethodNotAllowedException; try { + // load all apps to get all api routes properly setup + OC_App::loadApps(); + OC::$server->getRouter()->match('/ocs'.OC_Request::getRawPathInfo()); } catch (ResourceNotFoundException $e) { OC_API::setContentType(); diff --git a/public.php b/public.php index 767295b98db100476f1119488443df88191a3835..e072db93d29dc7b0daf6c896269ec17b3cc39168 100644 --- a/public.php +++ b/public.php @@ -1,5 +1,4 @@ <?php -$RUNTIME_NOAPPS = true; try { diff --git a/remote.php b/remote.php index 9e18c8f80a9dd207d001f7c2912b2e4b38fb9690..15dfa8256ff3c2e93158d4d484320995b711c550 100644 --- a/remote.php +++ b/remote.php @@ -1,5 +1,4 @@ <?php -$RUNTIME_NOAPPS = true; try { diff --git a/search/ajax/search.php b/search/ajax/search.php index f0ca5752b9a731a91a5ed6102c5d3b67c2259966..0cc1f9d30cd21c7b10c74d85e6c0fae25eefc67e 100644 --- a/search/ajax/search.php +++ b/search/ajax/search.php @@ -23,7 +23,6 @@ // Check if we are a user OC_JSON::checkLoggedIn(); -OC_App::loadApps(); $query=(isset($_GET['query']))?$_GET['query']:''; if($query) { diff --git a/settings/admin.php b/settings/admin.php index 23b3a2d5a0e765dab5f1fc86b1a2394d0b7e506c..ea8aa7af5d0a4bab2f895d9df6806409ae193018 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -6,7 +6,6 @@ */ OC_Util::checkAdminUser(); -OC_App::loadApps(); OC_Util::addStyle( "settings", "settings" ); OC_Util::addScript( "settings", "admin" ); diff --git a/settings/apps.php b/settings/apps.php index 96b6d21b50214d717423a27aa32d1a894543778d..6fd2efc2018020397daa17099692afa76a608e5c 100644 --- a/settings/apps.php +++ b/settings/apps.php @@ -22,7 +22,6 @@ */ OC_Util::checkAdminUser(); -OC_App::loadApps(); // Load the files we need OC_Util::addStyle( "settings", "settings" ); diff --git a/settings/changepassword/controller.php b/settings/changepassword/controller.php index e8c2a1943f3b0e28d156b7410c2662a83cd5fe07..9f1e732996412455e0dc9b5bb41a0815915ddf5b 100644 --- a/settings/changepassword/controller.php +++ b/settings/changepassword/controller.php @@ -8,9 +8,6 @@ class Controller { \OC_JSON::callCheck(); \OC_JSON::checkLoggedIn(); - // Manually load apps to ensure hooks work correctly (workaround for issue 1503) - \OC_App::loadApps(); - $username = \OC_User::getUser(); $password = isset($_POST['personal-password']) ? $_POST['personal-password'] : null; $oldPassword = isset($_POST['oldpassword']) ? $_POST['oldpassword'] : ''; @@ -32,9 +29,6 @@ class Controller { \OC_JSON::callCheck(); \OC_JSON::checkLoggedIn(); - // Manually load apps to ensure hooks work correctly (workaround for issue 1503) - \OC_App::loadApps(); - if (isset($_POST['username'])) { $username = $_POST['username']; } else { diff --git a/settings/help.php b/settings/help.php index 88693939b848375bea86c54265f797487f36de78..301f50592aed4396552774862b5479d0641f9025 100644 --- a/settings/help.php +++ b/settings/help.php @@ -6,7 +6,6 @@ */ OC_Util::checkLoggedIn(); -OC_App::loadApps(); // Load the files we need OC_Util::addStyle( "settings", "settings" ); diff --git a/settings/personal.php b/settings/personal.php index cf1a496bdf018ef7b7ff8d59d71540b82563aa32..be1aa6400bf63457f1d60201481bd6f6bb731352 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -6,7 +6,6 @@ */ OC_Util::checkLoggedIn(); -OC_App::loadApps(); $defaults = new OC_Defaults(); // initialize themable default strings and urls diff --git a/settings/settings.php b/settings/settings.php index 1e05452ec4d1b612e43720f9006f17275c97477c..c08732fcf66203aa6c647bc4ab8552725314d292 100644 --- a/settings/settings.php +++ b/settings/settings.php @@ -6,7 +6,6 @@ */ OC_Util::checkLoggedIn(); -OC_App::loadApps(); OC_Util::addStyle( 'settings', 'settings' ); OC_App::setActiveNavigationEntry( 'settings' ); diff --git a/settings/users.php b/settings/users.php index 2f1c63a0b59856900109f277c0ff93e5aa3366bd..f09d0e90d3c6bde5265a085450163153af0db743 100644 --- a/settings/users.php +++ b/settings/users.php @@ -6,7 +6,6 @@ */ OC_Util::checkSubAdminUser(); -OC_App::loadApps(); // We have some javascript foo! OC_Util::addScript( 'settings', 'users' ); diff --git a/status.php b/status.php index 88422100f14cf96afb6b637ecb139520efa8807e..861eaed9cd2638c3fe8ca3099d9f4ae811bb3981 100644 --- a/status.php +++ b/status.php @@ -21,8 +21,6 @@ * */ -$RUNTIME_NOAPPS = true; //no apps, yet - try { require_once 'lib/base.php';