Email et paramètres utilisateur

This commit is contained in:
Michael RICOIS 2016-09-07 11:30:42 +02:00
parent 0e0f9716fe
commit f055c91aaa
2 changed files with 73 additions and 49 deletions

View File

@ -948,6 +948,8 @@ class Account extends Scores_Ws_Server
$email = new Email();
$email->id = $item->id;
$email->value = $item->email;
$email->valid = $item->valid;
$email->monitor = $item->monitor;
$emails[] = $email;
}
@ -1154,33 +1156,33 @@ class Account extends Scores_Ws_Server
$userM = new Application_Model_Sdv1Utilisateurs();
$userData = array(
'idClient' => $values->idClient,
'login' => trim($values->login),
'email' => strtolower(trim($values->email)),
'password' => '',
'actif' => 1,
'deleted' => 0,
'typeCompte' => 'PROD',
'civilite' => $values->civilite,
'nom' => trim($values->nom),
'prenom' => trim($values->prenom),
'profil' => 'Utilisateur',
'droits' => '',
'referenceParDefaut' => '',
'nbReponses' => 10,
'lang' => 'fr',
'formatMail' => 'txt2',
'lienExtranetMail' => 0,
'lienSurvFic' => 0,
'idSurvFic' => '',
'loginCptSurvFic' => '',
'listeEven' => '',
);
// --- Création
if ( $id === null ) {
$userData = array(
'idClient' => $values->idClient,
'login' => trim($values->login),
'email' => strtolower(trim($values->email)),
'password' => '',
'actif' => 1,
'deleted' => 0,
'typeCompte' => 'PROD',
'civilite' => $values->civilite,
'nom' => trim($values->nom),
'prenom' => trim($values->prenom),
'profil' => 'Utilisateur',
'droits' => '',
'referenceParDefaut' => '',
'nbReponses' => 10,
'lang' => 'fr',
'formatMail' => 'txt2',
'lienExtranetMail' => 0,
'lienSurvFic' => 0,
'idSurvFic' => '',
'loginCptSurvFic' => '',
'listeEven' => '',
);
$sql = $userM->select()->where('login=?', $values->login);
$row = $userM->fetchRow($sql);
// --- Utilisateur existant
@ -1219,17 +1221,14 @@ class Account extends Scores_Ws_Server
// --- Modification
else {
$userData = array();
$sql = $userM->select()->where('id=?', $id);
$row = $userM->fetchRow($sql);
if ( null === $row ) {
throw new SoapFault('ERR', "User doesn't exist");
}
// --- Prepare data to update
foreach ($row as $key => $value) {
if (array_key_exists($key, $userData)) {
$userData[$key] = trim($value);
}
}
foreach ($values as $key => $value) {
if (array_key_exists($key, $userData)) {
$userData[$key] = trim($value);

View File

@ -1,48 +1,48 @@
<?php
class LoginUser
class LoginUser
{
/** @var string */
public $id;
/** @var string */
public $ClientId;
/** @var string */
public $ServiceCode;
/** @var string */
public $Login;
/** @var string */
public $Civilite;
/** @var string */
public $Nom;
/** @var string */
public $Prenom;
/** @var string */
public $Email;
/** @var string */
public $Profil;
/** @var string[] */
public $Access;
/** @var string */
public $Pref;
/** @var string */
public $ScoreType;
/** @var string */
public $CguDate;
/** @var string */
public $Timeout;
/** @var string */
public $Lang;
}
@ -218,10 +218,10 @@ class UserList
/** @var string */
public $Prenom;
/** @var string */
/** @var int */
public $Enable;
/** @var string */
/** @var int */
public $Delete;
}
@ -254,15 +254,15 @@ class User
/** @var string */
public $Prenom;
/** @var string */
/** @var int */
public $Enable;
/** @var string */
/** @var int */
public $Delete;
/** @var boolean */
public $AccesOverride = false;
/** @var Acces[] */
public $Acces;
@ -341,3 +341,28 @@ class UserLogItem
/** @var string */
public $Date;
}
class Email
{
/** @var int */
public $id;
/**
* Valeur de l'email
* @var string
*/
public $value;
/**
* Email validé
* @var int
*/
public $valid;
/**
* Email pour la surveillance
* @var int
*/
public $monitor;
}