Subversion Repositories eFlore/Applications.cel

Rev

Rev 886 | Rev 1301 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 886 Rev 996
1
<?php
1
<?php
2
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
2
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
3
 
3
 
4
/**
4
/**
5
* PHP Version 5
5
* PHP Version 5
6
*
6
*
7
* @category  PHP
7
* @category  PHP
8
* @package   jrest
8
* @package   jrest
9
* @author    David Delon <david.delon@clapas.net>
9
* @author    David Delon <david.delon@clapas.net>
10
* @copyright 2010 Tela-Botanica
10
* @copyright 2010 Tela-Botanica
11
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
12
* @version   SVN: <svn_id>
12
* @version   SVN: <svn_id>
13
* @link      /doc/jrest/
13
* @link      /doc/jrest/
14
*/
14
*/
15
 
15
 
16
/** 
16
/** 
17
* 
17
* 
18
* in : utf8
18
* in : utf8
19
* out : utf8
19
* out : utf8
20
* 
20
* 
21
* 
21
* 
22
* Transmission observation vers Tela
22
* Transmission observation vers Tela
23
*/ 
23
*/ 
24
class InventoryTransmit extends Cel  {
24
class InventoryTransmit extends Cel  {
25
 
25
 
26
	function updateElement($uid,$pairs) {
26
	function updateElement($uid,$pairs) {
27
		
27
		
28
		// Controle detournement utilisateur 
28
		// Controle detournement utilisateur 
29
		session_start();
-
 
30
 	    $this->controleUtilisateur($uid[0]);
29
 	    $this->controleUtilisateur($uid[0]);
31
				   			
30
				   			
32
		if (isset($uid[1]) && $this->estUneSuiteIdentifiantsObservation($uid[1])) {
31
		if (isset($uid[1]) && $this->estUneSuiteIdentifiantsObservation($uid[1])) {
33
	           	$requete_transmission = 'UPDATE cel_obs '.
32
	           	$requete_transmission = 'UPDATE cel_obs '.
34
	           	'SET transmission = '.$pairs['transmission'].','.
33
	           	'SET transmission = '.$pairs['transmission'].','.
35
				'date_modification = now(), date_transmission = now() '. 
34
				'date_modification = now(), date_transmission = now() '. 
36
	        	'WHERE ce_utilisateur = '.$this->proteger($uid[0]).' AND ordre in ('.$uid[1].')';
35
	        	'WHERE ce_utilisateur = '.$this->proteger($uid[0]).' AND ordre in ('.$uid[1].')';
37
		} 
36
		} 
38
 
37
 
39
    	$resultat_transmission = $this->executer($requete_transmission);
38
    	$resultat_transmission = $this->executer($requete_transmission);
40
                
39
                
41
        if (!$resultat_transmission) {
40
        if (!$resultat_transmission) {
42
        	return false;
41
        	return false;
43
        }
42
        }
44
        
43
        
45
        return true;               
44
        return true;               
46
	}
45
	}
47
	
46
	
48
	private function estUneSuiteIdentifiantsObservation($chaine) {
47
	private function estUneSuiteIdentifiantsObservation($chaine) {
49
		
48
		
50
		// un ensemble d'identifiants est une suite d'identifiants séparés par des virgules
49
		// un ensemble d'identifiants est une suite d'identifiants séparés par des virgules
51
		// sans virgule terminale
50
		// sans virgule terminale
52
		$reg_exp = "/^(([0-9])+,)*([0-9])+$/";
51
		$reg_exp = "/^(([0-9])+,)*([0-9])+$/";
53
		
52
		
54
		return preg_match($reg_exp, $chaine);
53
		return preg_match($reg_exp, $chaine);
55
		
54
		
56
	}
55
	}
57
}
56
}
58
/* +--Fin du code ---------------------------------------------------------------------------------------+
57
/* +--Fin du code ---------------------------------------------------------------------------------------+
59
* $Log$
58
* $Log$
60
* Revision 1.3  2008-01-30 08:57:28  ddelon
59
* Revision 1.3  2008-01-30 08:57:28  ddelon
61
* fin mise en place mygwt
60
* fin mise en place mygwt
62
*
61
*
63
* Revision 1.2  2007-05-22 12:54:09  ddelon
62
* Revision 1.2  2007-05-22 12:54:09  ddelon
64
* Securisation acces utilisateur
63
* Securisation acces utilisateur
65
* 
64
* 
66
*/
65
*/
67
?>
66
?>