]> git.andy128k.dev Git - ipf.git/commitdiff
component reorder: check http method in routes
authorAndrey Kutejko <andy128k@gmail.com>
Tue, 6 Jan 2015 09:31:37 +0000 (11:31 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Tue, 6 Jan 2015 09:31:37 +0000 (11:31 +0200)
ipf/admin/app.php
ipf/admin/controllers/components.php

index 27f8f524e71919b02a71a4f26a91a5cb3259bba4..035bde565af49aadabda5859427f933264dd7726 100644 (file)
@@ -21,7 +21,7 @@ class IPF_Admin_App extends IPF_Application
             )),
             array('controller' => 'IPF_Admin_Components_Controller', 'urls' => array(
                 array('regex' => '([\w\_\-]+)/([\w\_\-]+)/$#i',                     'func' => 'listItems'),
-                array('regex' => '([\w\_\-]+)/([\w\_\-]+)/reorder/$#i',             'func' => 'reorder'),
+                array('regex' => '([\w\_\-]+)/([\w\_\-]+)/reorder/$#i',             'func' => 'reorder', 'method' => 'POST'),
                 array('regex' => '([\w\_\-]+)/([\w\_\-]+)/add/$#i',                 'func' => 'addItem'),
                 array('regex' => '([\w\_\-]+)/([\w\_\-]+)/([\w\_\-]+)/$#i',         'func' => 'editItem'),
                 array('regex' => '([\w\_\-]+)/([\w\_\-]+)/([\w\_\-]+)/delete/$#i',  'func' => 'deleteItem'),
index 89954d3c853ea709de448a27e058d05b8d6bcac3..268333f34c110f57c9fa7db969046b73c8fb3f06 100644 (file)
@@ -42,7 +42,7 @@ class IPF_Admin_Components_Controller extends IPF_Admin_Base_Controller
     {
         $component = $this->getComponent(array('view', 'change'));
 
-        if ($this->request->method != 'POST' || !isset($this->request->POST['ids']) || !is_array($this->request->POST['ids']))
+        if (!isset($this->request->POST['ids']) || !is_array($this->request->POST['ids']))
             return new IPF_HTTP_Response_NotFound($request);
 
         if ($component->reorder($this->request->POST['ids']))