Subversion Repositories eFlore/Applications.cel

Rev

Rev 1877 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1877 Rev 1906
Line 57... Line 57...
57
			header("Content-Type: text/plain; charset=utf-8");
57
			header("Content-Type: text/plain; charset=utf-8");
58
			die("OK"); // attention, compatibilité avec ValiderDetermination.php de DEL !
58
			die("OK"); // attention, compatibilité avec ValiderDetermination.php de DEL !
59
		}
59
		}
60
		// cf TODO: n'arrivera pas tant que l'UPDATE ajoutera systématiquement date_modification = now()
60
		// cf TODO: n'arrivera pas tant que l'UPDATE ajoutera systématiquement date_modification = now()
61
		elseif($modification === 0) {
61
		elseif($modification === 0) {
62
			http_response_code(304); // Not Modified
62
            header("HTTP/1.0 304 Not Modified"); // XXX: PHP 5.4 // http_response_code(304); // Not Modified
63
			header("Content-Type: text/plain; charset=utf-8");
63
			header("Content-Type: text/plain; charset=utf-8");
64
			die("Not Modified");
64
			die("Not Modified");
65
		}
65
		}
66
		else {
66
		else {
67
			http_response_code(500); // Internal Server Error
67
			header("HTTP/1.0 500 Internal Server Error"); // XXX: PHP: 5.4 // http_response_code(500); // Internal Server Error
68
			header("Content-Type: text/plain; charset=utf-8");
68
			header("Content-Type: text/plain; charset=utf-8");
69
			die("Impossible de modifier l'observation associée à cet identifiant " . mysql_error());
69
			die("Impossible de modifier l'observation associée à cet identifiant " . mysql_error());
70
		}
70
		}
71
	}
71
	}
Line 81... Line 81...
81
		// puisque nous regénérons des données valides avant l'update et puisque
81
		// puisque nous regénérons des données valides avant l'update et puisque
82
		// seul un nom_sel_nn *valide* a pu nous provenir depuis une validation de proposition de la part de DEL.
82
		// seul un nom_sel_nn *valide* a pu nous provenir depuis une validation de proposition de la part de DEL.
83
		$params_obligatoires = array('id_observation', 'ce_utilisateur', 'nom_sel');
83
		$params_obligatoires = array('id_observation', 'ce_utilisateur', 'nom_sel');
84
		foreach($params_obligatoires as $param) {
84
		foreach($params_obligatoires as $param) {
85
			if(@trim($params[$param])) continue;
85
			if(@trim($params[$param])) continue;
86
			http_response_code(412); // Precondition Failed
86
            header("HTTP/1.0 412 Precondition Failed"); // XXX: PHP: 5.4 // http_response_code(412); // Precondition Failed
87
			header("Content-Type: text/plain; charset=utf-8");
87
			header("Content-Type: text/plain; charset=utf-8");
88
			die(sprintf("Paramètre %s manquant (parmi %s)", $param, implode(', ', $params_obligatoires)));
88
			die(sprintf("Paramètre %s manquant (parmi %s)", $param, implode(', ', $params_obligatoires)));
89
		}
89
		}
90
	}
90
	}
91
}
91
}