<?php
#=
/****************************************************************************
Copyright 2002, Daniel Deycard, Jacques Messines, Alain Pomirol
(CATICE Académie de Bordeaux)

This file is part of GiBii/Melia.

GiBii/Melia 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.

GiBii/Melia 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 GiBii/Melia; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

****************************************************************************/
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<?php
include("../include/vars_adm.php");
include("../include/util.inc.php");
recuprequest();
print "<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\">\n";
print "<title>Authentification par GiSCCo</title>";
print "<link rel=\"stylesheet\" href=\"../include/general.css\">";
print "</head>";
print "<BODY class='arial_sadmin'>";

if (!isset($vabene)) { //Formulaire
   $PHP_SELF=basename($_SERVER['PHP_SELF']);
   getparams_auth($etab_id,false);
   if (!isset($CAS_SERVEUR)) $CAS_SERVEUR="";
   if (!isset($CAS_PORT)) $CAS_PORT="";
   if (!isset($CAS_URI)) $CAS_URI="";
   if (!isset($CAS_RETOUR)) $CAS_RETOUR="";

   print "<div align='center'>\n";
   print "<b>Vous avez choisi une authentification de base pour votre &eacute;tablissement.</b><br><hr><br>\n";

   print "<form name='frcas' method='post' action='$PHP_SELF' onsubmit='return confirm('On confirme ?');'>\n";

   print "<p align='center'>\n";
   print "<input type='hidden' name='etab_id' value='$etab_id'>\n";
   print "<input type='submit' class='coul' name='vabene' value='  OK  ' >\n";
   print "&nbsp;&nbsp;&nbsp;\n";
   print "</p>";
   print "</form>";
   print "</div>";
   print "</body>";
   print "</html>\n";
   }
else { //Enregistrement des paramètres
   $conn  = connecte($host,$user,$mdp,$db);
   //Et hop, on sauve le type d'authentification de l'étab !
   query("UPDATE etablissements SET typauth_id=1 WHERE etab_id=$etab_id");
   print "<div align='center'>\n";
   print "C'est fait !";
   print "<form name='fexit'>\n";
   print "<input type='submit' name='exit_btn' value='   OK   '  onclick='window.close();'>\n";
   print "</form>";
   print "</div>";
   print "</body>";
   print "</html>";
}

?>