Make the core ajax calls use the router
This commit is contained in:
parent
bb136b9adf
commit
de1bfe9d6b
9 changed files with 22 additions and 10 deletions
|
@ -5,7 +5,6 @@
|
|||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
require_once "../../lib/base.php";
|
||||
OC_Util::checkAdminUser();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
* @return json: success/error state indicator including a fresh request token
|
||||
* @author Christian Reiner
|
||||
*/
|
||||
require_once '../../lib/base.php';
|
||||
|
||||
// don't load apps or filesystem for this task
|
||||
$RUNTIME_NOAPPS = TRUE;
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
require_once '../../lib/base.php';
|
||||
|
||||
OC_JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
// Init owncloud
|
||||
require_once '../../lib/base.php';
|
||||
|
||||
$app = $_POST["app"];
|
||||
|
||||
$l = OC_L10N::get( $app );
|
||||
|
|
|
@ -14,7 +14,6 @@ function debug($msg) {
|
|||
OC_Log::write('core', 'ajax/vcategories/add.php: '.$msg, OC_Log::DEBUG);
|
||||
}
|
||||
|
||||
require_once '../../../lib/base.php';
|
||||
OC_JSON::checkLoggedIn();
|
||||
$category = isset($_GET['category'])?strip_tags($_GET['category']):null;
|
||||
$app = isset($_GET['app'])?$_GET['app']:null;
|
||||
|
|
|
@ -15,7 +15,6 @@ function debug($msg) {
|
|||
OC_Log::write('core', 'ajax/vcategories/delete.php: '.$msg, OC_Log::DEBUG);
|
||||
}
|
||||
|
||||
require_once '../../../lib/base.php';
|
||||
OC_JSON::checkLoggedIn();
|
||||
$app = isset($_POST['app'])?$_POST['app']:null;
|
||||
$categories = isset($_POST['categories'])?$_POST['categories']:null;
|
||||
|
|
|
@ -15,7 +15,6 @@ function debug($msg) {
|
|||
OC_Log::write('core', 'ajax/vcategories/edit.php: '.$msg, OC_Log::DEBUG);
|
||||
}
|
||||
|
||||
require_once '../../../lib/base.php';
|
||||
OC_JSON::checkLoggedIn();
|
||||
$app = isset($_GET['app'])?$_GET['app']:null;
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ var OC={
|
|||
}
|
||||
link+=file;
|
||||
}else{
|
||||
if (app == 'settings' && type == 'ajax') {
|
||||
if ((app == 'settings' || app == 'core') && type == 'ajax') {
|
||||
link+='/index.php/';
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -8,6 +8,27 @@
|
|||
|
||||
require_once('settings/routes.php');
|
||||
|
||||
// Core ajax actions
|
||||
// AppConfig
|
||||
$this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
|
||||
->actionInclude('core/ajax/appconfig.php');
|
||||
// RequestToken
|
||||
$this->create('core_ajax_requesttoken', '/core/ajax/requesttoken.php')
|
||||
->actionInclude('core/ajax/requesttoken.php');
|
||||
// Share
|
||||
$this->create('core_ajax_share', '/core/ajax/share.php')
|
||||
->actionInclude('core/ajax/share.php');
|
||||
// Translations
|
||||
$this->create('core_ajax_translations', '/core/ajax/translations.php')
|
||||
->actionInclude('core/ajax/translations.php');
|
||||
// VCategories
|
||||
$this->create('core_ajax_vcategories_add', '/core/ajax/vcategories/add.php')
|
||||
->actionInclude('core/ajax/vcategories/add.php');
|
||||
$this->create('core_ajax_vcategories_delete', '/core/ajax/vcategories/delete.php')
|
||||
->actionInclude('core/ajax/vcategories/delete.php');
|
||||
$this->create('core_ajax_vcategories_edit', '/core/ajax/vcategories/edit.php')
|
||||
->actionInclude('core/ajax/vcategories/edit.php');
|
||||
|
||||
// Not specifically routed
|
||||
$this->create('app_css', '/apps/{app}/{file}')
|
||||
->requirements(array('file' => '.*.css'))
|
||||
|
|
Loading…
Reference in a new issue