Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1648 → Rev 1649

/trunk/papyrus/applettes/identification/squelettes/identification.tpl.html
1,25 → 1,46
<form id="form_connexion" class="form_identification" action="<?=$url;?>" method="post">
<fieldset>
<legend><?=IDEN_LG_FORM_LEGEND;?></legend>
<label for="username"><?=IDEN_LG_FORM_LABEL_COURRIEL;?></label>
<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="<?=IDEN_LG_FORM_VALUE_COURRIEL;?>" />
<label for="password"><?=IDEN_LG_FORM_LABEL_MDP;?></label>
<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="<?=IDEN_LG_FORM_VALUE_MDP;?>" />
 
<input type="submit" id="connexion" name="connexion" tabindex="4" value="<?=IDEN_LG_FORM_VALUE_SUBMIT;?>" />
<?php if (IDEN_AUTH_SESSION_DUREE != 0) : ?>
<input type="checkbox" id="persistant" name="persistant" tabindex="3" value="o" />
<label id="persistant_label" for="persistant">Mémoriser mon compte</label>
<?php endif ;?>
<?php if ($url_page_inscription || $url_inscription_aide) : ?>
<p id="inscription_info">
<?php if ($url_page_inscription) : ?>
<a id="lien_inscription" href="<?=$url_page_inscription;?>"><?=IDEN_LG_INSCRIPTION_URL;?></a>
<?php endif ;?>
<?php if ($url_inscription_aide) : ?>
<a id="inscription_aide" href="<?=$url_inscription_aide;?>"><?=IDEN_LG_INSCRIPTION_AIDE;?></a></p>
<?php endif; ?>
</p>
<?php endif; ?>
</fieldset>
</form>
<?php if ($loggue) : ?>
<p id="identification_info">
<span id="identification_message"><?=IDEN_LG_MESSAGE;?></span>
<?php if ($url_page_inscription) : ?>
<a href="<?=$url_page_inscription;?>" id="voir_inscription" title="Voir mon inscription">
<?=$chp_personne_prenom; ?>&nbsp;<?=$chp_personne_nom; ?>&nbsp;<?=$chp_structure; ?>
</a>
<?php else : ?>
<?=$chp_personne_prenom; ?>&nbsp;<?=$chp_personne_nom; ?>&nbsp;<?=$chp_structure; ?>
<?php endif; ?>
</p>
<p id="iden_action">
<?php if ($url_page_modif_inscription) : ?>
<a id="lien_inscription_modif" href="<?=$url_page_modif_inscription; ?>">
<?=IDEN_LG_INSCRIPTION_URL_MODIF;?>
</a>
<?php endif; ?>
<a id="deconnexion" href="<?=$url_deconnect;?>"><?=IDEN_LG_DECONNEXION;?></a>
</p>
<?php else : ?>
<form id="form_connexion" class="form_identification" action="<?=$url;?>" method="post">
<fieldset>
<legend><?=IDEN_LG_FORM_LEGEND;?></legend>
<label for="username"><?=IDEN_LG_FORM_LABEL_COURRIEL;?></label>
<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="<?=IDEN_LG_FORM_VALUE_COURRIEL;?>" />
<label for="password"><?=IDEN_LG_FORM_LABEL_MDP;?></label>
<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="<?=IDEN_LG_FORM_VALUE_MDP;?>" />
<input type="submit" id="connexion" name="connexion" tabindex="4" value="<?=IDEN_LG_FORM_VALUE_SUBMIT;?>" />
<?php if (IDEN_AUTH_SESSION_DUREE != 0) : ?>
<input type="checkbox" id="persistant" name="persistant" tabindex="3" value="o" />
<label id="persistant_label" for="persistant">Mémoriser mon compte</label>
<?php endif ;?>
<?php if ($url_page_inscription || $url_inscription_aide) : ?>
<p id="inscription_info">
<?php if ($url_page_inscription) : ?>
<a id="lien_inscription" href="<?=$url_page_inscription;?>"><?=IDEN_LG_INSCRIPTION_URL;?></a>
<?php endif ;?>
<?php if ($url_inscription_aide) : ?>
<a id="inscription_aide" href="<?=$url_inscription_aide;?>"><?=IDEN_LG_INSCRIPTION_AIDE;?></a></p>
<?php endif; ?>
</p>
<?php endif; ?>
</fieldset>
</form>
<?php endif; ?>
/trunk/papyrus/applettes/identification/identification.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: identification.php,v 1.34 2007-09-18 08:40:54 alexandre_tb Exp $
// CVS : $Id: identification.php,v 1.35 2007-10-11 14:14:22 florian Exp $
/**
* Applette : identification
*
38,7 → 38,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.34 $ $Date: 2007-09-18 08:40:54 $
*@version $Revision: 1.35 $ $Date: 2007-10-11 14:14:22 $
// +------------------------------------------------------------------------------------------------------+
*/
 
145,7 → 145,9
$InfoAuthBdd =& $_GEN_commun['info_auth_bdd'];
$objet_url =& $_GEN_commun['url'];
$url = $objet_url->getURL();
$objet_url->addQueryString('logout', 1);
$url_deconnect = $objet_url->getURL();
$objet_url->removeQueryString('logout');
// Récupération des valeurs pour le login et le mot de passe
$mot_de_passe = (! isset($_POST['password'])) ? '' : $_POST['password'];
$login = (! isset($_POST['username'])) ? '' : $_POST['username'];
158,108 → 160,51
$objet_pear_auth->login();
}
}
if (! $objet_pear_auth->getAuth()) {
// L'utilisateur a essayé de s'identifier mais a échoué
if ($login != '') {
$retour .= '<span class="erreur">'.IDEN_ECHEC_AUTH ;
$url_erreur = '#';
if (isset($InfoAuthBdd->url_erreur)) {
$url_erreur = $InfoAuthBdd->url_erreur;
} else if (isset($InfoAuthBdd->url_inscription)) {
$url_erreur = $InfoAuthBdd->url_inscription;
}
$retour .= '<a id="lien_inscription" href="'.$url_erreur.'">'.IDEN_ICI.'</a>' ;
$retour .= '</span>'."\n";
}
$url_inscription_aide = '';
$url_page_inscription = '';
if (isset($InfoAuthBdd->url_inscription)) {
$url_page_inscription = $InfoAuthBdd->url_inscription;
}
if (isset($InfoAuthBdd->url_inscription_aide)) {
$url_inscription_aide = $InfoAuthBdd->url_inscription_aide;
}
ob_start();
include_once $options['template'];
$retour = ob_get_contents();
// Arrete et detruit le buffer
ob_end_clean();
// L'utilisateur n'est pas identifié:
/*
$retour .= str_repeat(' ', 16).'<form id="form_connexion" class="form_identification" action="'.$url.'" method="post">'."\n";
$retour .= str_repeat(' ', 16).'<fieldset>'."\n";
$retour .= str_repeat(' ', 20).'<legend>'.IDEN_LG_FORM_LEGEND.'</legend>'."\n";
$retour .= str_repeat(' ', 20).''."\n";
$retour .= str_repeat(' ', 24).'<label for="username">'.IDEN_LG_FORM_LABEL_COURRIEL.'</label>'."\n";
$retour .= str_repeat(' ', 24).'<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="'.IDEN_LG_FORM_VALUE_COURRIEL.'" />'."\n";
$retour .= str_repeat(' ', 20).''."\n";
$retour .= str_repeat(' ', 20).''."\n";
$retour .= str_repeat(' ', 24).'<label for="password">'.IDEN_LG_FORM_LABEL_MDP.'</label>'."\n";
$retour .= str_repeat(' ', 24).'<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="'.IDEN_LG_FORM_VALUE_MDP.'" />'."\n";
$retour .= str_repeat(' ', 20).''."\n";
$retour .= str_repeat(' ', 20).''."\n";
if (IDEN_AUTH_SESSION_DUREE != 0) {
$retour .= str_repeat(' ', 24).'<input type="checkbox" id="persistant" name="persistant" tabindex="3" value="o" />'."\n";
$retour .= str_repeat(' ', 24).'<label id="persistant_label" for="persistant">'.'Mémoriser mon compte'.'</label>'."\n";
}
$retour .= str_repeat(' ', 20).''."\n";
$retour .= str_repeat(' ', 20).''."\n";
$retour .= str_repeat(' ', 24).'<input type="submit" id="connexion" name="connexion" tabindex="4" value="'.IDEN_LG_FORM_VALUE_SUBMIT.'" />'."\n";
$retour .= str_repeat(' ', 20).''."\n";
// Si l'url de la page d'inscription est stockée dans les paramêtres, nous l'affichons
if (isset($InfoAuthBdd->url_inscription) || isset($InfoAuthBdd->url_inscription_aide)) {
$retour .= '<p id="inscription_info">';
if (isset($InfoAuthBdd->url_inscription)) {
$retour .= '<a id="lien_inscription" href="'.$InfoAuthBdd->url_inscription.'">'.
IDEN_LG_INSCRIPTION_URL.
'</a>';
}
if (isset($InfoAuthBdd->url_inscription_aide)) {
$retour .= '<a id="inscription_aide" href="'.$InfoAuthBdd->url_inscription_aide.'">'.
IDEN_LG_INSCRIPTION_AIDE.
'</a>';
}
$retour .= '</p>'."\n";
}
$retour .= str_repeat(' ', 16).'</fieldset>'."\n";
$retour .= str_repeat(' ', 16).'</form>';
*/
} else {
// L'utilisateur est identifié. Nous affichons ses informations.
// Affichage du prénom et nom d'une personne ou du nom de la structure en fonction des paramêtres
// de l'annuaire utilisé
$retour .= str_repeat(' ', 16).'<p id="identification_info"><span id="identification_message">'.IDEN_LG_MESSAGE.'</span> ';
// Si les intitulés des champs nom et prénoms d'une personne ou le nom d'une structure sont indiqués nous les affichons
if (isset($InfoAuthBdd->chp_personne_prenom) && isset($InfoAuthBdd->chp_personne_nom)) {
$retour .= '<span id="identification_prenom">'.
$objet_pear_auth->getAuthData($InfoAuthBdd->chp_personne_prenom).
'</span> '.
'<span id="identification_nom">'.
$objet_pear_auth->getAuthData($InfoAuthBdd->chp_personne_nom).
'</span>';
} elseif (isset($InfoAuthBdd->chp_structure_nom)) {
$retour .= '<span id="identification_structure">'.
$objet_pear_auth->getAuthData($InfoAuthBdd->chp_structure_nom).
'</span>';
}
$retour .= '</p>'."\n";
$retour .= str_repeat(' ', 16).'<p id="iden_action">'."\n";
// Si l'url de la page de modification de l'inscription est stockée dans les paramêtres, nous l'affichons
if (isset($InfoAuthBdd->url_inscription_modif)) {
$retour .= str_repeat(' ', 20).'<a id="lien_inscription_modif" href="'.
$InfoAuthBdd->url_inscription_modif.'">'.
IDEN_LG_INSCRIPTION_URL_MODIF.
'</a>'."\n";
}
// Affichage du bouton de déconnexion
$objet_url->addQueryString('logout', 1);
$retour .= str_repeat(' ', 20).'<a id="deconnexion" href="'.$objet_url->getURL().'">'.IDEN_LG_DECONNEXION.'</a>'."\n";
$objet_url->removeQueryString('logout');
$retour .= str_repeat(' ', 16).'</p>'."\n";
// L'utilisateur a essayé de s'identifier mais a échoué
if ($login != '') {
$retour .= '<span class="erreur">'.IDEN_ECHEC_AUTH ;
$url_erreur = '#';
if (isset($InfoAuthBdd->url_erreur)) {
$url_erreur = $InfoAuthBdd->url_erreur;
} else if (isset($InfoAuthBdd->url_inscription)) {
$url_erreur = $InfoAuthBdd->url_inscription;
}
$retour .= '<a id="lien_inscription" href="'.$url_erreur.'">'.IDEN_ICI.'</a>' ;
$retour .= '</span>'."\n";
}
$url_inscription_aide = '';
$url_page_inscription = '';
$url_page_modif_inscription = '';
if (isset($InfoAuthBdd->url_inscription)) {
$url_page_inscription = $InfoAuthBdd->url_inscription;
}
if (isset($InfoAuthBdd->url_inscription_modif)) {
$url_page_modif_inscription = $InfoAuthBdd->url_inscription_modif;
}
if (isset($InfoAuthBdd->url_inscription_aide)) {
$url_inscription_aide = $InfoAuthBdd->url_inscription_aide;
}
$chp_personne_prenom='';
if (isset($InfoAuthBdd->chp_personne_prenom)) {
$chp_personne_prenom = $objet_pear_auth->getAuthData($InfoAuthBdd->chp_personne_prenom);
}
$chp_personne_nom='';
if (isset($InfoAuthBdd->chp_personne_nom)) {
$chp_personne_nom = $objet_pear_auth->getAuthData($InfoAuthBdd->chp_personne_nom);
}
$chp_structure='';
if (isset($InfoAuthBdd->chp_structure_nom)) {
$chp_structure = $objet_pear_auth->getAuthData($InfoAuthBdd->chp_structure_nom);
}
if ($objet_pear_auth->getAuth()) { $loggue = true; } else { $loggue = false; }
ob_start();
include_once $options['template'];
$retour = ob_get_contents();
// Arrete et detruit le buffer
ob_end_clean();
 
return $retour;
}
 
272,6 → 217,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.34 2007-09-18 08:40:54 alexandre_tb
* modification de la balise identification pour permettre de preciser un template.
*
* Revision 1.33 2007-08-28 14:23:35 jp_milcent
* Amélioration de la gestion des mots de passe perdus.
*