<?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

****************************************************************************/
include("../include/vars_adm.php");
include("../include/util.inc.php");
include("../include/login.inc.php");
include("../include/utiljs.php");
include("../include/planificateur.inc.php");

connecte($host, $user, $mdp, $db);
@session_start(); //ouvrir la session
//print "sadmin_traite  ";print_r($_SESSION);

$msg_err=sadmin_authentifier();   //met les champs de comptes en variables sess_*

$sess_reptraduction=repertoire($_SERVER['SCRIPT_FILENAME'],2).'langues/fr/';
session_puts('sess_reptraduction');

//Le SADMIN entre directement dans l'applic pour le moment
$entree_SSO=@$_POST['entree_SSO'];
session_puts('entree_SSO');

if ($msg_err) {
    reconnecter($msg_err,'./index.php');
    }
$msg_sess=verifierSession();
if ($msg_sess) {
    reconnecter($msg_sess,'./index.php');
    }
//recupvars();


enregistre_session($_SESSION['sess_compte_id']);


if ($_SESSION['sess_login']!="admstats") {
	if (isset($_POST['changer']))  {
        if ($_SESSION['sess_statut']=="Sadmin")
            header("Location: ../login/login_chgt_mdp.php?suite=../sadmin/sadmin_ut.php&statut=".$_SESSION['sess_statut']);
        }
	else header("Location: ./sadmin_ut.php");
	}
else {
	if (isset($_POST['changer']))  {
        if ($_SESSION['sess_statut']=="Sadmin")
            header("Location: ../login/login_chgt_mdp.php?suite=../sadmin/sadmin_ut_stats.php&statut=".$_SESSION['sess_statut']);
        }
	else header("Location: ./sadmin_ut_stats.php");
	}




?>