Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1013 → Rev 1014

/trunk/jrest/services/ImageDateList.php
49,9 → 49,7
$liste_dates = $this->formaterListeResultats($liste_dates);
$output = json_encode($liste_dates);
print($output);
$this->envoyerJson($liste_dates);
return true;
}
/trunk/jrest/services/User.php
91,11 → 91,9
$utilisateur['connecte'] = ($utilisateur['connecte']) ? true : false;
$utilisateur['licence_acceptee'] = ($utilisateur['licence_acceptee']) ? true : false;
$utilisateur['admin'] = ($utilisateur['admin']) ? true : false;
$output = json_encode($utilisateur);
header('content-type: application/json');
print $output;
exit();
$this->envoyerJson($utilisateur);
return true;
}
function chargerInfosUtilisateur($login) {
135,8 → 133,6
$this->setPersistentCookie("cel_name", $user["courriel"], $remember);
$this->setPersistentCookie("cel_password", $user["mot_de_passe"], $remember);
$this->setPersistentCookie("cel_remember", $remember, $remember);
print_r($_COOKIE);
}
 
function deconnecterUtilisateur() {
202,18 → 198,4
return md5($mot_de_passe);
}
}
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.5 2008-01-30 08:57:28 ddelon
* fin mise en place mygwt
*
* Revision 1.4 2007-05-22 12:54:09 ddelon
* Securisation acces utilisateur
*
* Revision 1.3 2007-05-21 18:12:20 ddelon
* Gestion des importations locale de releves
*
*
*/
?>
/trunk/jrest/services/InventoryImageLink.php
114,10 → 114,8
$liaisons = $resultat_selection_liaison;
}
 
$retour_encode = json_encode($liaisons) ;
header("content-type: application/json") ;
print $retour_encode ;
exit() ;
$this->envoyerJson($liaisons);
return true;
}
 
function updateElement($uid,$pairs)
/trunk/jrest/services/Name.php
34,13 → 34,11
$retour = $chercheur_info_taxon->effectuerRequeteInfosComplementairesEtFormaterNom($uid[0]);
}
$output = json_encode($retour);
header("content-type: application/json");
print($output);
$this->envoyerJson($retour);
return true;
}
function getRessource(){
print "[\"null\"]";
return;
}
/trunk/jrest/services/InventoryLocationList.php
37,12 → 37,8
$retour = $resultat_zones_geo;
}
 
$output = json_encode($retour);
 
header("content-type: application/json");
print($output);
return true;
 
$this->envoyerJson($retour);
return true;
}
}
/* +--Fin du code ---------------------------------------------------------------------------------------+
/trunk/jrest/services/InventoryObservationCount.php
49,11 → 49,9
}
 
$retour = $chercheur_observations->compterObservations($uid[0], $criteres);
 
$retour_encode = json_encode($retour) ;
header("content-type: application/json") ;
print $retour_encode ;
exit() ;
$this->envoyerJson($retour);
return true;
}
}
?>
/trunk/jrest/services/SelfRefList.php
56,8 → 56,8
 
}
$output = json_encode($referentiel);
print($output);
$this->envoyerJson($referentiel);
return true;
}
function paramObligatoiresSontPresents($uid) {
77,15 → 77,4
return ($chaine != null && $chaine != "000null" && trim($chaine) != "");
}
}
 
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.3 2008-01-30 08:57:28 ddelon
* fin mise en place mygwt
*
* Revision 1.2 2007-05-22 12:54:09 ddelon
* Securisation acces utilisateur
*
*/
?>
/trunk/jrest/services/NameImage.php
82,10 → 82,8
}
}
$output = json_encode($value);
header("content-type: application/json");
print($output);
return true;
$this->envoyerJson($value);
return true;
}
}
/trunk/jrest/services/InventoryDateList.php
31,24 → 31,22
*/
function getElement($uid){
// Controle detournement utilisateur
$this->controleUtilisateur($uid[0]);
$condition_requete = $this->traiterParametresEtConstruireRequete($uid);
$requete_liste_dates = 'SELECT DISTINCT '.
'date_observation AS id '.
'FROM cel_obs WHERE '.$condition_requete.' '.
'ORDER BY date_observation';
$liste_dates = $this->executerRequete($requete_liste_dates);
$liste_dates = $this->formaterListeResultats($liste_dates);
$output = json_encode($liste_dates);
print($output);
return true;
// Controle detournement utilisateur
$this->controleUtilisateur($uid[0]);
$condition_requete = $this->traiterParametresEtConstruireRequete($uid);
$requete_liste_dates = 'SELECT DISTINCT '.
'date_observation AS id '.
'FROM cel_obs WHERE '.$condition_requete.' '.
'ORDER BY date_observation';
$liste_dates = $this->executerRequete($requete_liste_dates);
$liste_dates = $this->formaterListeResultats($liste_dates);
$this->envoyerJson($liste_dates);
return true;
}
private function formaterListeResultats($liste_dates) {
/trunk/jrest/services/Inventory.php
51,10 → 51,8
$observation = $this->formaterObservationVersTableauSequentiel(&$observation);
$output = json_encode($observation);
header("Content-type: application/json");
print($output);
 
return true;
$this->envoyerJson($output);
return true;
}
private function formaterObservationVersTableauSequentiel($observation) {
/trunk/jrest/services/InventoryKeyWordList.php
40,11 → 40,9
foreach($resultats_mots_cles as $mot_cle) {
$mots_cles[] = $mot_cle;
}
$infos = json_encode($mots_cles);
header('content-type: application/json');
print $infos;
exit();
$this->envoyerJson($mots_cles);
return true;
}
}
 
118,10 → 116,10
 
public function createElement($pairs) {
// Controle detournement utilisateur
$this->controleUtilisateur($pairs['ce_utilisateur']);
$this->controleUtilisateur($pairs['identifiant']);
 
$this->suffix = '_'.$pairs['mode'];
$id_utilisateur = $pairs['ce_utilisateur'];
$id_utilisateur = $pairs['identifiant'];
$mot_cle = $pairs['motcle'];
 
// TODO supprimer accents
156,7 → 154,6
 
if ($transaction_reussie_1 && $transaction_reussie_2) {
$this->completerTransaction();
echo 'OK';
} else {
$this->annulerTransaction();
}
/trunk/jrest/services/LocationSearch.php
32,10 → 32,8
$retour = $this->executerRequeteLieu($uid[0]);
}
$output = json_encode($retour);
header("content-type: application/json");
print($output);
$this->envoyerJson($retour);
return true;
}
 
function getRessource(){
/trunk/jrest/services/Resume.php
93,10 → 93,8
$resume['elements'][] = $resume_item;
}
 
header("Content-Type: application/json; charset=UTF-8");
$resume = json_encode($resume);
print ($resume);
exit;
$this->envoyerJson($resume);
return true;
}
 
public function calculerDimensions($tailleXY) {
/trunk/jrest/services/InventoryObservationList.php
66,11 → 66,9
 
$retour = $chercheur_observations->rechercherObservations($uid[0], $criteres, $debut, $taille_page);
$retour_formate = $chercheur_observations->formaterPourEnvoiCel(&$retour);
$retour_encode = json_encode($retour_formate) ;
 
header("Content-type: application/json");
print($retour_encode);
exit();
$this->envoyerJson($retour_formate);
return true;
}
 
/**
/trunk/jrest/services/NameMap.php
65,9 → 65,8
$retour = array($file);
}
 
$output = json_encode($retour);
header("content-type: application/json");
print($output);
$this->envoyerJson($retour);
return true;
}
}
/* +--Fin du code ---------------------------------------------------------------------------------------+
/trunk/jrest/services/InventoryUserList.php
45,10 → 45,8
usort($liste_utilisateurs,'trierUtilisateurs');
$output = json_encode($liste_utilisateurs);
print($output);
return true;
$this->envoyerJson($liste_utilisateurs);
return true;
}
private function construireRequeteCondition($params) {
65,39 → 63,25
 
function trierUtilisateurs($val1, $val2) {
if (strstr($val1,'@')) {
if (strstr($val1,'@')) {
if (strstr($val2,'@')) {
return strcmp($val1,$val2);
}
else
{
return -1 ;
}
}
if (strstr($val2,'@')) {
return strcmp($val1,$val2);
}
else
{
if (strstr($val2,'@')) {
return 1 ;
}
else
{
return strcmp($val1,$val2) ;
}
return -1 ;
}
}
 
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.3 2008-01-30 08:57:28 ddelon
* fin mise en place mygwt
*
* Revision 1.2 2007-05-22 12:54:09 ddelon
* Securisation acces utilisateur
*
*
*
*/
}
else
{
if (strstr($val2,'@')) {
return 1 ;
}
else
{
return strcmp($val1,$val2) ;
}
}
}
?>
/trunk/jrest/services/InventoryImageList.php
54,7 → 54,8
$debut = $taille_page*$numero_page ;
 
$retour = $chercheur_images->rechercherImagesEtObservationAssociees($uid[0], $criteres, $debut, $taille_page);
 
$retour = $chercheur_images->formaterPourEnvoiCel(&$retour);
$retour_encode = json_encode($retour) ;
$retour_encode = $this->nettoyerCaracteresNuls($retour_encode);
 
/trunk/jrest/services/LicenceUtilisateur.php
31,9 → 31,8
if(!isset($pairs['licence'])) {
return;
}
}
$requete_acceptation_licence = 'UPDATE cel_utilisateurs '.
'SET licence_acceptee = '.$this->proteger($pairs['licence']).
'WHERE id_utilisateur = '.$this->proteger($uid[0]);
/trunk/jrest/services/InventoryImage.php
45,7 → 45,9
if(count($image_recherchee) > 0) {
$retour = $image_recherchee[0];
}
$this->envoyer($retour,'application/json','utf-8',true);
$this->envoyerJson($retour);
return true;
}
 
/**
/trunk/jrest/services/CelWidgetMap.php
70,6 → 70,7
public function getIconeGroupe($params) {
extract($this->parametres);
 
//TODO: changer ceci pour une adresse indiquée dans un fichier de config
$img = imagecreatefrompng("/home/jpm/web/serveur/commun/icones/carto/groupe/g$type.png");
 
$noir = imagecolorallocate($img, 0, 0, 0);
/trunk/jrest/services/NameSearch.php
53,10 → 53,8
$chercheur_infos_taxon = new RechercheInfosTaxon($this->config);
$liste_genre_espece = $chercheur_infos_taxon->rechercherGenreEspeceSurPrefixe($genre,$espece);
$output = json_encode($liste_genre_espece);
header("content-type: application/json");
print($output);
$this->envoyerJson($liste_genre_espece);
return true;
}
}