diff --git a/application/models/Sdv1SurveillancesSite.php b/application/models/Sdv1SurveillancesSite.php new file mode 100644 index 00000000..42163eac --- /dev/null +++ b/application/models/Sdv1SurveillancesSite.php @@ -0,0 +1,6 @@ +authenticate(); + $element = strtoupper($element); if ( !in_array($element, array('IP', 'ACCESS')) ) { throw new SoapFault('ERR', 'Invalid parameters'); @@ -1885,6 +1887,33 @@ class Gestion extends WsScore return true; } + /** + * Override email(s) in surveillances + * @param string $login + * @param string $email + * @throws SoapFault + * @return int + */ + public function setSurveillancesMail($login, $email) + { + $this->authenticate(); + + try { + $surveillanceM = new Application_Model_Sdv1SurveillancesSite(); + $result = $surveillanceM->update(array('email'=>$email), "login='$login'"); + } catch (Zend_Db_Adapter_Exception $e) { + if ($this->tabInfoUser['idClient']==1) { + throw new SoapFault('ERR', $e->getMessage()); + } else { + throw new SoapFault('ERR', "Application error"); + } + } catch (Zend_Exception $e) { + throw new SoapFault('ERR', "Application error"); + } + + return $result; + } + /** * Remove access to the children