Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/apps.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2012-11-28 00:09:26 +0400
committerBernhard Posselt <nukeawhale@gmail.com>2012-11-28 00:09:26 +0400
commit460a69dd0be973dd6aee2094e5645f394e7b0c95 (patch)
treec52d2b3a2a1849d931f74c3ff586b074a1bb3032 /apptemplate
parent01040a64a11532ef0384915928db45fe72703083 (diff)
removed duplication from ajax route
Diffstat (limited to 'apptemplate')
-rw-r--r--apptemplate/appinfo/routes.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/apptemplate/appinfo/routes.php b/apptemplate/appinfo/routes.php
index b051ef19e..86f173aea 100644
--- a/apptemplate/appinfo/routes.php
+++ b/apptemplate/appinfo/routes.php
@@ -32,16 +32,17 @@ require_once \OC_App::getAppPath('apptemplate') . '/appinfo/bootstrap.php';
* stored in the DI container
* @param string $methodName: the method that you want to call
* @param array $urlParams: an array with variables extracted from the routes
+ * @param bool $isAjax: if the request is an ajax request
* @param bool $disableAdminCheck: disables the check for adminuser rights
* @param bool $disableIsInAdminGroupCheck: disables the check for admin group member
*/
-function callController($controllerName, $methodName, $urlParams,
+function callController($controllerName, $methodName, $urlParams, $isAjax=false,
$disableAdminCheck=true, $disableIsInAdminGroupCheck=true){
$container = createDIContainer();
// run security checks
$security = $container['Security'];
- runSecurityChecks($security);
+ runSecurityChecks($security, $isAjax, $disableAdminCheck, $disableIsInAdminGroupCheck);
// call the controller and render the page
$controller = $container[$controllerName];
@@ -84,7 +85,7 @@ function runSecurityChecks($security, $isAjax=false, $disableAdminCheck=true,
*/
$this->create('apptemplate_index', '/')->action(
function($params){
- callController('IndexController', 'index', $params, true);
+ callController('IndexController', 'index', $params);
}
);
@@ -93,12 +94,6 @@ $this->create('apptemplate_index', '/')->action(
*/
$this->create('apptemplate_ajax_setsystemvalue', '/setsystemvalue')->post()->action(
function($params){
- $container = createDIContainer();
-
- $security = $container['Security'];
- $security->runChecks();
-
- $controller = $container[$controllerName];
- $container->setsystemvalue($params);
+ callController('AjaxController', 'setSystemValue', $params, true);
}
); \ No newline at end of file