Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1087 → Rev 1974

/branches/v1.0-menes/papyrus/applications/admin_auth/configuration/adau_configuration.inc.php
New file
0,0 → 1,81
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | 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: adau_configuration.inc.php,v 1.1 2004-12-06 11:31:42 alex Exp $
/**
* Fichier de configuration général de l'application Administrateur de authentification.
*
* Permet de définir certains paramètres valables pour toutes l'application
* Administrateur de Menus.
*
*@package Admin_auth
*@subpackage Configuration
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Constante stockant la valeur de la langue par défaut pour l'appli ADME.*/
define('ADAU_I18N_DEFAUT', GEN_I18N_ID_DEFAUT);
 
// Chemin des fichiers à inclure.
/** Chemin vers la bibliothèque PEAR.*/
define('ADAU_CHEMIN_BIBLIOTHEQUE_PEAR', '');
/** Chemin vers la bibliothèque API.*/
define('ADAU_CHEMIN_BIBLIOTHEQUE_API', GEN_CHEMIN_API);
/** Chemin vers la bibliothèque de Papyrus.*/
define('ADAU_CHEMIN_BIBLIOTHEQUE_GEN', GEN_CHEMIN_BIBLIO);
 
// Chemin vers les dossiers de l'application
/** Chemin vers l'application Admin Auth de Papyrus.*/
define('ADAU_CHEMIN_APPLICATION', GEN_CHEMIN_APPLICATION.'admin_auth/');
/** Chemin vers les images de l'application Admin Auth de Papyrus.*/
define('ADAU_CHEMIN_IMAGE_INTERFACE', ADAU_CHEMIN_APPLICATION.'presentations/images/interface/');
/** Chemin vers la bibliothèque de l'application Admin Auth de Papyrus.*/
define('ADAU_CHEMIN_BIBLIOTHEQUE', ADAU_CHEMIN_APPLICATION.'bibliotheque/');
/** Chemin vers les classes de l'application Admin Auth de Papyrus.*/
define('ADAU_CHEMIN_CLASSES', ADAU_CHEMIN_APPLICATION.'classes/');
/** Chemin vers les fichiers de traduction de l'application Admin Auth de Papyrus.*/
define('ADAU_CHEMIN_LANGUE', ADAU_CHEMIN_APPLICATION.'langues/');
/** Chemin vers les styles de l'application Admin Auth de Papyrus.*/
define('ADAU_CHEMIN_STYLE', ADAU_CHEMIN_APPLICATION.'presentations/styles/');
 
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/branches/v1.0-menes/papyrus/applications/admin_auth/bibliotheque/HTML_formulaireAuth.class.php
New file
0,0 → 1,182
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | 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: HTML_formulaireAuth.class.php,v 1.4 2006-04-28 12:41:49 florian Exp $
/**
* Application projet
*
* La classe HTML_formulaireAuth
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
/** Inclure le fichier de langue pour utiliser cette classe de façon autonome. */
 
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/checkbox.php' ;
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php' ;
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE des constantes |
// +------------------------------------------------------------------------------------------------------+
 
 
/**
* class HTML_formulaireProjet
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
*/
class HTML_formulaireAuth extends HTML_QuickForm
{
/**
* Constructeur
*
* @param string formName Le nom du formulaire.
* @param string method Soit get soit post, voir le protocole HTTP
* @param string action L'action du formulaire.
* @param string target La cible du formulaire.
* @param Array attributes Des attributs supplémentaires pour la balise <form>
* @param bool trackSubmit Pour repérer si la formulaire a été soumis.
* @return void
* @access public
*/
function HTML_formulaireAuth($formName = '', $method = 'post', $action = '', $target = '_self', $attributes = '', $trackSubmit = false)
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit);
$squelette =& $this->defaultRenderer();
$squelette->setFormTemplate("\n".'<form{attributes}>'."\n".'{content}'."\n".'</form>'."\n");
$squelette->setElementTemplate( '<li>'."\n".
'{label}'."\n".
'{element}'."\n".
'<!-- BEGIN required --><span class="symbole_obligatoire">'.ADAU_SYMBOLE_CHP_OBLIGATOIRE.'</span><!-- END required -->'."\n".
'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
'</li>'."\n");
$squelette->setRequiredNoteTemplate("\n".'<p><span class="symbole_obligatoire">'.ADAU_SYMBOLE_CHP_OBLIGATOIRE.'</span> {requiredNote}</p>'."\n");
} // end of member function HTML_formulaireProjet
 
/**
* Renvoie le code HTML du formulaire.
*
* @return string
* @access public
*/
function toHTML()
{
$res = HTML_QuickForm::toHTML();
return $res;
} // end of member function toHTML
 
/**
* Ajoute les champs nécessaire au formulaire.
*
* @return void
* @access public
*/
function construitFormulaire($url_retour)
{
$tab_index = 1000;
$size = 60;
$cols = 50;
$rows = 6;
$form_debut = '<fieldset>'."\n".'<legend>'.ADAU_NOM_FORM.'</legend>'."\n".'<ul>'."\n";
$this->addElement('html', $form_debut);
$id = 'nom_auth';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_NOM_AUTH.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('nom_auth', ADAU_NOM_AUTH_ALERTE, 'required', '', 'client');
$id = 'abreviation';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_ABREVIATION.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('abreviation', ADAU_ABREVIATION_ALERTE, 'required', '', 'client');
$id = 'dsn';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_DSN.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('dsn', ADAU_DSN_ALERTE, 'required', '', 'client');
$id = 'nom_table';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_NOM_TABLE.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('nom_table', ADAU_NOM_TABLE_ALERTE, 'required', '', 'client');
$id = 'champs_login';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_CHAMPS_LOGIN.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('champs_login', ADAU_CHAMPS_LOGIN_ALERTE, 'required', '', 'client');
$id = 'champs_passe';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_CHAMPS_PASSE.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('champs_passe', ADAU_CHAMPS_PASSE_ALERTE, 'required', '', 'client');
$id = 'cryptage';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'size' => $size);
$label = '<label for="'.$id.'">'.ADAU_CRYPTAGE.'</label>';
$this->addElement('text', $id, $label, $aso_attributs);
$this->addRule('cryptage', ADAU_CRYPTAGE_ALERTE, 'required', '', 'client');
$id = 'parametres';
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++, 'rows' => $rows, 'cols' => $cols);
$label = '<label for="'.$id.'">'.ADAU_PARAMETRE.'</label>';
$this->addElement('textarea', $id, $label, $aso_attributs);
$form_fin = '</ul>'."\n".'</fieldset>'."\n";
$this->addElement('html', $form_fin);
// Gestion des boutons
$liste_bouton_debut = '<ul class="liste_bouton">'."\n";
$this->addElement('html', $liste_bouton_debut);
$this->addElement('submit', 'valider', ADAU_VALIDER);
$bouton_annuler = '<li><a class="bouton" href="'.str_replace ('&amp;', '&', $url_retour->getURL()).'">'.ADAU_ANNULER.'</a></li>'."\n";
$this->addElement('html', $bouton_annuler);
$liste_bouton_fin = '</ul>'."\n";
$this->addElement('html', $liste_bouton_fin);
$this->setRequiredNote(ADAU_CHAMPS_REQUIS);
} // end of member function _construitFormulaire
 
} // end of HTML_formulaireProjet
?>
/branches/v1.0-menes/papyrus/applications/admin_auth/bibliotheque/adau_auth.fonct.php
New file
0,0 → 1,210
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of Papyrus. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: adau_auth.fonct.php,v 1.2 2005-04-14 13:54:51 jpm Exp $
/**
* Contient les fonctions de l'appli admin_auth
*
*
*
*
*@package Admin_auth
*@subpackage Fonctions
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/**
*
*
* @return
*/
function adau_supprimer_authentification($id_auth, &$db)
{
// Recherche l'identifiant de gen_site_auth_bdd à partir de gen_site_auth
$requete = 'SELECT gsa_ce_auth_bdd FROM gen_site_auth WHERE gsa_id_auth = '.$GLOBALS['id_auth'];
$resultat = $db->query ($requete) ;
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$id_auth_bdd = $ligne->gsa_ce_auth_bdd ;
$requete = 'DELETE FROM gen_site_auth WHERE gsa_id_auth = '.$id_auth;
$resultat = $db->query($requete);
$requete = 'DELETE FROM gen_site_auth_bdd WHERE gsab_id_auth_bdd = '.$id_auth_bdd;
$resultat = $db->query($requete);
}
 
/**
*
*
* @return
*/
function adau_valeurs_par_defaut($id_auth, &$db)
{
// Requete sur gen_site_auth
$requete = 'SELECT * FROM gen_site_auth WHERE gsa_id_auth = '.$id_auth;
$resultat = $db->query($requete);
if (DB::isError($resultat)) {
trigger_error('Échec de la requete : '.$requete.'<br />'.$resultat->getMessage(), E_USER_WARNING);
return ;
}
$tableau_retour = array();
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$tableau_retour['nom_auth'] = $ligne->gsa_nom;
$tableau_retour['abreviation'] = $ligne->gsa_abreviation;
$tableau_retour['id_auth_bdd'] = $ligne->gsa_ce_auth_bdd;
$tableau_retour['id_auth'] = $ligne->gsa_id_auth;
unset($requete, $resultat);
// Requete sur gen_site_auth_bdd
$requete = 'SELECT * FROM gen_site_auth_bdd WHERE gsab_id_auth_bdd = '.$ligne->gsa_ce_auth_bdd;
unset($ligne);
$resultat = $db->query($requete);
if (DB::isError($resultat)) {
trigger_error('Échec de la requete : '.$requete.'<br />'.$resultat->getMessage(), E_USER_WARNING);
return ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$tableau_retour['dsn'] = $ligne->gsab_dsn;
$tableau_retour['nom_table'] = $ligne->gsab_nom_table;
$tableau_retour['champs_login'] = $ligne->gsab_nom_champ_login;
$tableau_retour['champs_passe'] = $ligne->gsab_nom_champ_mdp;
$tableau_retour['cryptage'] = $ligne->gsab_cryptage_mdp;
$tableau_retour['parametres'] = $ligne->gsab_parametres;
return $tableau_retour;
}
 
/**
*
*
* @return
*/
function insertion ($valeur, &$db)
{
$id_auth_bdd = SQL_obtenirNouveauId($db, 'gen_site_auth_bdd', 'gsab_id_auth_bdd');
$requete = 'INSERT INTO gen_site_auth SET gsa_id_auth = '
.SQL_obtenirNouveauId($db, 'gen_site_auth', 'gsa_id_auth').', '
.requete_site_auth($valeur)
.', gsa_ce_auth_bdd = '.$id_auth_bdd;
$resultat = $db->query($requete);
if (DB::isError($resultat)) {
trigger_error('Échec de la requete : '.$requete.'<br />'.$resultat->getMessage(), E_USER_WARNING);
return ;
}
$requete = 'INSERT INTO gen_site_auth_bdd SET gsab_id_auth_bdd = '.$id_auth_bdd.', '.requete_site_auth_bdd($valeur);
$resultat = $db->query($requete);
if (DB::isError($resultat)) {
trigger_error('Échec de la requete : '.$requete.'<br />'.$resultat->getMessage(), E_USER_WARNING);
return ;
}
}
 
/**
*
*
* @return
*/
function mise_a_jour($valeur, &$db)
{
$requete = 'UPDATE gen_site_auth SET '.requete_site_auth($valeur).' '.
'WHERE gsa_id_auth = '.$GLOBALS['id_auth'];
$resultat = $db->query($requete);
if (DB::isError($resultat)) {
trigger_error('Échec de la requete : '.$requete.'<br />'.$resultat->getMessage(), E_USER_WARNING);
return ;
}
unset($requete);
// Recherche l'identifiant de gen_site_auth_bdd à partir de gen_site_auth
$requete = 'SELECT gsa_ce_auth_bdd FROM gen_site_auth WHERE gsa_id_auth = '.$GLOBALS['id_auth'];
$resultat = $db->query($requete);
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
$id_auth_bdd = $ligne->gsa_ce_auth_bdd;
$requete = 'UPDATE gen_site_auth_bdd SET '
.requete_site_auth_bdd($valeur)
.' WHERE gsab_id_auth_bdd = '.$id_auth_bdd;
$resultat = $db->query($requete);
if (DB::isError($resultat)) {
trigger_error('Échec de la requete : '.$requete.'<br />'.$resultat->getMessage(), E_USER_WARNING);
return ;
}
}
 
/**
*
*
* @return string un morceau de code SQL
*/
function requete_site_auth(&$valeur)
{
return 'gsa_nom="'.$valeur['nom_auth'].'", '
.'gsa_ce_type_auth=1, '
.'gsa_abreviation="'.$valeur['abreviation'].'"' ;
}
 
/**
*
*
* @return
*/
function requete_site_auth_bdd (&$valeur)
{
return 'gsab_dsn="'.$valeur['dsn'].'", '
.'gsab_nom_table="'.$valeur['nom_table'].'", '
.'gsab_nom_champ_login="'.$valeur['champs_login'].'", '
.'gsab_nom_champ_mdp="'.$valeur['champs_passe'].'", '
.'gsab_parametres="'.$valeur['parametres'].'", '
.'gsab_cryptage_mdp="'.$valeur['cryptage'].'"';
}
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/03/09 10:49:52 jpm
* Changement d'un nom de fichier.
*
* Revision 1.2 2004/12/06 12:43:21 alex
* ajout du champs paramètre dans ls authentification
*
* Revision 1.1 2004/12/06 11:31:54 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/branches/v1.0-menes/papyrus/applications/admin_auth/langues/adau_langue_fr.inc.php
New file
0,0 → 1,86
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of Papyrus. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: adau_langue_fr.inc.php,v 1.4 2006-10-06 10:40:51 florian Exp $
/**
* Gestion des langues de l'application ADME
*
* Contient les constantes pour la langue française de l'application ADME.
*
*@package Admin_auth
*@subpackage Langues
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE des CONSTANTES |
// +------------------------------------------------------------------------------------------------------+
define('ADAU_NOM_AUTH', 'Nom authentification');
define('ADAU_NOM_TABLE', 'Nom de la table annuaire');
define('ADAU_MODIFIER', 'Modifier');
define('ADAU_SUPPRIMER', 'Supprimer');
define('ADAU_SUPPRIMER_MESSAGE', 'Êtes vous sûr de vouloir supprimer cette identification ?');
define('ADAU_AJOUTER', 'Ajouter une authentification base de donnée');
define('ADAU_IDENTIFIEZ_VOUS','Veuillez vous identifier pour acc&egrave;der &agrave; ce menu.');
define('ADAU_NOM_FORM', 'Édition des informations d\'une identification');
define('ADAU_NOM_AUTH_ALERTE', 'Vous devez spécifier un nom');
define('ADAU_CHAMPS_REQUIS', 'Indique les champs requis');
define('ADAU_ABREVIATION', 'Abréviation');
define('ADAU_ABREVIATION_ALERTE', 'Vous devez indiquer une abréviation');
define('ADAU_DSN', 'Source des donnée (dsn)');
define('ADAU_DSN_ALERTE', 'Vous devez indiquer une source des données');
define('ADAU_NOM_TABLE_ALERTE', 'Vous devez indiquer le nom de la table annuaire');
define('ADAU_CHAMPS_LOGIN', 'Nom du champs login');
define('ADAU_CHAMPS_LOGIN_ALERTE', 'Vous devez indiquer le nom du champs login');
define('ADAU_CHAMPS_PASSE', 'Nom du champs mot de passe');
define('ADAU_CHAMPS_PASSE_ALERTE', 'Vous devez indiquer le nom du champs mot de passe');
define('ADAU_CRYPTAGE', 'Fonction de cryptage');
define('ADAU_CRYPTAGE_ALERTE', 'Vous devez indiquer un algorithme de cryptage');
define('ADAU_PARAMETRE', 'Paramètres');
define('ADAU_ANNULER', 'Annuler');
define('ADAU_VALIDER', 'Valider');
define('ADAU_SYMBOLE_CHP_OBLIGATOIRE', '*');
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/04/14 13:54:51 jpm
* Amélioration de l'interface et mise en conformité.
*
* Revision 1.2 2004/12/13 18:07:57 alex
* ajout de labels
*
* Revision 1.1 2004/12/06 11:31:37 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/branches/v1.0-menes/papyrus/applications/admin_auth/admin_auth.php
New file
0,0 → 1,200
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | 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: admin_auth.php,v 1.6 2006-10-06 10:40:51 florian Exp $
/**
* Application gérant les authentifications de Papyrus
*
* Cette application permet de gérer les authentifications de papyrus
* elle permet de spécifier pour un monde quel annuaire utiliser
* et de gérer des authentifications de spip et ou wikini
*
*@package Admin_auth
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.6 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTÊTE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/** Inclusion du fichier de configuration de cette application.*/
require_once GEN_CHEMIN_PAP.'applications/admin_auth/configuration/adau_configuration.inc.php';
 
//Utilisation de la bibliothèque PEAR NET_URL
/** Inclusion de la bibliothèque PEAR de conception de formulaire.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm.php';
/** Inclusion de la bibliothèque PEAR de conception de formulaire : select.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE_PEAR.'HTML/QuickForm/select.php';
 
/** Inclusion de l'API de fonctions gérant les erreurs sql.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE_API.'debogage/BOG_sql.fonct.php';
/** Inclusion des fonctions de manipulation du sql.
* Permet la récupération d'un nouvel identifiant d'une table.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE_API.'sql/SQL_manipulation.fonct.php';
/** Inclusion de la bibliothèque premettant de créer des Tableau HTML fragmentés.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE_API.'html/HTML_TableFragmenteur.php' ;
 
/** Inclusion de la bibliothèque de fonctions concernant les tables "gen_site..." de Papyrus.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE_GEN.'pap_site.fonct.php';
/** Inclusion de la bibliothèque de fonctions concernant les tables "gen_menu..." de Papyrus.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE_GEN.'pap_menu.fonct.php';
/** Inclusion de la bibliothèque de fonctions concernant les tables "gen_applications..." de Papyrus.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE_GEN.'pap_application.fonct.php';
 
/** Inclusion de la bibliothèque de fonctions concernant l'affichage commun.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE.'adau_auth.fonct.php';
/** Inclusion de la classe créer les formulaire des l'appli.*/
require_once ADAU_CHEMIN_BIBLIOTHEQUE.'HTML_formulaireAuth.class.php' ;
 
 
// Inclusion des fichiers de traduction de l'appli ADME dePapyrus
if (file_exists(ADAU_CHEMIN_LANGUE.'adau_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php')) {
/** Inclusion du fichier de traduction suite à la transaction avec le navigateur.*/
require_once ADAU_CHEMIN_LANGUE.'adau_langue_'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php';
} else {
/** Inclusion du fichier de traduction par défaut.*/
require_once ADAU_CHEMIN_LANGUE.'adau_langue_'.ADAU_I18N_DEFAUT.'.inc.php';
}
 
// Stockage des styles de l'application
GEN_stockerStyleExterne('adau_standard', ADAU_CHEMIN_STYLE.'adau_standard.css');
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
function afficherContenuCorps()
{
$db =& $GLOBALS['_GEN_commun']['pear_db'] ;
$url =& $GLOBALS['_GEN_commun']['url'] ;
$auth =& $GLOBALS['_GEN_commun']['pear_auth'] ;
isset ($GLOBALS['action']) ? '' : $GLOBALS['action'] = '' ; // On déclare action si elle n'existe pas
$res='';
if (!$auth->getAuth()) {
$res .= '<p class="zone_alert">'.ADAU_IDENTIFIEZ_VOUS.'</p>'."\n" ;
$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ;
$res .= $url->getURL();
$res .= '" method="post">
<fieldset>
<legend>Identifiez vous</legend>
<label for="username">Courriel : </label>
<input type="text" id="username" name="username" maxlength="80" tabindex="1" value="courriel" />
<label for="password">Mot de passe : </label>
<input type="password" id="password" name="password" maxlength="80" tabindex="2" value="mot de passe" />
<input type="submit" id="connexion" name="connexion" tabindex="3" value="ok" />
</fieldset>
</form>';
return $res ;
} else {
// Le lien pour une nouvelle entrée
$res = '<a href="'.$url->getURL().'&amp;action=nouveau">'.ADAU_AJOUTER.'</a>'."\n".'<br />';
// traitement de la suppression
if (isset ($GLOBALS['action']) && $GLOBALS['action'] == 'supprimer') adau_supprimer_authentification($GLOBALS['id_auth'], $db);
// Traitement de l'ajout
if (isset ($GLOBALS['action']) || isset ($GLOBALS['id_auth'])) {
$formulaire = new HTML_formulaireAuth('formulaire_auth', '', str_replace ('&amp;', '&', $url->getURL()));
$formulaire->construitFormulaire($url);
// On ajoute un champs caché avec action=nouveau_v
if ($GLOBALS['action'] == 'nouveau') {
$formulaire->addElement ('hidden', 'action', 'nouveau_v');
return $formulaire->toHTML();
}
if (isset ($GLOBALS['id_auth']) && $GLOBALS['action'] != 'modifier_v' && $GLOBALS['action'] != 'supprimer') {
$formulaire->addElement ('hidden', 'action', 'modifier_v');
$formulaire->addElement ('hidden', 'id_auth', $GLOBALS['id_auth']);
$formulaire->setDefaults(adau_valeurs_par_defaut($GLOBALS['id_auth'], $db));
return $formulaire->toHTML();
}
if ($GLOBALS['action'] == 'modifier_v') {
if ($formulaire->validate()) {
mise_a_jour ($formulaire->getSubmitValues(), $db);
}
}
if ($GLOBALS['action'] == 'nouveau_v') {
if ($formulaire->validate()) {
insertion ($formulaire->getSubmitValues(), $db);
}
}
}
// Comportement par défaut
// requete sur la table gen_site_auth
$requete = 'SELECT gsa_ce_auth_bdd, gsa_nom, gsab_nom_table '.
'FROM gen_site_auth, gen_site_auth_bdd '.
'WHERE gsa_id_auth <> 0 '.
'AND gsa_ce_auth_bdd = gsab_id_auth_bdd';
$resultat = $db->query($requete);
if (DB::isError($resultat)) {
trigger_error('Échec de la requete : '.$requete.'<br />'.$resultat->getMessage(), E_USER_WARNING);
return ;
}
$liste = new HTML_TableFragmenteur() ;
$liste->construireEntete(array (ADAU_NOM_AUTH, ADAU_NOM_TABLE, ADAU_MODIFIER, ADAU_SUPPRIMER));
$tableau_auth = array();
while ($ligne = $resultat->fetchRow()) {
$url->addQueryString('id_auth', $ligne[0]);
array_push ($tableau_auth, array ('<a href="'.$url->getURL().'">'.$ligne[1].'</a>'."\n", // Première colonne, le nom de l'authentification
$ligne[2], // deuxième colonne, le nom de la table d'annuaire
'<a href="'.$url->getURL().'">'.ADAU_MODIFIER.'</a>'."\n", // Colonne modifier
'<a href="'.$url->getURL().'&amp;action=supprimer" onclick="javascript:return confirm(\''.ADAU_SUPPRIMER_MESSAGE.'\');">'.ADAU_SUPPRIMER.'</a>'."\n"
));
$url->removeQueryString('id_auth');
}
$liste->construireListe($tableau_auth);
$res .= $liste->toHTML();
return $res;
}
}// Fin de la fonction afficherContenuCorps()
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2006/09/21 15:22:04 jp_milcent
* Nettoyage dans l'url de la querystring id_auth.
*
* Revision 1.4 2005/04/14 13:54:51 jpm
* Amélioration de l'interface et mise en conformité.
*
* Revision 1.3 2005/03/09 10:50:08 jpm
* Changement d'un nom de fichier.
*
* Revision 1.2 2005/02/28 10:32:37 jpm
* Changement de nom de dossier.
*
* Revision 1.1 2004/12/06 11:31:59 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>