issue #0001470 : add method setSurveillancesMail
This commit is contained in:
parent
db385a6c54
commit
2d6817a4d0
6
application/models/Sdv1SurveillancesSite.php
Normal file
6
application/models/Sdv1SurveillancesSite.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
class Application_Model_Sdv1SurveillancesSite extends Zend_Db_Table_Abstract
|
||||||
|
{
|
||||||
|
protected $_name = 'surveillances_site';
|
||||||
|
protected $_schema = 'sdv1';
|
||||||
|
}
|
@ -1839,6 +1839,8 @@ class Gestion extends WsScore
|
|||||||
*/
|
*/
|
||||||
public function setParam($element, $idClient, $service, $login=null)
|
public function setParam($element, $idClient, $service, $login=null)
|
||||||
{
|
{
|
||||||
|
$this->authenticate();
|
||||||
|
|
||||||
$element = strtoupper($element);
|
$element = strtoupper($element);
|
||||||
if ( !in_array($element, array('IP', 'ACCESS')) ) {
|
if ( !in_array($element, array('IP', 'ACCESS')) ) {
|
||||||
throw new SoapFault('ERR', 'Invalid parameters');
|
throw new SoapFault('ERR', 'Invalid parameters');
|
||||||
@ -1885,6 +1887,33 @@ class Gestion extends WsScore
|
|||||||
return true;
|
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
|
* Remove access to the children
|
||||||
|
Loading…
x
Reference in New Issue
Block a user