From 2ba274de1d8f020638634530a36d0f7016df3407 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 31 Mar 2017 12:29:56 +0200 Subject: [PATCH] Condition positive --- library/WsScore/Saisie/v0.2/Service.php | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/library/WsScore/Saisie/v0.2/Service.php b/library/WsScore/Saisie/v0.2/Service.php index 8d28c456..7c7fea3f 100644 --- a/library/WsScore/Saisie/v0.2/Service.php +++ b/library/WsScore/Saisie/v0.2/Service.php @@ -1460,10 +1460,10 @@ class Saisie extends Scores_Ws_Server $row = $bilansM->fetchRow($sql); } catch (Zend_Db_Exception $e) { - if ($this->User->idClient!=1) { - throw new SoapFault('ERR', "Application error"); - } else { + if ($this->User->idClient == 1) { throw new SoapFault('ERR', $e->getMessage()); + } else { + throw new SoapFault('ERR', "Application error"); } } @@ -1493,10 +1493,10 @@ class Saisie extends Scores_Ws_Server try { $id = $bilansM->insert($dataToInsert); } catch (Zend_Db_Exception $e) { - if ($this->User->idClient!=1) { - throw new SoapFault('ERR', "Application error"); - } else { + if ($this->User->idClient == 1) { throw new SoapFault('ERR', $e->getMessage()); + } else { + throw new SoapFault('ERR', "Application error"); } } } @@ -1512,10 +1512,10 @@ class Saisie extends Scores_Ws_Server try { $historiquesM->insert($backupData); } catch (Zend_Db_Exception $e) { - if ($this->User->idClient!=1) { - throw new SoapFault('ERR', "Application error"); - } else { + if ($this->User->idClient == 1) { throw new SoapFault('ERR', $e->getMessage()); + } else { + throw new SoapFault('ERR', "Application error"); } } @@ -1540,10 +1540,10 @@ class Saisie extends Scores_Ws_Server try { $id = $bilansM->update($dataToUpdate, 'id = '.$row->id); } catch (Zend_Db_Exception $e) { - if ($this->User->idClient!=1) { - throw new SoapFault('ERR', "Application error"); - } else { + if ($this->User->idClient == 1) { throw new SoapFault('ERR', $e->getMessage()); + } else { + throw new SoapFault('ERR', "Application error"); } } @@ -1566,10 +1566,10 @@ class Saisie extends Scores_Ws_Server 'postesDiff' => implode(';', $postesDiff), )); } catch (Zend_Db_Exception $e) { - if ($this->User->idClient!=1) { - throw new SoapFault('ERR', "Application error"); - } else { + if ($this->User->idClient == 1) { throw new SoapFault('ERR', $e->getMessage()); + } else { + throw new SoapFault('ERR', "Application error"); } }