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.8 2005-03-10 12:50:44 alex Exp $ |
// CVS : $Id: identification.php,v 1.9 2005-03-15 14:17:46 jpm Exp $ |
/** |
* Applette : identification |
* |
38,7 → 38,7 |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.8 $ $Date: 2005-03-10 12:50:44 $ |
*@version $Revision: 1.9 $ $Date: 2005-03-15 14:17:46 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
48,6 → 48,17 |
$_GEN_commun['info_applette_nom_fonction'] = 'afficherFormIdentification'; |
$_GEN_commun['info_applette_balise'] = 'IDENTIFICATION'; |
|
/** Inclusion du fichier de configuration de cette applette.*/ |
require_once GEN_CHEMIN_APPLETTE.'identification/configuration/iden_config.inc.php'; |
|
// Inclusion des fichiers de traduction de l'applette. |
if (file_exists(IDEN_CHEMIN_LANGUE.'iden_langue_'.$_GEN_commun['i18n'].'.inc.php')) { |
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/ |
require_once IDEN_CHEMIN_LANGUE.'iden_langue_'.$_GEN_commun['i18n'].'.inc.php'; |
} else { |
/** Inclusion du fichier de traduction par défaut.*/ |
require_once IDEN_CHEMIN_LANGUE.'iden_langue_'.IDEN_I18N_DEFAUT.'.inc.php'; |
} |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
55,7 → 66,7 |
// Si le site utilise une authentification. |
if ($_GEN_commun['info_auth']->gsa_ce_type_auth == 1) { |
// Si un formulaire nous renvoie en POST une variable "deconnexion", nous délogons l'utilisateur. |
if (isset($_POST['deconnexion'])) { |
if (isset($_REQUEST['deconnexion']) || isset($_REQUEST['logout'])) { |
$_GEN_commun['pear_auth']->logout(); |
// Le test suivant vérifie si une authentification SPIP est en cour, vois pap_initialise_auth.inc.php |
if (isset ($chemin_spip) && isset ($coauth) && $coauth == $auth_courante['gsab_id_auth_bdd']) { |
87,7 → 98,7 |
$_GEN_commun['pear_auth']->start(); |
} |
// Si un formulaire nous renvoie en POST une variable "connexion", nous logons l'utilisateur. |
if (isset($_POST['connexion'])) { |
if (isset($_REQUEST['connexion'])) { |
$_GEN_commun['pear_auth']->login(); |
$_SESSION['username'] = $username; |
} |
106,12 → 117,12 |
* @param array tableau global de Papyrus. |
* @return string formulaire de connexion ou de déconnexion. |
*/ |
function afficherFormIdentification($tab_arguments, $_GEN_commun) |
function afficherFormIdentification($tab_arguments, &$_GEN_commun) |
{ |
// Initialisation de variable. |
$objet_pear_auth = $_GEN_commun['pear_auth']; |
$objet_pear_db = $_GEN_commun['pear_db']; |
$url = $_GEN_commun['url']->getURL(); |
$objet_pear_auth =& $GLOBALS['_GEN_commun']['pear_auth']; |
$objet_pear_db =& $GLOBALS['_GEN_commun']['pear_db']; |
$url = $GLOBALS['_GEN_commun']['url']->getURL(); |
// 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']; |
118,50 → 129,63 |
|
// ATTENTION : Partie à supprimer une fois les mise à jour effectué dans l'annuaire de Tela Botanica |
// Devrait être déplacer dans l'appli inscription de Tela. |
if (isset($_GEN_commun['info_auth_bdd']->gsab_nom_table) && $_GEN_commun['info_auth_bdd']->gsab_nom_table == 'annuaire_tela') { |
if (isset($GLOBALS['_GEN_commun']['info_auth_bdd']->gsab_nom_table) && $GLOBALS['_GEN_commun']['info_auth_bdd']->gsab_nom_table == 'annuaire_tela') { |
verification_mot_de_passe($objet_pear_db, $mot_de_passe, $login); |
if (isset($_POST['connexion'])) { |
$_GEN_commun['pear_auth']->login(); |
$objet_pear_auth->login(); |
} |
} |
|
if (! $objet_pear_auth->getAuth()) { |
// L'utilisateur n'est pas identifié: |
$res = str_repeat(' ', 16).'<form id="form_connexion" action="'.$url.'" method="post">'."\n"; |
$res .= str_repeat(' ', 16).'<fieldset>'."\n"; |
$res .= str_repeat(' ', 20).'<legend>'.'Identification'.'</legend>'."\n"; |
$res .= str_repeat(' ', 20).''."\n"; |
$res .= str_repeat(' ', 24).'<label for="username">'.'Courriel :'.'</label>'."\n"; |
$res .= str_repeat(' ', 24).'<input type="text" size="12" id="username" name="username" maxlength="80" tabindex="1" value="'.'courriel'.'" />'."\n"; |
$res .= str_repeat(' ', 20).''."\n"; |
$res .= str_repeat(' ', 20).''."\n"; |
$res .= str_repeat(' ', 24).'<label for="password">'.'Mot de passe :'.'</label>'."\n"; |
$res .= str_repeat(' ', 24).'<input type="password" size="12" id="password" name="password" maxlength="80" tabindex="2" value="'.'mot de passe'.'" />'."\n"; |
$res .= str_repeat(' ', 20).''."\n"; |
$res .= str_repeat(' ', 20).''."\n"; |
$res .= str_repeat(' ', 24).'<input type="submit" id="connexion" name="connexion" tabindex="3" value="'.'ok'.'" />'."\n"; |
$res .= str_repeat(' ', 20).''."\n"; |
$res .= str_repeat(' ', 16).'</fieldset>'."\n"; |
$res .= str_repeat(' ', 16).'</form>'; |
$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>'.'Identification'.'</legend>'."\n"; |
$retour .= str_repeat(' ', 20).''."\n"; |
$retour .= str_repeat(' ', 24).'<label for="username">'.'Courriel :'.'</label>'."\n"; |
$retour .= str_repeat(' ', 24).'<input type="text" size="12" id="username" name="username" maxlength="80" tabindex="1" value="'.'courriel'.'" />'."\n"; |
$retour .= str_repeat(' ', 20).''."\n"; |
$retour .= str_repeat(' ', 20).''."\n"; |
$retour .= str_repeat(' ', 24).'<label for="password">'.'Mot de passe :'.'</label>'."\n"; |
$retour .= str_repeat(' ', 24).'<input type="password" size="12" id="password" name="password" maxlength="80" tabindex="2" value="'.'mot de passe'.'" />'."\n"; |
$retour .= str_repeat(' ', 20).''."\n"; |
$retour .= str_repeat(' ', 20).''."\n"; |
$retour .= str_repeat(' ', 24).'<input type="submit" id="connexion" name="connexion" tabindex="3" value="'.'ok'.'" />'."\n"; |
$retour .= str_repeat(' ', 20).''."\n"; |
$retour .= str_repeat(' ', 16).'</fieldset>'."\n"; |
$retour .= str_repeat(' ', 16).'</form>'; |
} else { |
// L'utilisateur est identifié. Nous affichons ses informations. |
// Amélioré la récupération des informations sur l'utilisateur. |
//$nom_utilisateur = $objet_pear_auth->getAuthData($champ_nom); |
$retour = str_repeat(' ', 16).'<form id="form_deconnexion" class="form_identification" action="'.$url.'&logout=1" method="post">'."\n"; |
$retour .= str_repeat(' ', 16).'<fieldset>'."\n"; |
$retour .= str_repeat(' ', 20).'<legend>'.'Identification'.'</legend>'."\n"; |
|
$res = str_repeat(' ', 16).'<form id="form_deconnexion" action="'.$url.'&logout=1" method="post">'."\n"; |
$res .= str_repeat(' ', 16).'<fieldset>'."\n"; |
$res .= str_repeat(' ', 20).'<legend>'.'Identification'.'</legend>'."\n"; |
// Il faudrait mettre dans la base de données le prénom et le nom ou chercher comment définir ces champs en fonction |
// de l'annuaire utilisé, si on veut les afficher après le message de bienvenue. |
$res .= str_repeat(' ', 20).'<p>'.'Bienvenue!'.'</p>'."\n"; |
$res .= str_repeat(' ', 20).'<p>'."\n"; |
$res .= str_repeat(' ', 24).'<input type="submit" id="deconnexion" name="deconnexion" tabindex="1" value="'.'déconnexion'.'" />'."\n"; |
$res .= str_repeat(' ', 20).'</p>'."\n"; |
$res .= str_repeat(' ', 16).'</fieldset>'."\n"; |
$res .= str_repeat(' ', 16).'</form>'; |
// 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(' ', 20).'<p><span id="identification_message">'.IDEN_LANG_MESSAGE.'</span> '; |
if (isset($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_personne_prenom) && isset($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_personne_nom)) { |
$retour .= '<span id="identification_prenom">'. |
$objet_pear_auth->getAuthData($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_personne_prenom). |
'</span> '. |
'<span id="identification_nom">'. |
$objet_pear_auth->getAuthData($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_personne_nom). |
'</span>'; |
} elseif (isset($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_structure_nom)) { |
$retour .= '<span id="identification_structure">'. |
$objet_pear_auth->getAuthData($GLOBALS['_GEN_commun']['info_auth_bdd']->chp_structure_nom). |
'</span>'; |
} |
return $res ; |
$retour .= '</p>'."\n"; |
|
// Affichage du bouton de déconnexion |
$retour .= str_repeat(' ', 20).'<p>'."\n"; |
$retour .= str_repeat(' ', 24).'<input type="submit" id="deconnexion" name="deconnexion" tabindex="1" value="'.'déconnexion'.'" />'."\n"; |
$retour .= str_repeat(' ', 20).'</p>'."\n"; |
$retour .= str_repeat(' ', 16).'</fieldset>'."\n"; |
$retour .= str_repeat(' ', 16).'</form>'; |
} |
return $retour; |
} |
|
// +------------------------------------------------------------------------------------------------------+ |
// | PIED du PROGRAMME | |
172,6 → 196,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.8 2005/03/10 12:50:44 alex |
* remplacement de & par & |
* |
* Revision 1.7 2005/01/07 12:43:03 alex |
* réauction de la taille des champs texte à 12 |
* |