Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 766 Rev 769
Line 10... Line 10...
10
	private static final long serialVersionUID = -4016615552202089985L;
10
	private static final long serialVersionUID = -4016615552202089985L;
Line 11... Line 11...
11
	
11
	
Line 12... Line 12...
12
	public static final String PREFIXE = "cp";
12
	public static final String PREFIXE = "cp";
13
	
-
 
14
	public Utilisateur() {
13
	
15
		set("id_personne", null);
14
	public Utilisateur() {
16
		set("identifie", false);
15
		initialiserUtilisateur(null, false);
17
	}
16
	}
18
	
-
 
19
	public Utilisateur(String id, boolean identifie) {
17
 
20
		set("id_personne", id);
18
	public Utilisateur(String id, boolean identifie) {
21
		set("identifie", identifie);
19
		initialiserUtilisateur(id, identifie);
22
	}
20
	}
23
 
21
	
24
	public Utilisateur(JSONObject utilisateur) {
22
	public Utilisateur(JSONObject utilisateur) {
Line 25... Line 23...
25
		// l'objet JSON est une table de hachage
23
		// l'objet JSON est une table de hachage
Line 44... Line 42...
44
	
42
	
45
	@Override
43
	@Override
46
	protected String getPrefixe() {
44
	protected String getPrefixe() {
47
		return PREFIXE;
45
		return PREFIXE;
48
	}
-
 
49
	
-
 
50
	public void setId(String id) {
-
 
51
		set("id_personne", id);
-
 
52
	}
-
 
53
	
-
 
54
	public void setNomComplet(String nom_complet) {
-
 
55
		set("fmt_nom_complet", nom_complet);
-
 
Line 56... Line 46...
56
	}
46
	}
-
 
47
 
57
 
48
	private void initialiserUtilisateur(String id, boolean etreIdentifie) {
58
	public void setPrenom(String prenom) {
49
		setId(id);
Line 59... Line -...
59
		set("prenom", prenom);
-
 
60
	}
-
 
61
	
-
 
62
	public void setNom(String nom) {
-
 
63
		set("nom", nom);
-
 
64
	}
-
 
65
	
-
 
66
	public void setIdentifie(Boolean bool) {
-
 
67
		set("identifie", bool);
-
 
68
	}
-
 
69
	
-
 
70
	public void setLogin(String l) {
-
 
71
		set("login", l);
-
 
72
	}
-
 
73
	
-
 
Line 74... Line 50...
74
	public void setMotDePasse(String mdp) {
50
		setIdentification(etreIdentifie);
75
		set("mot_de_passe", mdp);
51
	}
76
	}
52
	
77
	
53
	
78
	/**
54
	/**
79
	 * Retourne l'id de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
55
	 * Retourne l'id de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
80
	 * @return String id de l'utilisateur
56
	 * @return String id de l'utilisateur
-
 
57
	 */
-
 
58
	public String getId() {
-
 
59
		return renvoyerValeurCorrecte("id_personne");
81
	 */
60
	}
82
	public String getId() {
61
	public void setId(String id) {
83
		return get("id_personne");
62
		set("id_personne", id);
84
	}
63
	}
85
 
64
	
86
	/**
65
	/**
87
	 * Retourne le nom complet et formaté de l'utilisateur
66
	 * Retourne le nom complet et formaté de l'utilisateur
-
 
67
	 * @return String nom complet
-
 
68
	 */
-
 
69
	public String getNomComplet() {
88
	 * @return String nom complet
70
		return renvoyerValeurCorrecte("fmt_nom_complet");
Line 89... Line 71...
89
	 */
71
	}
90
	public String getNomComplet() {
72
	public void setNomComplet(String nom_complet) {
91
		return get("fmt_nom_complet");
73
		set("fmt_nom_complet", nom_complet);
92
	}
74
	}
93
 
75
 
-
 
76
	/**
-
 
77
	 * Retourne le prénom de l'utilisateur
-
 
78
	 * @return String prénom
94
	/**
79
	 */
95
	 * Retourne le prénom de l'utilisateur
80
	public String getPrenom() {
Line 96... Line 81...
96
	 * @return String prénom
81
		return renvoyerValeurCorrecte("prenom");
97
	 */
82
	}
98
	public String getPrenom() {
83
	public void setPrenom(String prenom) {
99
		return get("prenom");
84
		set("prenom", prenom);
100
	}
85
	}
-
 
86
	
-
 
87
	/**
-
 
88
	 * Retourne le nom de l'utilisateur
101
	
89
	 * @return String nom
102
	/**
90
	 */
Line 103... Line 91...
103
	 * Retourne le nom de l'utilisateur
91
	public String getNom() {
104
	 * @return String nom
92
		return renvoyerValeurCorrecte("nom");
105
	 */
93
	}
106
	public String getNom() {
94
	public void setNom(String nom) {
107
		return get("nom");
95
		set("nom", nom);
108
	}
96
	}
109
	
97
	
-
 
98
	/**
-
 
99
	 * Retourne le login de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
-
 
100
	 * @return String login
110
	/**
101
	 */
111
	 * Retourne le login de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
102
	public String getLogin() {
112
	 * @return String login
103
		return renvoyerValeurCorrecte("login");
113
	 */
104
	}
114
	public String getLogin() {
105
	public void setLogin(String l) {
115
		return get("login");
106
		set("login", l);
-
 
107
	}
-
 
108
	
-
 
109
	/**
116
	}
110
	 * Retourne le mot de passe de l'utilisateur
117
 
111
	 * @return String mot de passe
-
 
112
	 */
Line 118... Line 113...
118
	/**
113
	public String getMotDePasse() {
119
	 * Retourne le mot de passe de l'utilisateur
114
		return renvoyerValeurCorrecte("mot_de_passe");
120
	 * @return String mot de passe
115
	}
121
	 */
116
	public void setMotDePasse(String mdp) {
122
	public String getMotDePasse() {
117
		set("mot_de_passe", mdp);
123
		return get("mot_de_passe");
118
	}
124
	}
119
		
125
	
-
 
126
	/**
120
	
127
	 * Retourne vrai si utilisateur est identifié.
-
 
128
	 * @return boolean
-
 
129
	 */
-
 
130
	public boolean isIdentifie() {
121
	/**
131
		return get("identifie");
-
 
132
	}
-
 
133
	
-
 
134
	public String toString() {
-
 
135
		String chaine = new String();
-
 
136
		for (Iterator<String> it = this.getPropertyNames().iterator(); it.hasNext();) {
122
	 * Retourne vrai si utilisateur est identifié.
137
			// Si elle est associée à une valeur, nous l'ajoutons
123
	 * @return boolean
138
			String cle = it.next();
124
	 */
139
		
125
	public boolean isIdentifie() {