| Line 195... |
Line 195... |
| 195 |
$idProposition = $this->creerPropositionDeterminationInitiale();
|
195 |
$idProposition = $this->creerPropositionDeterminationInitiale();
|
| 196 |
if ($idProposition == null) {
|
196 |
if ($idProposition == null) {
|
| 197 |
$msg = "Aucun identifiant de proposition n'est lié à cette observation.";
|
197 |
$msg = "Aucun identifiant de proposition n'est lié à cette observation.";
|
| 198 |
throw new Exception($msg, RestServeur::HTTP_CODE_MAUVAISE_REQUETE);
|
198 |
throw new Exception($msg, RestServeur::HTTP_CODE_MAUVAISE_REQUETE);
|
| 199 |
}
|
199 |
}
|
| - |
|
200 |
// protection anti-usurpateurs
|
| - |
|
201 |
/*$idUtilisateur = $this->parametres['utilisateur'];
|
| - |
|
202 |
$gestionUtilisateurs = $this->conteneur->getUtilisateur();
|
| - |
|
203 |
$gestionUtilisateurs->controleUtilisateurIdentifie($idUtilisateur);*/
|
| Line 200... |
Line 204... |
| 200 |
|
204 |
|
| 201 |
$idObsP = $this->bdd->proteger($this->ressources[0]);
|
205 |
$idObsP = $this->bdd->proteger($this->ressources[0]);
|
| 202 |
$idPropositionP = $this->bdd->proteger($idProposition);
|
206 |
$idPropositionP = $this->bdd->proteger($idProposition);
|
| 203 |
$idUtilisateurP = $this->bdd->proteger($this->parametres['utilisateur']);
|
207 |
$idUtilisateurP = $this->bdd->proteger($idUtilisateur);
|
| 204 |
$valeurP = $this->bdd->proteger($this->parametres['valeur']);
|
208 |
$valeurP = $this->bdd->proteger($this->parametres['valeur']);
|
| 205 |
$requete = 'UPDATE del_commentaire_vote '.
|
209 |
$requete = 'UPDATE del_commentaire_vote '.
|
| 206 |
"SET valeur = $valeurP, date = NOW() ".
|
210 |
"SET valeur = $valeurP, date = NOW() ".
|
| 207 |
"WHERE ce_proposition = $idPropositionP AND ce_utilisateur = $idUtilisateurP ".
|
211 |
"WHERE ce_proposition = $idPropositionP AND ce_utilisateur = $idUtilisateurP ".
|
| Line 208... |
Line 212... |
| 208 |
' -- '.__FILE__.' : '.__LINE__;
|
212 |
' -- '.__FILE__.' : '.__LINE__;
|
| 209 |
|
213 |
|
| 210 |
$resultat = $this->bdd->executer($requete);
|
214 |
$resultat = $this->bdd->executer($requete);
|
| 211 |
if ($resultat === false) {
|
215 |
if ($resultat === false) {
|
| 212 |
$msg = "Un erreur est survenu lors de la tentative de modification du vote.";
|
216 |
$msg = "Une erreur est survenue lors de la tentative de modification du vote.";
|
| 213 |
throw new Exception($msg, RestServeur::HTTP_CODE_ERREUR);
|
217 |
throw new Exception($msg, RestServeur::HTTP_CODE_ERREUR);
|
| 214 |
} else if ($resultat === 0) {
|
218 |
} else if ($resultat === 0) {
|
| 215 |
$msg = "Aucun vote ne correspond au critères fournis : ".
|
219 |
$msg = "Aucun vote ne correspond au critères fournis : ".
|