Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 299 → Rev 300

/trunk/papyrus/applications/admin_application/bibliotheque/HTML_formulaireAppli.class.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: HTML_formulaireAppli.class.php,v 1.1 2004-12-13 18:07:28 alex Exp $
// CVS : $Id: HTML_formulaireAppli.class.php,v 1.2 2005-03-09 10:40:33 alex Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
55,7 → 55,7
* class HTML_formulaireProjet
* Cette classe représente un formulaire pour saisir un projet ou le modifier.
*/
class HTML_formulaireAuth extends HTML_QuickForm
class HTML_formulaireAppl extends HTML_QuickForm
{
/**
* Constructeur
69,7 → 69,7
* @return void
* @access public
*/
function HTML_formulaireAuth( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
function HTML_formulaireAppl( $formName = "", $method = "post", $action = "", $target = "_self", $attributes = "", $trackSubmit = false )
{
HTML_QuickForm::HTML_QuickForm($formName, $method, $action, $target, $attributes, $trackSubmit) ;
} // end of member function HTML_formulaireProjet
94,38 → 94,18
*/
function construitFormulaire($url_retour)
{
$this->addElement ('text', 'nom_auth', ADAU_NOM_AUTH, array ('size' => 60)) ;
$this->addRule ('nom_auth', ADAU_NOM_AUTH_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'nom_appl', ADAP_NOM_APPL, array ('size' => 60)) ;
$this->addRule ('nom_appl', ADAP_NOM_APPL_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'abreviation', ADAU_ABREVIATION) ;
$this->addRule ('abreviation', ADAU_ABREVIATION_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'dsn', ADAU_DSN) ;
$this->addRule ('dsn', ADAU_DSN_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'nom_table', ADAU_NOM_TABLE) ;
$this->addRule ('nom_table', ADAU_NOM_TABLE_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'champs_login', ADAU_CHAMPS_LOGIN) ;
$this->addRule ('champs_login', ADAU_CHAMPS_LOGIN_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'champs_passe', ADAU_CHAMPS_PASSE) ;
$this->addRule ('champs_passe', ADAU_CHAMPS_PASSE_ALERTE, 'required', '', 'client') ;
$this->addElement ('text', 'cryptage', ADAU_CRYPTAGE) ;
$this->addRule ('cryptage', ADAU_CRYPTAGE_ALERTE, 'required', '', 'client') ;
$this->addElement ('textarea', 'description', ADAP_DESCRIPTION, array ('cols' => 50, 'rows' => 5)) ;
$this->addElement ('text', 'chemin', ADAP_CHEMIN, array('size' => 50)) ;
$this->addElement ('checkbox', 'applette', ADAP_APPLETTE, '', 0) ;
 
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAU_CHAMPS_REQUIS) ;
$this->setRequiredNote('<span style="color: #ff0000">*</span>'.ADAP_CHAMPS_REQUIS) ;
// on fait un groupe avec les boutons pour les mettres sur la même ligne
$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAU_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&amp;', '&', $url_retour->getURL())."'"));
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAU_VALIDER);
$buttons[] = &HTML_QuickForm::createElement('button', 'annuler', ADAP_ANNULER, array ("onclick" => "javascript:document.location.href='".str_replace ('&amp;', '&', $url_retour->getURL())."'"));
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider', ADAP_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
} // end of member function _construitFormulaire
 
} // end of HTML_formulaireProjet
?>
/trunk/papyrus/applications/admin_application/bibliotheque/admi_application.fonct.php
21,7 → 21,7
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: admi_application.fonct.php,v 1.1 2004-12-13 18:07:28 alex Exp $
// CVS : $Id: admi_application.fonct.php,v 1.2 2005-03-09 10:40:33 alex Exp $
/**
* Contient les fonctions de l'appli admin_auth
*
35,7 → 35,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
49,19 → 49,9
* @return
*/
 
function adau_supprimer_authentification($id_auth, &$db) {
 
// on 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'] ;
function adap_supprimer_application($id_appl, &$db) {
$requete = "delete from gen_application where gap_id_application=$id_appl" ;
$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) ;
}
 
/**
70,10 → 60,10
* @return
*/
 
function adau_valeurs_par_defaut ($id_auth, &$db) {
function adap_valeurs_par_defaut ($id_appl, &$db) {
// requete sur gen_site_auth
$requete = "select * from gen_site_auth where gsa_id_auth=$id_auth" ;
$requete = "select * from gen_application where gap_id_application=$id_appl" ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(), E_USER_WARNING) ;
81,28 → 71,11
}
$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 ;
$tableau_retour['nom_appl'] = $ligne->gap_nom ;
$tableau_retour['description'] = $ligne->gap_description ;
$tableau_retour['chemin'] = $ligne->gap_chemin ;
$tableau_retour['applette'] = $ligne->gap_bool_applette ;
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("Echec 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 ;
return $tableau_retour ;
}
 
113,21 → 86,14
*/
 
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 ;
$id_appl_bdd = SQL_obtenirNouveauId ($db, 'gen_application', 'gap_id_application') ;
$requete = "insert into gen_application set gap_id_application="
.$id_appl_bdd.","
.requete_site_appl($valeur) ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
$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("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
}
 
/**
137,26 → 103,12
*/
 
function mise_a_jour ($valeur, &$db) {
$requete = "update gen_site_auth set ".requete_site_auth($valeur)
.' where gsa_id_auth='.$GLOBALS['id_auth'] ;
$requete = "update gen_application set ".requete_site_appl($valeur)
.' where gap_id_application='.$GLOBALS['id_appl'] ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
unset ($requete) ;
// on 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("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
}
 
/**
165,25 → 117,14
* @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'].'"' ;
function requete_site_appl (&$valeur) {
return 'gap_nom="'.$valeur['nom_appl'].'", '
.'gap_description="'.$valeur['description'].'", '
.'gap_chemin="'.$valeur['chemin'].'", '
.'gap_bool_applette="'.$valeur['applette'].'"';
}
 
/**
*
*
* @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_cryptage_mdp="'.$valeur['cryptage'].'"';
}
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
192,7 → 133,10
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2004/12/13 18:07:28 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>