]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/PathController.php
fixes: some error were not handled correctly when uploading path as file
[syj.git] / application / controllers / PathController.php
index 375b83e8e32c798dbcdbe956a3be3000f74f3a4e..f0ef477e0969fdd32a6911aced09276a453ed689 100644 (file)
@@ -8,7 +8,7 @@ class PathController extends Zend_Controller_Action
         $formData = $this->_helper->SyjPostData->getPostData('Syj_Form_Geom');
         $path = new Syj_Model_Path();
 
-        $user = $this->_helper->SyjSession->user();
+        $user = $this->_helper->SyjUserManager->current();
         if (!$user and !$formData["geom_accept"]) {
             throw new Syj_Exception_Request();
         }
@@ -52,7 +52,7 @@ class PathController extends Zend_Controller_Action
             }
         }
 
-        $user = $this->_helper->SyjSession->user();
+        $user = $this->_helper->SyjUserManager->current();
         if (!$path->isCreator($user)) {
             throw new Syj_Exception_Forbidden();
         }
@@ -78,7 +78,7 @@ class PathController extends Zend_Controller_Action
         }
 
         if ($geom::name != "LineString") {
-            throw new Syj_Exception_Request();
+            throw new Syj_Exception_InvalidGeomUpload();
         }
         $path->geom = $geom;
 
@@ -96,7 +96,7 @@ class PathController extends Zend_Controller_Action
             if ($e->getCode() == 23505) { // 23505: Unique violation throw new Syj_Exception_Request();
                 $message = $e->getMessage();
                 if (strpos($message, 'paths_geom_key') !== false) {
-                    throw new Syj_Exception_Request("uniquepath");
+                    throw new Syj_Exception_InvalidGeomUpload("uniquepath");
                 } else {
                     throw $e;
                 }