Subversion Repositories Sites.obs-saisons.fr

Rev

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

Rev 207 Rev 210
1
<?php
1
<?php
2
class DrupalUtilisateur extends Utilisateur {
2
class DrupalUtilisateur extends Utilisateur {
-
 
3
	
-
 
4
	public function getNomUtilisateurPourId($id) {
-
 
5
		return db_result(db_query("SELECT name FROM {users} WHERE uid = %d", $id));
-
 
6
	}
-
 
7
	
-
 
8
	public function getIdUtilisateurPourNom($nom) {
-
 
9
		return db_result(db_query("SELECT uid FROM {users} WHERE name = '%s'", $nom));
-
 
10
	}
3
	
11
	
4
	public function getIdentifiantNumerique() {
-
 
5
		
12
	public function getIdentifiantNumerique() {
6
		return $GLOBALS['user']->uid;		
-
 
7
		
13
		return $GLOBALS['user']->uid;		
8
	}
14
	}
9
	
15
	
10
	public function getEmail() {
16
	public function getEmail() {
11
		return $GLOBALS['user']->mail;
17
		return $GLOBALS['user']->mail;
12
	}
18
	}
13
	
19
	
14
	public function getNom() {
20
	public function getNom() {
15
		return $GLOBALS['user']->name;
21
		return $GLOBALS['user']->name;
16
	}
22
	}
17
	
23
	
18
	public function getPrenom() {
24
	public function getPrenom() {
19
		return '';	
25
		return '';	
20
	}
26
	}
21
	
27
	
22
	public function estAdmin() {
28
	public function estAdmin() {
23
		return in_array('3',array_keys($GLOBALS['user']->roles));
29
		return in_array('3',array_keys($GLOBALS['user']->roles)) || in_array('3',array_keys($GLOBALS['user']->roles)) ;
24
	}
30
	}
25
	
31
	
26
	public function estIdentifie() {
32
	public function estIdentifie() {
27
		return user_is_logged_in();
33
		return user_is_logged_in();
28
	}
34
	}
29
	
35
	
30
	public function getFormulaireIdentification() {
36
	public function getFormulaireIdentification() {
31
		
37
		
32
		return drupal_get_form('user_login_block');
38
		return drupal_get_form('user_login_block');
33
	}
39
	}
34
	
40
	
35
	public function getFormulaireInscription() {
41
	public function getFormulaireInscription() {
36
		
42
		
37
		return drupal_get_form('user_register');
43
		return drupal_get_form('user_register');
38
	}
44
	}
39
}
45
}
40
?>
46
?>