Merge pull request #10522 from owncloud/removeLoadAppScript

Remove loadAppScriptFile
This commit is contained in:
blizzz 2014-08-21 19:59:31 +02:00
commit 52d5429768
9 changed files with 86 additions and 42 deletions

View File

@ -6,6 +6,33 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
/** @var $this OC\Route\Router */
$this->create('files_index', '/')
->actionInclude('files/index.php');
$this->create('files_ajax_delete', 'ajax/delete.php')
->actionInclude('files/ajax/delete.php');
$this->create('files_ajax_download', 'ajax/download.php')
->actionInclude('files/ajax/download.php');
$this->create('files_ajax_getstoragestats', 'ajax/getstoragestats.php')
->actionInclude('files/ajax/getstoragestats.php');
$this->create('files_ajax_list', 'ajax/list.php')
->actionInclude('files/ajax/list.php');
$this->create('files_ajax_mimeicon', 'ajax/mimeicon.php')
->actionInclude('files/ajax/mimeicon.php');
$this->create('files_ajax_move', 'ajax/move.php')
->actionInclude('files/ajax/move.php');
$this->create('files_ajax_newfile', 'ajax/newfile.php')
->actionInclude('files/ajax/newfile.php');
$this->create('files_ajax_newfolder', 'ajax/newfolder.php')
->actionInclude('files/ajax/newfolder.php');
$this->create('files_ajax_rename', 'ajax/rename.php')
->actionInclude('files/ajax/rename.php');
$this->create('files_ajax_scan', 'ajax/scan.php')
->actionInclude('files/ajax/scan.php');
$this->create('files_ajax_upload', 'ajax/upload.php')
->actionInclude('files/ajax/upload.php');
$this->create('download', 'download{file}') $this->create('download', 'download{file}')
->requirements(array('file' => '.*')) ->requirements(array('file' => '.*'))
->actionInclude('files/download.php'); ->actionInclude('files/download.php');

View File

@ -5,5 +5,18 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
/** @var $this \OCP\Route\IRouter */
$this->create('files_encryption_ajax_adminrecovery', 'ajax/adminrecovery.php')
->actionInclude('files_encryption/ajax/adminrecovery.php');
$this->create('files_encryption_ajax_changeRecoveryPassword', 'ajax/changeRecoveryPassword.php')
->actionInclude('files_encryption/ajax/changeRecoveryPassword.php');
$this->create('files_encryption_ajax_getMigrationStatus', 'ajax/getMigrationStatus.php')
->actionInclude('files_encryption/ajax/getMigrationStatus.php');
$this->create('files_encryption_ajax_updatePrivateKeyPassword', 'ajax/updatePrivateKeyPassword.php')
->actionInclude('files_encryption/ajax/updatePrivateKeyPassword.php');
$this->create('files_encryption_ajax_userrecovery', 'ajax/userrecovery.php')
->actionInclude('files_encryption/ajax/userrecovery.php');
// Register with the capabilities API // Register with the capabilities API
OC_API::register('get', '/cloud/capabilities', array('OCA\Encryption\Capabilities', 'getCapabilities'), 'files_encryption', OC_API::USER_AUTH); OC_API::register('get', '/cloud/capabilities', array('OCA\Encryption\Capabilities', 'getCapabilities'), 'files_encryption', OC_API::USER_AUTH);

View File

@ -5,10 +5,14 @@ $this->create('core_ajax_public_preview', '/publicpreview')->action(
require_once __DIR__ . '/../ajax/publicpreview.php'; require_once __DIR__ . '/../ajax/publicpreview.php';
}); });
$this->create('sharing_external_shareinfo', '/shareinfo')->actionInclude('files_sharing/ajax/shareinfo.php'); $this->create('files_sharing_ajax_list', 'ajax/list.php')
$this->create('sharing_external_add', '/external')->actionInclude('files_sharing/ajax/external.php'); ->actionInclude('files_sharing/ajax/list.php');
$this->create('sharing_external_test_remote', '/testremote')->actionInclude('files_sharing/ajax/testremote.php'); $this->create('sharing_external_shareinfo', '/shareinfo')
->actionInclude('files_sharing/ajax/shareinfo.php');
$this->create('sharing_external_add', '/external')
->actionInclude('files_sharing/ajax/external.php');
$this->create('sharing_external_test_remote', '/testremote')
->actionInclude('files_sharing/ajax/testremote.php');
// OCS API // OCS API
//TODO: SET: mail notification, waiting for PR #4689 to be accepted //TODO: SET: mail notification, waiting for PR #4689 to be accepted

View File

@ -4,3 +4,12 @@ $this->create('core_ajax_trashbin_preview', '/preview')->action(
function() { function() {
require_once __DIR__ . '/../ajax/preview.php'; require_once __DIR__ . '/../ajax/preview.php';
}); });
$this->create('files_trashbin_ajax_delete', 'ajax/delete.php')
->actionInclude('files_trashbin/ajax/delete.php');
$this->create('files_trashbin_ajax_isEmpty', 'ajax/isEmpty.php')
->actionInclude('files_trashbin/ajax/isEmpty.php');
$this->create('files_trashbin_ajax_list', 'ajax/list.php')
->actionInclude('files_trashbin/ajax/list.php');
$this->create('files_trashbin_ajax_undelete', 'ajax/undelete.php')
->actionInclude('files_trashbin/ajax/undelete.php');

View File

@ -11,5 +11,10 @@ function() {
require_once __DIR__ . '/../ajax/preview.php'; require_once __DIR__ . '/../ajax/preview.php';
}); });
$this->create('files_versions_ajax_getVersions', 'ajax/getVersions.php')
->actionInclude('files_versions/ajax/getVersions.php');
$this->create('files_versions_ajax_rollbackVersion', 'ajax/rollbackVersion.php')
->actionInclude('files_versions/ajax/rollbackVersion.php');
// Register with the capabilities API // Register with the capabilities API
OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH); OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH);

View File

@ -0,0 +1,22 @@
<?php
/**
* Copyright (c) 2014, Lukas Reschke <lukas@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
/** @var $this \OCP\Route\IRouter */
$this->create('user_ldap_ajax_clearMappings', 'ajax/clearMappings.php')
->actionInclude('user_ldap/ajax/clearMappings.php');
$this->create('user_ldap_ajax_deleteConfiguration', 'ajax/deleteConfiguration.php')
->actionInclude('user_ldap/ajax/deleteConfiguration.php');
$this->create('user_ldap_ajax_getConfiguration', 'ajax/getConfiguration.php')
->actionInclude('user_ldap/ajax/getConfiguration.php');
$this->create('user_ldap_ajax_getNewServerConfigPrefix', 'ajax/getNewServerConfigPrefix.php')
->actionInclude('user_ldap/ajax/getNewServerConfigPrefix.php');
$this->create('user_ldap_ajax_setConfiguration', 'ajax/setConfiguration.php')
->actionInclude('user_ldap/ajax/setConfiguration.php');
$this->create('user_ldap_ajax_testConfiguration', 'ajax/testConfiguration.php')
->actionInclude('user_ldap/ajax/testConfiguration.php');
$this->create('user_ldap_ajax_wizard', 'ajax/wizard.php')
->actionInclude('user_ldap/ajax/wizard.php');

View File

@ -1,6 +1,5 @@
<?php <?php
set_time_limit(0); set_time_limit(0);
require_once '../../lib/base.php';
if (OC::checkUpgrade(false)) { if (OC::checkUpgrade(false)) {
$l = new \OC_L10N('core'); $l = new \OC_L10N('core');

View File

@ -80,7 +80,8 @@ $this->create('core_ajax_preview', '/core/preview')
->actionInclude('core/ajax/preview.php'); ->actionInclude('core/ajax/preview.php');
$this->create('core_ajax_preview', '/core/preview.png') $this->create('core_ajax_preview', '/core/preview.png')
->actionInclude('core/ajax/preview.php'); ->actionInclude('core/ajax/preview.php');
$this->create('core_ajax_update', '/core/ajax/update.php')
->actionInclude('core/ajax/update.php');
// Avatar routes // Avatar routes
$this->create('core_avatar_get_tmp', '/avatar/tmp') $this->create('core_avatar_get_tmp', '/avatar/tmp')
->get() ->get()
@ -98,16 +99,6 @@ $this->create('core_avatar_post_cropped', '/avatar/cropped')
->post() ->post()
->action('OC\Core\Avatar\Controller', 'postCroppedAvatar'); ->action('OC\Core\Avatar\Controller', 'postCroppedAvatar');
// Not specifically routed
$this->create('app_index_script', '/apps/{app}/')
->defaults(array('file' => 'index.php'))
//->requirements(array('file' => '.*.php'))
->action('OC', 'loadAppScriptFile');
$this->create('app_script', '/apps/{app}/{file}')
->defaults(array('file' => 'index.php'))
->requirements(array('file' => '.*.php'))
->action('OC', 'loadAppScriptFile');
// used for heartbeat // used for heartbeat
$this->create('heartbeat', '/heartbeat')->action(function(){ $this->create('heartbeat', '/heartbeat')->action(function(){
// do nothing // do nothing

View File

@ -801,32 +801,6 @@ class OC {
} }
} }
/**
* Load a PHP file belonging to the specified application
* @param array $param The application and file to load
* @return bool Whether the file has been found (will return 404 and false if not)
* @deprecated This function will be removed in ownCloud 8 - use proper routing instead
* @param $param
* @return bool Whether the file has been found (will return 404 and false if not)
*/
public static function loadAppScriptFile($param) {
OC_App::loadApps();
$app = $param['app'];
$file = $param['file'];
$app_path = OC_App::getAppPath($app);
$file = $app_path . '/' . $file;
if (OC_App::isEnabled($app) && $app_path !== false && OC_Helper::issubdirectory($file, $app_path)) {
unset($app, $app_path);
if (file_exists($file)) {
require_once $file;
return true;
}
}
header('HTTP/1.0 404 Not Found');
return false;
}
protected static function handleAuthHeaders() { protected static function handleAuthHeaders() {
//copy http auth headers for apache+php-fcgid work around //copy http auth headers for apache+php-fcgid work around
if (isset($_SERVER['HTTP_XAUTHORIZATION']) && !isset($_SERVER['HTTP_AUTHORIZATION'])) { if (isset($_SERVER['HTTP_XAUTHORIZATION']) && !isset($_SERVER['HTTP_AUTHORIZATION'])) {