Subversion Repositories Applications.papyrus

Rev

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

Rev 1055 Rev 1056
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: identification.php,v 1.23 2006-11-20 17:30:40 jp_milcent Exp $
22
// CVS : $Id: identification.php,v 1.24 2006-11-20 17:42:40 jp_milcent Exp $
23
/**
23
/**
24
* Applette : identification
24
* Applette : identification
25
*
25
*
26
* Génère un formulaire les champs nécessaires pour s'identifier.
26
* Génère un formulaire les champs nécessaires pour s'identifier.
27
* Nécessite :
27
* Nécessite :
Line 36... Line 36...
36
//Auteur original :
36
//Auteur original :
37
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
37
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
38
//Autres auteurs :
38
//Autres auteurs :
39
*@author        Aucun
39
*@author        Aucun
40
*@copyright     Tela-Botanica 2000-2004
40
*@copyright     Tela-Botanica 2000-2004
41
*@version       $Revision: 1.23 $ $Date: 2006-11-20 17:30:40 $
41
*@version       $Revision: 1.24 $ $Date: 2006-11-20 17:42:40 $
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
*/
43
*/
Line 44... Line 44...
44
 
44
 
45
// +------------------------------------------------------------------------------------------------------+
45
// +------------------------------------------------------------------------------------------------------+
Line 72... Line 72...
72
		setcookie(session_name(), session_id(), time()-3600, '/');
72
		setcookie(session_name(), session_id(), time()-3600, '/');
73
    }
73
    }
74
    // Si un formulaire nous renvoie en POST une variable "connexion", nous logons l'utilisateur.
74
    // Si un formulaire nous renvoie en POST une variable "connexion", nous logons l'utilisateur.
75
    if (isset($_REQUEST['connexion'])) {
75
    if (isset($_REQUEST['connexion'])) {
76
		// Nous vérifions que l'utilisateur est coché "Mémoriser mon compte"
76
		// Nous vérifions que l'utilisateur est coché "Mémoriser mon compte"
77
		if (isset($_POST['persistant']) && $_POST['persistant'] == 'o') {
77
		if (isset($_POST['persistant']) && $_POST['persistant'] == 'o' && IDEN_AUTH_SESSION_DUREE != 0) {
78
			//echo '<pre>'.print_r($_POST, true).'</pre>'; 
78
			//echo '<pre>'.print_r($_POST, true).'</pre>'; 
79
	        // Expiration si l'utilisateur ne referme pas son navigateur
79
	        // Expiration si l'utilisateur ne referme pas son navigateur
80
			$GLOBALS['_GEN_commun']['pear_auth']->setExpire((int)IDEN_AUTH_SESSION_DUREE);
80
			$GLOBALS['_GEN_commun']['pear_auth']->setExpire((int)IDEN_AUTH_SESSION_DUREE);
81
			// Pour que la session dure même après avoir refermer son navigateur
81
			// Pour que la session dure même après avoir refermer son navigateur
82
			setcookie(session_name(), session_id(), (int)IDEN_AUTH_SESSION_DUREE, '/');
82
			setcookie(session_name(), session_id(), (int)IDEN_AUTH_SESSION_DUREE, '/');
Line 143... Line 143...
143
        $retour .= str_repeat(' ', 20).''."\n";
143
        $retour .= str_repeat(' ', 20).''."\n";
144
        $retour .= str_repeat(' ', 24).'<label for="password">'.IDEN_LG_FORM_LABEL_MDP.'</label>'."\n";
144
        $retour .= str_repeat(' ', 24).'<label for="password">'.IDEN_LG_FORM_LABEL_MDP.'</label>'."\n";
145
        $retour .= str_repeat(' ', 24).'<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="'.IDEN_LG_FORM_VALUE_MDP.'" />'."\n";
145
        $retour .= str_repeat(' ', 24).'<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="'.IDEN_LG_FORM_VALUE_MDP.'" />'."\n";
146
        $retour .= str_repeat(' ', 20).''."\n";
146
        $retour .= str_repeat(' ', 20).''."\n";
147
        $retour .= str_repeat(' ', 20).''."\n";
147
        $retour .= str_repeat(' ', 20).''."\n";
-
 
148
        if (IDEN_AUTH_SESSION_DUREE != 0) {
148
        $retour .= str_repeat(' ', 24).'<input type="checkbox" id="persistant" name="persistant" tabindex="3" value="o" />'."\n";
149
        	$retour .= str_repeat(' ', 24).'<input type="checkbox" id="persistant" name="persistant" tabindex="3" value="o" />'."\n";
149
        $retour .= str_repeat(' ', 24).'<label id="persistant_label" for="persistant">'.'Mémoriser mon compte'.'</label>'."\n";
150
        	$retour .= str_repeat(' ', 24).'<label id="persistant_label" for="persistant">'.'Mémoriser mon compte'.'</label>'."\n";
-
 
151
        }
150
        $retour .= str_repeat(' ', 20).''."\n";
152
        $retour .= str_repeat(' ', 20).''."\n";
151
        $retour .= str_repeat(' ', 20).''."\n";
153
        $retour .= str_repeat(' ', 20).''."\n";
152
        $retour .= str_repeat(' ', 24).'<input type="submit" id="connexion" name="connexion" tabindex="4" value="'.IDEN_LG_FORM_VALUE_SUBMIT.'" />'."\n";
154
        $retour .= str_repeat(' ', 24).'<input type="submit" id="connexion" name="connexion" tabindex="4" value="'.IDEN_LG_FORM_VALUE_SUBMIT.'" />'."\n";
153
        $retour .= str_repeat(' ', 20).''."\n";
155
        $retour .= str_repeat(' ', 20).''."\n";
154
        // Si l'url de la page d'inscription est stockée dans les paramêtres, nous l'affichons
156
        // Si l'url de la page d'inscription est stockée dans les paramêtres, nous l'affichons
Line 202... Line 204...
202
 
204
 
203
 
205
 
204
/* +--Fin du code ----------------------------------------------------------------------------------------+
206
/* +--Fin du code ----------------------------------------------------------------------------------------+
-
 
207
*
-
 
208
* $Log: not supported by cvs2svn $
-
 
209
* Revision 1.23  2006/11/20 17:30:40  jp_milcent
-
 
210
* Amélioration de la gestion de l'identification.
-
 
211
* Utilisation des durées de session correcte.
205
*
212
* Suppression du code pour Spip non fonctionnel.
206
* $Log: not supported by cvs2svn $
213
*
207
* Revision 1.22  2006/09/21 15:25:17  jp_milcent
214
* Revision 1.22  2006/09/21 15:25:17  jp_milcent
208
* Nettoyage dans l'url de la querystring logout.
215
* Nettoyage dans l'url de la querystring logout.
209
*
216
*