Exemplo n.º 1
0
<link href="../style/style.css" rel="stylesheet" type="text/css"/>
<!--[if IE]>
<link href="../style/style-ie.css"  rel="stylesheet" type="text/css"/>
<![endif]-->
</head>
<body>
<h1 class='title'></h1>
<?php 
//si clic sur le bouton Valider
if (isset($_POST['Valider'])) {
    //verification de l'existence du repertoire
    if (file_exists("/home/" . $_SESSION['login'] . "/public_html/")) {
        //traitement du  fichier
        if (!empty($_FILES["FileSelection1"]["name"])) {
            if ($_FILES["FileSelection1"]["size"] > 0) {
                $nomFichier = SansAccent($_FILES["FileSelection1"]["name"]);
                $nomFichier = mb_ereg_replace("'|[[:blank:]]", "_", $nomFichier);
                $nomTemporaire = $_FILES["FileSelection1"]["tmp_name"];
                //chargement du fichier
                copy($nomTemporaire, "/home/" . $_SESSION['login'] . "/public_html/my_cdt.tgz");
                //test de la presence du fichier uploade
                if (file_exists("/home/" . $_SESSION['login'] . "/public_html/my_cdt.tgz")) {
                    //tester le contenu
                    $test = explode("@", $nomFichier);
                    $cmd = "cd /home/" . $_SESSION['login'] . "/public_html/ && tar -tzvf my_cdt.tgz > ctrl.txt && md5sum ctrl.txt | cut -b 10-20";
                    exec($cmd, $retour, $rien);
                    if ($retour[0] == $test[1]) {
                        //deplier l'archive
                        $cmd = "cd /home/" . $_SESSION['login'] . "/public_html/ && tar -mxzvf my_cdt.tgz";
                        exec($cmd, $li, $ret);
                        //importer les tables
Exemplo n.º 2
0
Arquivo: cpe.php Projeto: rhertzog/lcs
        echo '<script type="text/javascript">
        //<![CDATA[
        window.open("./bilancpe.php?kl=' . $ch . '&dd=' . $datdebcla . '&df=' . $datfincla . '","","menubar=no, status=no, scrollbars=yes , width=900, height=600");
        //]]>
        </script>';
    }
}
//fin OKclasse
if (isset($_POST['OKeleve'])) {
    $nom_propre = SansAccent(utf8_decode($_POST['nom']));
    $nom_propre = mb_ereg_replace("^[[:blank:]]", "", $nom_propre);
    $nom_propre = mb_ereg_replace("[[:blank:]]\$", "", $nom_propre);
    $nom_propre = mb_ereg_replace("'|[[:blank:]]", "_", $nom_propre);
    $nom_propre = StrToLower($nom_propre);
    $nom_propre = strip_tags(stripslashes($nom_propre));
    $prenom_propre = SansAccent(utf8_decode($_POST['prenom']));
    $prenom_propre = mb_ereg_replace("^[[:blank:]]", "", $prenom_propre);
    $prenom_propre = mb_ereg_replace("[[:blank:]]\$", "", $prenom_propre);
    $prenom_propre = mb_ereg_replace("'|[[:blank:]]", "_", $prenom_propre);
    $prenom_propre = StrToLower($prenom_propre);
    $prenom_propre = strip_tags(stripslashes($prenom_propre));
    //verifier la presence des eleves dans les classes
    //1.recherche de la classe dans le ldap
    $groups = search_groups('cn=classe*');
    if (count($groups)) {
        for ($loup = 0; $loup < count($groups); $loup++) {
            $cla = $_POST['division'];
            if (mb_ereg("({$cla})\$", $groups[$loup]["cn"])) {
                $full_classe = $groups[$loup]["cn"];
                break;
            }