Merge pull request #7107 from owncloud/load-apps-proper-master
Load apps proper master
This commit is contained in:
commit
5fa8f7cf12
|
@ -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();
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
<?php
|
||||
|
||||
// only need filesystem apps
|
||||
$RUNTIME_APPTYPES = array('filesystem');
|
||||
|
||||
$dir = '/';
|
||||
|
||||
if (isset($_GET['dir'])) {
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
<?php
|
||||
|
||||
// only need filesystem apps
|
||||
$RUNTIME_APPTYPES=array('filesystem');
|
||||
|
||||
// Init owncloud
|
||||
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
\OC::$session->close();
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
<?php
|
||||
|
||||
// only need filesystem apps
|
||||
$RUNTIME_APPTYPES = array('filesystem');
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
\OC::$session->close();
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
<?php
|
||||
|
||||
// only need filesystem apps
|
||||
$RUNTIME_APPTYPES=array('filesystem');
|
||||
|
||||
// Init owncloud
|
||||
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
|
||||
// Load the files
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
OC_JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
OC_App::loadApps();
|
||||
|
||||
$defaults = new \OCP\Defaults();
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
set_time_limit(0);
|
||||
$RUNTIME_NOAPPS = true;
|
||||
require_once '../../lib/base.php';
|
||||
|
||||
if (OC::checkUpgrade(false)) {
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
3
cron.php
3
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;
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
$RUNTIME_NOAPPS = true; //no apps, yet
|
||||
|
||||
try {
|
||||
|
||||
require_once 'lib/base.php';
|
||||
|
|
24
lib/base.php
24
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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
$RUNTIME_NOAPPS = true;
|
||||
|
||||
try {
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
$RUNTIME_NOAPPS = true;
|
||||
|
||||
try {
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
// Check if we are a user
|
||||
OC_JSON::checkLoggedIn();
|
||||
OC_App::loadApps();
|
||||
|
||||
$query=(isset($_GET['query']))?$_GET['query']:'';
|
||||
if($query) {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
OC_Util::checkAdminUser();
|
||||
OC_App::loadApps();
|
||||
|
||||
OC_Util::addStyle( "settings", "settings" );
|
||||
OC_Util::addScript( "settings", "admin" );
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
*/
|
||||
|
||||
OC_Util::checkAdminUser();
|
||||
OC_App::loadApps();
|
||||
|
||||
// Load the files we need
|
||||
OC_Util::addStyle( "settings", "settings" );
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
OC_Util::checkLoggedIn();
|
||||
OC_App::loadApps();
|
||||
|
||||
// Load the files we need
|
||||
OC_Util::addStyle( "settings", "settings" );
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
OC_Util::checkLoggedIn();
|
||||
OC_App::loadApps();
|
||||
|
||||
$defaults = new OC_Defaults(); // initialize themable default strings and urls
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
OC_Util::checkLoggedIn();
|
||||
OC_App::loadApps();
|
||||
|
||||
OC_Util::addStyle( 'settings', 'settings' );
|
||||
OC_App::setActiveNavigationEntry( 'settings' );
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
OC_Util::checkSubAdminUser();
|
||||
OC_App::loadApps();
|
||||
|
||||
// We have some javascript foo!
|
||||
OC_Util::addScript( 'settings', 'users' );
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
$RUNTIME_NOAPPS = true; //no apps, yet
|
||||
|
||||
try {
|
||||
|
||||
require_once 'lib/base.php';
|
||||
|
|
Loading…
Reference in New Issue