X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fcontrollers%2FPathController.php;h=48a22befd43930ef1d0f6a8036e28524c1ea347d;hb=a86eeac0ab678ea55307e1386c5f955f77d8ff73;hp=aa41866679103703bb66909032302ecd59fd645d;hpb=ec061a75fe57a25eb7ef0894f5e723397ba35472;p=syj.git diff --git a/application/controllers/PathController.php b/application/controllers/PathController.php index aa41866..48a22be 100644 --- a/application/controllers/PathController.php +++ b/application/controllers/PathController.php @@ -13,21 +13,25 @@ class PathController extends Zend_Controller_Action throw new Syj_Exception_Request(); } $path->creator = $user; - $path->creatorIp = $this->getRequest()->getClientIp(true); + $path->creatorIp = trim(end(split(',', $this->getRequest()->getClientIp(true)))); - return $this->save($path, $formData); + $this->save($path, $formData); + $data = array('redirect' => "idx/" . (string)$path->id); + $this->_helper->SyjApi->setCode(201)->setBodyJson($data); } public function updateAction() { $formData = $this->_helper->SyjPostData->getPostData('Syj_Form_Geom'); - return $this->save($this->getPath(), $formData); + $path = $this->getPath(); + $this->save($path, $formData); + $this->_helper->SyjApi->setCode(200); // we should use 204, but ie mangles 204 to 1223 } public function deleteAction() { $path = $this->getPath(); $pathMapper = new Syj_Model_PathMapper(); $pathMapper->delete ($path); - $this->_helper->SyjApi->setCode(204); + $this->_helper->SyjApi->setCode(200); // we should use 204, but ie mangles 204 to 1223 } public function getPath() { @@ -84,8 +88,6 @@ class PathController extends Zend_Controller_Action throw $e; } } - - $this->_helper->SyjApi->setBody($path->id); } }