Subversion Repositories Applications.annuaire

Rev

Rev 69 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69 Rev 293
1
<?php
1
<?php
-
 
2
// declare(encoding='UTF-8');
2
/**
3
/**
3
* PHP Version 5
4
 * Service 
4
*
5
 *
5
* @category  PHP
6
 * @category	php 5.2
6
* @package   annuaire
7
 * @package		Annuaire::Services
7
* @author    aurelien <aurelien@tela-botanica.org>
8
 * @author		Aurélien PERONNET <aurelien@tela-botanica.org>
-
 
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
* @copyright 2010 Tela-Botanica
10
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
9
* @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
10
* @version   SVN: <svn_id>
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
* @link      /doc/annuaire/
13
 * @version		$Id$
12
*/
14
 */
13
 
-
 
14
Class TestLoginMdp extends JRestService {
15
class TestLoginMdp extends JRestService {
15
 
16
 
16
	public function getElement($uid){
-
 
17
 
17
	public function getElement($uid){
18
	   	if(!isset($uid[0]) || $uid[0] == '' || !isset($uid[1]) || $uid[1] == '') {
18
	   	if (!isset($uid[0]) || $uid[0] == '' || !isset($uid[1]) || $uid[1] == '') {
19
	   		$this->envoyer(false);
19
	   		$this->envoyer(false);
20
	   		return;
20
	   		return;
21
	   	}
21
	   	}
22
 
22
 
23
	   	$mail_utilisateur = $uid[0];
23
	   	$mail_utilisateur = $uid[0];
24
	   	$pass = $uid[1];
24
	   	$pass = $uid[1];
25
 
25
 
26
	   	// TODO vérifier que le mot de passe est crypté !
26
	   	// TODO vérifier que le mot de passe est crypté !
27
 
27
 
28
	    $id_annuaire = Config::get('annuaire_defaut');
28
	    $id_annuaire = Config::get('annuaire_defaut');
29
 
29
 
30
	    $controleur = new AnnuaireControleur();
30
	    $controleur = new AnnuaireControleur();
31
		$id_match_pass = $controleur->comparerIdentifiantMotDePasse($id_annuaire,$mail_utilisateur, $pass, true, true);
31
		$id_match_pass = $controleur->comparerIdentifiantMotDePasse($id_annuaire,$mail_utilisateur, $pass, true, true);
32
 
32
 
33
		$this->envoyer($id_match_pass);
33
		$this->envoyer($id_match_pass);
34
	}
34
	}
35
}
35
}
36
?>
36
?>