security_check();
if ($resultat_session == 'c') {
header("Location: ../utilisateurs/mon_compte.php?change_mdp=yes");
die();
} else if ($resultat_session == '0') {
header("Location: ../logout.php?auto=1");
die();
}
if (!checkAccess()) {
header("Location: ../logout.php?auto=1");
die();
}
include("../ckeditor/ckeditor.php");
$msg="";
// pour l'envoi des photos du trombinoscope
if (empty($_POST['action']) and empty($_GET['action'])) { $action = ''; }
else { if (empty($_POST['action'])){$action = ''; } if (empty($_GET['action'])){$action = $_POST['action'];} }
if (empty($_POST['total_photo']) and empty($_GET['total_photo'])) { $total_photo = ''; }
else { if (empty($_POST['total_photo'])){$total_photo = ""; } if (empty($_GET['total_photo'])){$total_photo = $_POST['total_photo'];} }
if (empty($_FILES['photo'])) { $photo = ''; } else { $photo = $_FILES['photo']; }
if (empty($_POST['quiestce'])) { $quiestce = ''; } else { $quiestce = $_POST['quiestce']; }
//répertoire des photos
// En multisite, on ajoute le répertoire RNE
if (isset($GLOBALS['multisite']) AND $GLOBALS['multisite'] == 'y') {
// On récupère le RNE de l'établissement
$rep_photos='../photos/'.$_COOKIE['RNE'].'/personnels/';
}else{
$rep_photos='../photos/personnels/';
}
if(!function_exists('imageFlip')) {
function ImageFlip($imgsrc, $type)
{
//source de cette fonction : http://www.developpez.net/forums/showthread.php?t=54169
$width = imagesx($imgsrc);
$height = imagesy($imgsrc);
$imgdest = imagecreatetruecolor($width, $height);
switch( $type )
{
// mirror wzgl. osi
case IMAGE_FLIP_HORIZONTAL:
for( $y=0 ; $y<$height ; $y++ )
imagecopy($imgdest, $imgsrc, 0, $height-$y-1, 0, $y, $width, 1);
break;
case IMAGE_FLIP_VERTICAL:
for( $x=0 ; $x<$width ; $x++ )
imagecopy($imgdest, $imgsrc, $width-$x-1, 0, $x, 0, 1, $height);
break;
case IMAGE_FLIP_BOTH:
for( $x=0 ; $x<$width ; $x++ )
imagecopy($imgdest, $imgsrc, $width-$x-1, 0, $x, 0, 1, $height);
$rowBuffer = imagecreatetruecolor($width, 1);
for( $y=0 ; $y<($height/2) ; $y++ )
{
imagecopy($rowBuffer, $imgdest , 0, 0, 0, $height-$y-1, $width, 1);
imagecopy($imgdest , $imgdest , 0, $height-$y-1, 0, $y, $width, 1);
imagecopy($imgdest , $rowBuffer, 0, $y, 0, 0, $width, 1);
}
imagedestroy( $rowBuffer );
break;
}
return( $imgdest );
}
}
function ImageRotateRightAngle( $imgSrc, $angle )
{
//source de cette fonction : http://www.developpez.net/forums/showthread.php?t=54169
$angle = min( ( (int)(($angle+45) / 90) * 90), 270 );
if( $angle == 0 )
return( $imgSrc );
$srcX = imagesx( $imgSrc );
$srcY = imagesy( $imgSrc );
switch( $angle )
{
case 90:
$imgDest = imagecreatetruecolor( $srcY, $srcX );
for( $x=0; $x<$srcX; $x++ )
for( $y=0; $y<$srcY; $y++ )
imagecopy($imgDest, $imgSrc, $srcY-$y-1, $x, $x, $y, 1, 1);
break;
case 180:
$imgDest = ImageFlip( $imgSrc, IMAGE_FLIP_BOTH );
break;
case 270:
$imgDest = imagecreatetruecolor( $srcY, $srcX );
for( $x=0; $x<$srcX; $x++ )
for( $y=0; $y<$srcY; $y++ )
imagecopy($imgDest, $imgSrc, $y, $srcX-$x-1, $x, $y, 1, 1);
break;
}
return( $imgDest );
}
function deplacer_fichier_upload($source, $dest) {
$ok = @copy($source, $dest);
if (!$ok) $ok = @move_uploaded_file($source, $dest);
return $ok;
}
function test_ecriture_backup() {
$ok = 'no';
if ($f = @fopen($rep_photos."test", "w")) {
@fputs($f, '<'.'?php $ok = "yes"; ?'.'>');
@fclose($f);
include($rep_photos."test");
$del = @unlink($rep_photos."test");
}
return $ok;
}
// fonction de sécurité
// uid de pour ne pas refaire renvoyer plusieurs fois le même formulaire
// autoriser la validation de formulaire $uid_post===$_SESSION['uid_prime']
if(empty($_SESSION['uid_prime'])) { $_SESSION['uid_prime']=''; }
if (empty($_GET['uid_post']) and empty($_POST['uid_post'])) {$uid_post='';}
else { if (isset($_GET['uid_post'])) {$uid_post=$_GET['uid_post'];} if (isset($_POST['uid_post'])) {$uid_post=$_POST['uid_post'];} }
$uid = md5(uniqid(microtime(), 1));
// on remplace les %20 par des espaces
$uid_post = my_eregi_replace('%20',' ',$uid_post);
if($uid_post===$_SESSION['uid_prime']) { $valide_form = 'oui'; } else { $valide_form = 'non'; }
$_SESSION['uid_prime'] = $uid;
// fin de la fonction de sécurité
//debug_var();
if (isset($action) and ($action == 'depot_photo') and $total_photo != 0 and $valide_form === 'oui' ) {
check_token();
$nb_succes_photos=0;
$nb_photos_proposees=0;
$cpt_photo = 0;
while($cpt_photo < $total_photo) {
if(isset($_FILES['photo']['type'][$cpt_photo])){
if($_FILES['photo']['type'][$cpt_photo] != "") {
$sav_photo = isset($_FILES["photo"]) ? $_FILES["photo"] : NULL;
$nb_photos_proposees++;
/*
echo "\$sav_photo['name'][$cpt_photo]=".$sav_photo['name'][$cpt_photo]."
\n";
echo "preg_match('/jpg$/',\$sav_photo['name'][$cpt_photo])=".preg_match('/jpg$/',$sav_photo['name'][$cpt_photo])."
\n";
echo "\$sav_photo['type'][$cpt_photo]=".$sav_photo['type'][$cpt_photo]."
\n";
*/
if (!isset($sav_photo['tmp_name'][$cpt_photo]) or ($sav_photo['tmp_name'][$cpt_photo] =='')) {
//$msg = "Erreur de téléchargement niveau 1.";
$msg .= "Erreur de téléchargement niveau 1 pour la photo $cpt_photo: '".$sav_photo['name'][$cpt_photo]."'
\n";
} else if (!file_exists($sav_photo['tmp_name'][$cpt_photo])) {
//$msg = "Erreur de téléchargement niveau 2.";
$msg .= "Erreur de téléchargement niveau 2 pour la photo $cpt_photo: '".$sav_photo['name'][$cpt_photo]."'
\n";
//} else if ((!preg_match('/jpg$/',$sav_photo['name'][$cpt_photo])) and $sav_photo['type'][$cpt_photo] == "image/jpeg"){
} else if (!(preg_match('/\.jpg/i',$sav_photo['name'][$cpt_photo]) || preg_match('/\.jpeg/i',$sav_photo['name'][$cpt_photo])) || $sav_photo['type'][$cpt_photo] != "image/jpeg"){
//$msg = "Erreur : seuls les fichiers ayant l'extension .jpg sont autorisés.";
$msg .= "Erreur : seuls les fichiers ayant l'extension .jpg ou .jpeg sont autorisés: '".$sav_photo['name'][$cpt_photo]."'
\n";
} else {
$dest = $rep_photos;
$n = 0;
//$nom_corrige = my_ereg_replace("[^.a-zA-Z0-9_=-]+", "_", $sav_photo['name'][$cpt_photo]);
if (!deplacer_fichier_upload($sav_photo['tmp_name'][$cpt_photo], $rep_photos.$quiestce[$cpt_photo].".jpg")) {
//$msg = "Problème de transfert : le fichier n'a pas pu être transféré sur le répertoire photos/personnels/";
$msg = "Problème de transfert : le fichier '".$sav_photo['name'][$cpt_photo]."' n'a pas pu être transféré sur le répertoire photos/personnels/
\n";
} else {
//$msg = "Téléchargement réussi.";
$nb_succes_photos++;
if (getSettingValue("active_module_trombinoscopes_rd")=='y') {
// si le redimensionnement des photos est activé on redimenssionne
$source = imagecreatefromjpeg($rep_photos.$quiestce[$cpt_photo].".jpg"); // La photo est la source
if (getSettingValue("active_module_trombinoscopes_rt")=='') { $destination = imagecreatetruecolor(getSettingValue("l_resize_trombinoscopes"), getSettingValue("h_resize_trombinoscopes")); } // On crée la miniature vide
if (getSettingValue("active_module_trombinoscopes_rt")!='') { $destination = imagecreatetruecolor(getSettingValue("h_resize_trombinoscopes"), getSettingValue("l_resize_trombinoscopes")); } // On crée la miniature vide
//rotation de l'image si choix différent de rien
//if (getSettingValue("active_module_trombinoscopes_rt")!='') { $degrees = getSettingValue("active_module_trombinoscopes_rt"); /* $destination = imagerotate($destination,$degrees); */$destination = ImageRotateRightAngle($destination,$degrees); }
// Les fonctions imagesx et imagesy renvoient la largeur et la hauteur d'une image
$largeur_source = imagesx($source);
$hauteur_source = imagesy($source);
$largeur_destination = imagesx($destination);
$hauteur_destination = imagesy($destination);
// On crée la miniature
imagecopyresampled($destination, $source, 0, 0, 0, 0, $largeur_destination, $hauteur_destination, $largeur_source, $hauteur_source);
if (getSettingValue("active_module_trombinoscopes_rt")!='') { $degrees = getSettingValue("active_module_trombinoscopes_rt"); /* $destination = imagerotate($destination,$degrees); */$destination = ImageRotateRightAngle($destination,$degrees); }
// On enregistre la miniature sous le nom "mini_couchersoleil.jpg"
imagejpeg($destination, $rep_photos.$quiestce[$cpt_photo].".jpg",100);
}
}
}
}
}
$cpt_photo = $cpt_photo + 1;
}
if(($nb_photos_proposees==$nb_succes_photos)&&($nb_photos_proposees>0)) {
if($nb_succes_photos==1){
$msg.="Téléchargement réussi.";
}
else{
$msg.="Téléchargements réussis.";
}
}
}
// fin de l'envoi des photos du trombinoscope
unset($mode);
$mode = isset($_POST["mode"]) ? $_POST["mode"] : (isset($_GET["mode"]) ? $_GET["mode"] : '');
$tab_statuts=array('administrateur','cpe','professeur','scolarite','secours','autre');
$afficher_statut=isset($_POST['afficher_statut']) ? $_POST['afficher_statut'] : (isset($_GET['afficher_statut']) ? $_GET['afficher_statut'] : "");
$afficher_auth_mode=isset($_POST['afficher_auth_mode']) ? $_POST['afficher_auth_mode'] : (isset($_GET['afficher_auth_mode']) ? $_GET['afficher_auth_mode'] : "");
$tab_auth_mode=array('gepi', 'ldap', 'sso');
$afficher_matiere=isset($_POST['afficher_matiere']) ? $_POST['afficher_matiere'] : (isset($_GET['afficher_matiere']) ? $_GET['afficher_matiere'] : "");
if(isset($_POST['enregistrer_MonCompteAfficheInfo'])) {
check_token();
$nb_reg=0;
$tab_statuts_MonCompteAfficheInfo=array('administrateur', 'scolarite', 'cpe', 'professeur', 'secours', 'eleve', 'responsable', 'autre');
for($loop=0;$loop
";
}
else {
$nb_reg++;
}
}
*/
if(isset($_POST['MonCompteInfo'.ucfirst($tab_statuts_MonCompteAfficheInfo[$loop]).'FCK'])) {
$info = html_entity_decode($_POST['MonCompteInfo'.ucfirst($tab_statuts_MonCompteAfficheInfo[$loop]).'FCK']);
if(!saveSetting('MonCompteInfo'.ucfirst($tab_statuts_MonCompteAfficheInfo[$loop]), $info)) {
$msg.="Erreur lors de l'enregistrement du paramètre 'MonCompteInfo".ucfirst($tab_statuts_MonCompteAfficheInfo[$loop])."'
";
}
else {
$nb_reg++;
}
}
}
if($nb_reg>0) {
$msg.=$nb_reg." enregistrement(s) effectué(s).
";
}
}
//**************** EN-TETE *****************************
if($mode=='personnels') {
$titre_page = "Gestion des personnels";
}
/*
elseif($mode=='eleves') {
$titre_page = "Gestion des comptes élèves";
}
elseif($mode=='responsables') {
$titre_page = "Gestion des comptes responsables";
}
*/
else {
$titre_page = "Gestion des utilisateurs";
}
require_once("../lib/header.inc.php");
//**************** FIN EN-TETE *************************
//debug_var();
//echo "\$total_photo=$total_photo
\$nb_succes_photos=$nb_succes_photos
\$nb_photos_proposees=$nb_photos_proposees
";
unset($display);
$display = isset($_POST["display"]) ? $_POST["display"] : (isset($_GET["display"]) ? $_GET["display"] : (getSettingValue("display_users")!='' ? getSettingValue("display_users"): 'tous'));
// on sauve le choix par défaut
saveSetting("display_users", $display);
unset($order_by);
$order_by = isset($_POST["order_by"]) ? $_POST["order_by"] : (isset($_GET["order_by"]) ? $_GET["order_by"] : 'nom,prenom');
$chemin_retour = urlencode($_SERVER['REQUEST_URI']);
$_SESSION['chemin_retour'] = "../utilisateurs/index.php";
//unset($mode);
//$mode = isset($_POST["mode"]) ? $_POST["mode"] : (isset($_GET["mode"]) ? $_GET["mode"] : '');
if($mode=="MonCompteAfficheInfo") {
echo "
Sur cette page, vous pouvez gérer les comptes d'accès des utilisateurs ayant accès à Gepi grâce à un identifiant et un mot de passe.
Cliquez sur le type d'utilisateurs que vous souhaitez gérer :
Personnels de l'établissement (professeurs, scolarité, CPE, administrateurs)
Responsables d'élèves (parents)
Définir des informations par statut à afficher dans la page 'Gérer mon compte'.
Retour
| Ajouter un personnel
HTML" .
" - CSV";
*/
echo " | Réinitialiser mots de passe : " .
"HTML" .
" - CSV";
echo " | Fiches bienvenue";
echo " | Modif.par lots";
}
?>
| Affecter les matières aux professeurs : Mode 1
- Mode 2
| Aide
Statuts personnalisés';
}
?>
Télécharger au format csv (nom - prénom - identifiant GEPI - EMAIL) le fichier des
professeurs
,
"scolarité"
,
cpe
,
secours
,
administrateurs
,
autres
,
personnels ![]()