* Vous devriez avoir reçu une copie de la Licence Publique Générale GNU Affero avec SACoche ;
 * si ce n’est pas le cas, consultez : <http://www.gnu.org/licenses/>.
 * 
 */

if(!defined('SACoche')) {exit('Ce fichier ne peut être appelé directement !');}
$TITRE = html(Lang::_("Réglage des autorisations"));

// Tableau avec les noms des profils activés dans l'établissement
$tab_profils_libelles = array();
$tab_profil_join_groupes  = array();
$tab_profil_join_matieres = array();
Layout::add( 'js_inline_before' , 'var tab_profil_join_groupes  = new Array();' );
Layout::add( 'js_inline_before' , 'var tab_profil_join_matieres = new Array();' );

$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres( 'user_profil_type,user_profil_join_groupes,user_profil_join_matieres,user_profil_nom_court_pluriel' /*listing_champs*/ , TRUE /*only_actif*/ );
$DB_TAB[] = array( 'user_profil_sigle' => 'ONLY_COORD' , 'user_profil_type' => '' , 'user_profil_join_groupes' => 0 , 'user_profil_join_matieres' => 0 , 'user_profil_nom_court_pluriel' => 'restriction aux<br />coordonnateurs<br />matières' );
$DB_TAB[] = array( 'user_profil_sigle' => 'ONLY_PP'    , 'user_profil_type' => '' , 'user_profil_join_groupes' => 0 , 'user_profil_join_matieres' => 0 , 'user_profil_nom_court_pluriel' => 'restriction aux<br />professeurs<br />principaux' );
$DB_TAB[] = array( 'user_profil_sigle' => 'ONLY_LV'    , 'user_profil_type' => '' , 'user_profil_join_groupes' => 0 , 'user_profil_join_matieres' => 0 , 'user_profil_nom_court_pluriel' => 'restriction aux<br />professeurs<br />de LV' );
foreach($DB_TAB as $DB_ROW)
{
  $tab_profils_libelles[$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_nom_court_pluriel'];
  $is_profil_join_groupe = ( ($DB_ROW['user_profil_type']=='professeur') && ($DB_ROW['user_profil_join_groupes']=='config') ) ? TRUE : FALSE ;
  $tab_profil_join_groupes[$DB_ROW['user_profil_sigle']] = $is_profil_join_groupe;
  $is_profil_join_groupe = ($is_profil_join_groupe) ? 'true' : 'false' ;
  Layout::add( 'js_inline_before' , 'tab_profil_join_groupes["'.$DB_ROW['user_profil_sigle'].'" ] = '.$is_profil_join_groupe.';' );
  $is_profil_join_matiere = ( ($DB_ROW['user_profil_type']=='professeur') && ($DB_ROW['user_profil_join_matieres']=='config') ) ? TRUE : FALSE ;
  $tab_profil_join_matieres[$DB_ROW['user_profil_sigle']] = $is_profil_join_matiere;
  $is_profil_join_matiere = ($is_profil_join_matiere) ? 'true' : 'false' ;
  Layout::add( 'js_inline_before' , 'tab_profil_join_matieres["'.$DB_ROW['user_profil_sigle'].'"] = '.$is_profil_join_matiere.';' );
}
  <div><label class="tab" for="f_statut">Statut :</label><?php echo $select_f_statuts ?></div>
  <p class="ti"><button id="f_doublon" name="f_doublon" type="submit" class="rechercher">Rechercher</button> des responsables homonymes susceptibles d'être des comptes en double.</p>
</form>

<hr />

<?php

if(empty($_POST['f_afficher']))
{
  return; // Ne pas exécuter la suite de ce fichier inclus.
}

// Options du formulaire de profils
$options = '';
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres( 'user_profil_nom_long_singulier' /*listing_champs*/ , TRUE /*only_actif*/ , 'parent' /*only_listing_profils_types*/ );
foreach($DB_TAB as $DB_ROW)
{
  $options .= '<option value="'.$DB_ROW['user_profil_sigle'].'">'.$DB_ROW['user_profil_sigle'].' &rarr; '.$DB_ROW['user_profil_nom_long_singulier'].'</option>';
}

// Lister les parents, par nom / prénom ou recherche d'homonymies
if(!$find_doublon)
{
  $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_parents_avec_infos_enfants( FALSE /*with_adresse*/ , $statut , $debut_nom , $debut_prenom );
}
elseif($find_doublon) // (forcément)
{
  $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::lister_parents_homonymes();
  if(!empty($DB_TAB))
  {
 foreach ($DB_TAB as $DB_ROW) {
     $tab_users_base['id'][] = (int) $DB_ROW['user_id'];
     $tab_users_base['ordre'][] = $tab_ordre[$DB_ROW['user_profil_sigle']];
     $tab_users_base['profil'][] = $DB_ROW['user_profil_sigle'];
     $tab_users_base['id_ent'][] = $DB_ROW['user_id_ent'];
     $tab_users_base['nom'][] = $DB_ROW['user_nom'];
     $tab_users_base['prenom'][] = $DB_ROW['user_prenom'];
     $tab_users_base['id_sconet'][] = (int) $DB_ROW['user_sconet_id'];
 }
 // On trie
 array_multisort($tab_users_base['ordre'], SORT_ASC, SORT_NUMERIC, $tab_users_base['profil'], SORT_ASC, SORT_STRING, $tab_users_base['nom'], SORT_ASC, SORT_STRING, $tab_users_base['prenom'], SORT_ASC, SORT_STRING, $tab_users_base['id'], $tab_users_base['id_ent'], $tab_users_base['id_sconet']);
 // On retire l'ordre dont on n'a plus besoin
 unset($tab_users_base['ordre']);
 // Lister les profils ; ne peut être récupéré via la requête précédente à cause de profils présents dans l'ENT dont il n'y aurait aucun utilisateur dans la base SACoche
 $tab_profils = array();
 $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres('user_profil_nom_court_singulier', FALSE);
 foreach ($DB_TAB as $DB_ROW) {
     $tab_profils[$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_nom_court_singulier'];
 }
 // Observer le contenu de l'ENT et comparer avec le contenu de la base
 $lignes_ras = '';
 $lignes_modif = '';
 $lignes_pb = '';
 $lignes_inconnu = '';
 // de SACoche non trouvé dans l'ENT
 $lignes_reste = '';
 // de l'ENT non trouvé dans SACoche
 // Pour chaque user SACoche ...
 foreach ($tab_users_base['id_ent'] as $i_base => $id_ent_SACoche) {
     $i_ENT = 0;
     // Si id_sconet (user_sconet_id) est renseigné (élèves uniquement), on recherche l'utilisateur de l'ENT de même id_sconet
}
// Outil de résolution de bug ; le test1 provoque parfois l'erreur "Array sizes are inconsistent".
// Edit au 11/05/2012 : a priori c'est corrigé, mais je laisse quand même le test au cas où, ça ne coûte rien...
if (!$test1) {
    ajouter_log_PHP('Import fichier ' . $import_origine . ' ' . $import_profil, serialize($tab_users_fichier), __FILE__, __LINE__, TRUE);
}
// On enregistre
FileSystem::ecrire_fichier(CHEMIN_DOSSIER_IMPORT . 'import_' . $import_origine . '_' . $import_profil . '_' . $_SESSION['BASE'] . '_' . session_id() . '_users.txt', serialize($tab_users_fichier));
FileSystem::ecrire_fichier(CHEMIN_DOSSIER_IMPORT . 'import_' . $import_origine . '_' . $import_profil . '_' . $_SESSION['BASE'] . '_' . session_id() . '_classes.txt', serialize($tab_classes_fichier));
FileSystem::ecrire_fichier(CHEMIN_DOSSIER_IMPORT . 'import_' . $import_origine . '_' . $import_profil . '_' . $_SESSION['BASE'] . '_' . session_id() . '_groupes.txt', serialize($tab_groupes_fichier));
FileSystem::ecrire_fichier(CHEMIN_DOSSIER_IMPORT . 'import_' . $import_origine . '_' . $import_profil . '_' . $_SESSION['BASE'] . '_' . session_id() . '_liens_id_base.txt', serialize($tab_liens_id_base));
// On affiche le bilan des utilisateurs trouvés
if (count($tab_users_fichier['profil_sigle'])) {
    // Nom des profils
    $tab_profils_libelles = array();
    $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres('user_profil_nom_long_singulier,user_profil_nom_long_pluriel', FALSE);
    foreach ($DB_TAB as $DB_ROW) {
        $tab_profils_libelles[$DB_ROW['user_profil_sigle']] = array(1 => $DB_ROW['user_profil_nom_long_singulier'], 2 => $DB_ROW['user_profil_nom_long_pluriel']);
    }
    // Boucle pour l'affichage
    $tab_profil_nombre = array_count_values($tab_users_fichier['profil_sigle']);
    foreach ($tab_profil_nombre as $profil => $nombre) {
        $s = $nombre > 1 ? 's' : '';
        echo '<p><label class="valide">' . $nombre . ' ' . $tab_profils_libelles[$profil][min(2, $nombre)] . ' trouvé' . $s . '.</label></p>' . NL;
    }
} else {
    if ($import_profil == 'parent') {
        exit('<p><label class="alerte">Aucun parent trouvé ayant un enfant dans l\'établissement : importer d\'abord les élèves !</label></p>');
    } else {
        exit('<p><label class="alerte">Aucun utilisateur trouvé !</label></p>');
    }
 * si ce n’est pas le cas, consultez : <http://www.gnu.org/licenses/>.
 * 
 */

if(!defined('SACoche')) {exit('Ce fichier ne peut être appelé directement !');}
$TITRE = html(Lang::_("Délai avant déconnexion"));

// Options du formulaire select
$options = '';
for($delai=10 ; $delai<130 ; $delai+=10)
{
  $options .= '<option value="'.$delai.'">'.$delai.' minutes</option>';
}

// Lister les profils de l'établissement
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres( 'user_profil_nom_court_pluriel,user_profil_nom_long_pluriel,user_profil_duree_inactivite' /*listing_champs*/ , TRUE /*only_actif*/ );

?>

<div><span class="manuel"><a class="pop_up" href="<?php echo SERVEUR_DOCUMENTAIRE ?>?fichier=support_administrateur__gestion_delai_deconnexion">DOC : Délai avant déconnexion</a></span></div>

<hr />

<h2>Appliquer à tous les profils</h2>

<form action="#" method="post">
  <p><label class="tab" for="f_delai_ALL">Délai :</label><select id="f_delai_ALL" name="f_delai_ALL"><?php echo str_replace('value="30"','value="30" selected',$options) ?></select> <button id="bouton_valider_ALL" type="button" class="parametre">Valider.</button><label id="ajax_msg_ALL">&nbsp;</label></p>
</form>

<hr />
?>
?fichier=support_administrateur__gestion_profils">DOC : Choix des profils utilisateurs</a></span></div>

<hr />

<form action="#" method="post" id="form_principal">
  <table id="table_action" class="form">
    <thead>
      <tr><th class="nu"></th><th>Sigle</th><th>Profil</th><th>Obligatoire</th><th>Rattachement aux groupes</th><th>Rattachement aux matières</th></tr>
    </thead>
    <tbody>
      <?php 
$tab_txt_groupes = array('sansobjet' => 'sans objet', 'auto' => 'automatique (selon affectations)', 'all' => 'automatique (à tous)', 'config' => 'à configurer');
$tab_txt_matieres = array('sansobjet' => 'sans objet', 'auto' => 'automatique (selon affectations)', 'all' => 'automatique (à toutes)', 'config' => 'à configurer (si évaluation)');
// Lister les profils
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres('user_profil_actif,user_profil_obligatoire,user_profil_join_groupes,user_profil_join_matieres,user_profil_nom_long_singulier', FALSE);
foreach ($DB_TAB as $DB_ROW) {
    // Afficher une ligne du tableau
    $checked = $DB_ROW['user_profil_actif'] ? ' checked' : '';
    $disabled = $DB_ROW['user_profil_obligatoire'] ? ' disabled' : '';
    // readonly ne fonctionne que sur les input de type "text".
    $txt_obligatoire = $DB_ROW['user_profil_obligatoire'] ? 'oui' : 'non';
    echo '<tr>';
    echo '<td class="nu"><input type="checkbox" name="f_tab_id" value="' . $DB_ROW['user_profil_sigle'] . '"' . $checked . $disabled . ' /></td>';
    echo '<td class="label">' . html($DB_ROW['user_profil_sigle']) . '</td>';
    echo '<td class="label">' . html($DB_ROW['user_profil_nom_long_singulier']) . '</td>';
    echo '<td class="label">' . $txt_obligatoire . '</td>';
    echo '<td class="label">' . $tab_txt_groupes[$DB_ROW['user_profil_join_groupes']] . '</td>';
    echo '<td class="label">' . $tab_txt_matieres[$DB_ROW['user_profil_join_matieres']] . '</td>';
    echo '</tr>' . NL;
}
 * 
 * Vous devriez avoir reçu une copie de la Licence Publique Générale GNU Affero avec SACoche ;
 * si ce n’est pas le cas, consultez : <http://www.gnu.org/licenses/>.
 * 
 */
if (!defined('SACoche')) {
    exit('Ce fichier ne peut être appelé directement !');
}
$TITRE = html(Lang::_("Format des identifiants de connexion"));
// Options du formulaire select
$options = '';
for ($mdp_length = 4; $mdp_length < 9; $mdp_length++) {
    $options .= '<option value="' . $mdp_length . '">' . $mdp_length . ' caractères</option>';
}
// Lister les profils de l'établissement
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres('user_profil_nom_court_pluriel,user_profil_nom_long_pluriel,user_profil_login_modele,user_profil_mdp_longueur_mini,user_profil_mdp_date_naissance', TRUE);
?>
<div><span class="manuel"><a class="pop_up" href="<?php 
echo SERVEUR_DOCUMENTAIRE;
?>
?fichier=support_administrateur__gestion_format_logins">DOC : Format des identifiants</a></span></div>

<hr />

<h2>Appliquer à tous les profils</h2>

<form action="#" method="post">
  <p>
    <label class="tab">Identifiants :</label>Modèle du nom d'utilisateur <input type="text" id="f_login_ALL" name="f_login_ALL" value="ppp.nnnnnnnn" size="20" maxlength="20" /><br />
    <span class="tab"></span>Longueur minimale du mot de passe <select id="f_mdp_ALL" name="f_mdp_ALL"><?php 
echo str_replace('value="6"', 'value="6" selected', $options);
 * 
 * Vous devriez avoir reçu une copie de la Licence Publique Générale GNU Affero avec SACoche ;
 * si ce n’est pas le cas, consultez : <http://www.gnu.org/licenses/>.
 * 
 */
if (!defined('SACoche')) {
    exit('Ce fichier ne peut être appelé directement !');
}
$TITRE = html(Lang::_("Délai avant déconnexion"));
// Options du formulaire select
$options = '';
for ($delai = 10; $delai < 130; $delai += 10) {
    $options .= '<option value="' . $delai . '">' . $delai . ' minutes</option>';
}
// Lister les profils de l'établissement
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres('user_profil_nom_court_pluriel,user_profil_nom_long_pluriel,user_profil_duree_inactivite', TRUE);
?>

<div><span class="manuel"><a class="pop_up" href="<?php 
echo SERVEUR_DOCUMENTAIRE;
?>
?fichier=support_administrateur__gestion_delai_deconnexion">DOC : Délai avant déconnexion</a></span></div>

<hr />

<h2>Appliquer à tous les profils</h2>

<form action="#" method="post">
  <p><label class="tab" for="f_delai_ALL">Délai :</label><select id="f_delai_ALL" name="f_delai_ALL"><?php 
echo str_replace('value="30"', 'value="30" selected', $options);
?>
Esempio n. 9
0
 /**
  * Enregistrer en session les informations authentifiant un utilisateur (sauf profils webmestre / développeur / partenaire).
  * 
  * @param int     $BASE
  * @param array   $DB_ROW   ligne issue de la table sacoche_user correspondant à l'utilisateur qui se connecte.
  * @return void
  */
 public static function initialiser_utilisateur($BASE,$DB_ROW)
 {
   // Récupérer et Enregistrer en session les données associées à l'établissement (indices du tableau de session en majuscules).
   $DB_TAB_PARAM = DB_STRUCTURE_PUBLIC::DB_lister_parametres();
   $tab_type_entier  = array(
     'SESAMATH_ID',
     'MOIS_BASCULE_ANNEE_SCOLAIRE',
     'DROIT_ELEVE_DEMANDES',
     'CALCUL_VALEUR_RR',
     'CALCUL_VALEUR_R',
     'CALCUL_VALEUR_V',
     'CALCUL_VALEUR_VV',
     'CALCUL_SEUIL_R',
     'CALCUL_SEUIL_V',
     'CALCUL_LIMITE',
     'CAS_SERVEUR_PORT',
     'CAS_SERVEUR_VERIF_CERTIF_SSL',
     'ENVELOPPE_HORIZONTAL_GAUCHE',
     'ENVELOPPE_HORIZONTAL_MILIEU',
     'ENVELOPPE_HORIZONTAL_DROITE',
     'ENVELOPPE_VERTICAL_HAUT',
     'ENVELOPPE_VERTICAL_MILIEU',
     'ENVELOPPE_VERTICAL_BAS',
     'ETABLISSEMENT_IP_VARIABLE',
     'OFFICIEL_ARCHIVE_AJOUT_MESSAGE_COPIE',
     'OFFICIEL_ARCHIVE_RETRAIT_TAMPON_SIGNATURE',
     'OFFICIEL_BULLETIN_ONLY_SOCLE',
     'OFFICIEL_BULLETIN_APPRECIATION_RUBRIQUE_LONGUEUR',
     'OFFICIEL_BULLETIN_APPRECIATION_RUBRIQUE_REPORT',
     'OFFICIEL_BULLETIN_APPRECIATION_GENERALE_LONGUEUR',
     'OFFICIEL_BULLETIN_APPRECIATION_GENERALE_REPORT',
     'OFFICIEL_BULLETIN_ASSIDUITE',
     'OFFICIEL_BULLETIN_BARRE_ACQUISITIONS',
     'OFFICIEL_BULLETIN_ACQUIS_TEXTE_NOMBRE',
     'OFFICIEL_BULLETIN_ACQUIS_TEXTE_CODE',
     'OFFICIEL_BULLETIN_MOYENNE_SCORES',
     'OFFICIEL_BULLETIN_CONVERSION_SUR_20',
     'OFFICIEL_BULLETIN_MOYENNE_CLASSE',
     'OFFICIEL_BULLETIN_MOYENNE_GENERALE',
     'OFFICIEL_BULLETIN_FUSION_NIVEAUX',
     'OFFICIEL_MARGE_GAUCHE',
     'OFFICIEL_MARGE_DROITE',
     'OFFICIEL_MARGE_HAUT',
     'OFFICIEL_MARGE_BAS',
     'OFFICIEL_RELEVE_ONLY_SOCLE',
     'OFFICIEL_RELEVE_APPRECIATION_RUBRIQUE_LONGUEUR',
     'OFFICIEL_RELEVE_APPRECIATION_RUBRIQUE_REPORT',
     'OFFICIEL_RELEVE_APPRECIATION_GENERALE_LONGUEUR',
     'OFFICIEL_RELEVE_APPRECIATION_GENERALE_REPORT',
     'OFFICIEL_RELEVE_ASSIDUITE',
     'OFFICIEL_RELEVE_ETAT_ACQUISITION',
     'OFFICIEL_RELEVE_MOYENNE_SCORES',
     'OFFICIEL_RELEVE_POURCENTAGE_ACQUIS',
     'OFFICIEL_RELEVE_CONVERSION_SUR_20',
     'OFFICIEL_RELEVE_CASES_NB',
     'OFFICIEL_RELEVE_AFF_COEF',
     'OFFICIEL_RELEVE_AFF_SOCLE',
     'OFFICIEL_RELEVE_AFF_DOMAINE',
     'OFFICIEL_RELEVE_AFF_THEME',
     'OFFICIEL_SOCLE_APPRECIATION_RUBRIQUE_LONGUEUR',
     'OFFICIEL_SOCLE_APPRECIATION_RUBRIQUE_REPORT',
     'OFFICIEL_SOCLE_APPRECIATION_GENERALE_LONGUEUR',
     'OFFICIEL_SOCLE_APPRECIATION_GENERALE_REPORT',
     'OFFICIEL_SOCLE_ASSIDUITE',
     'OFFICIEL_SOCLE_ONLY_PRESENCE',
     'OFFICIEL_SOCLE_POURCENTAGE_ACQUIS',
     'OFFICIEL_SOCLE_ETAT_VALIDATION',
     'USER_DALTONISME',
   );
   $tab_type_tableau = array(
     'CSS_BACKGROUND-COLOR',
     'CALCUL_VALEUR',
     'CALCUL_SEUIL',
     'NOTE_IMAGE',
     'NOTE_TEXTE',
     'NOTE_LEGENDE',
     'ACQUIS_TEXTE',
     'ACQUIS_LEGENDE',
     'ETABLISSEMENT',
     'ENVELOPPE',
     'OFFICIEL',
     'CAS_SERVEUR',
   );
   foreach($DB_TAB_PARAM as $DB_ROW_PARAM)
   {
     $parametre_nom = strtoupper($DB_ROW_PARAM['parametre_nom']);
     // Certains paramètres sont de type entier.
     $parametre_valeur = (in_array($parametre_nom,$tab_type_entier)) ? (int) $DB_ROW_PARAM['parametre_valeur'] : $DB_ROW_PARAM['parametre_valeur'] ;
     // Certains paramètres sont à enregistrer sous forme de tableau.
     $find = FALSE;
     foreach($tab_type_tableau as $key1)
     {
       $longueur_key1 = strlen($key1);
       if(substr($parametre_nom,0,$longueur_key1)==$key1)
       {
         $key2 = substr($parametre_nom,$longueur_key1+1);
         $_SESSION[$key1][$key2] = $parametre_valeur ;
         $find = TRUE;
         break;
       }
     }
     // Les autres paramètres sont à enregistrer tels quels.
     if(!$find)
     {
       $_SESSION[$parametre_nom] = $parametre_valeur ;
     }
   }
   // Enregistrer en session le numéro de la base.
   $_SESSION['BASE']                   = $BASE;
   // C'est un utilisateur d'un établissement.
   $_SESSION['USER_ETABLISSEMENT']     = TRUE;
   // Enregistrer en session les données associées au profil de l'utilisateur.
   $_SESSION['USER_PROFIL_SIGLE']      = $DB_ROW['user_profil_sigle'];
   $_SESSION['USER_PROFIL_TYPE']       = $DB_ROW['user_profil_type'];
   $_SESSION['USER_PROFIL_NOM_COURT']  = $DB_ROW['user_profil_nom_court_singulier'];
   $_SESSION['USER_PROFIL_NOM_LONG']   = $DB_ROW['user_profil_nom_long_singulier'];
   $_SESSION['USER_JOIN_GROUPES']      = $DB_ROW['user_profil_join_groupes'];   // Seuls les enseignants sont rattachés à des classes et groupes définis ; les autres le sont à tout l'établissement.
   $_SESSION['USER_JOIN_MATIERES']     = $DB_ROW['user_profil_join_matieres'] ; // Seuls les directeurs sont rattachés à toutes les matières ; les autres le sont à des matières définies.
   $_SESSION['USER_MDP_LONGUEUR_MINI'] = (int) $DB_ROW['user_profil_mdp_longueur_mini'];
   $_SESSION['USER_DUREE_INACTIVITE']  = (int) $DB_ROW['user_profil_duree_inactivite'];
   // Enregistrer en session les données personnelles de l'utilisateur.
   $_SESSION['USER_ID']                = (int) $DB_ROW['user_id'];
   $_SESSION['USER_SWITCH_ID']         = $DB_ROW['user_switch_id'];
   $_SESSION['USER_GENRE']             = $DB_ROW['user_genre'];
   $_SESSION['USER_NOM']               = $DB_ROW['user_nom'];
   $_SESSION['USER_PRENOM']            = $DB_ROW['user_prenom'];
   $_SESSION['USER_NAISSANCE_DATE']    = $DB_ROW['user_naissance_date'];
   $_SESSION['USER_EMAIL']             = $DB_ROW['user_email'];
   $_SESSION['USER_EMAIL_ORIGINE']     = $DB_ROW['user_email_origine'];
   $_SESSION['USER_LOGIN']             = $DB_ROW['user_login'];
   $_SESSION['USER_LANGUE']            = $DB_ROW['user_langue'];
   $_SESSION['USER_DALTONISME']        = $DB_ROW['user_daltonisme'];
   $_SESSION['USER_ID_ENT']            = $DB_ROW['user_id_ent'];
   $_SESSION['USER_ID_GEPI']           = $DB_ROW['user_id_gepi'];
   $_SESSION['USER_PARAM_ACCUEIL']     = $DB_ROW['user_param_accueil'];
   $_SESSION['ELEVE_CLASSE_ID']        = (int) $DB_ROW['eleve_classe_id'];
   $_SESSION['ELEVE_CLASSE_NOM']       = $DB_ROW['groupe_nom'];
   $_SESSION['ELEVE_LANGUE']           = (int) $DB_ROW['eleve_langue'];
   $_SESSION['DELAI_CONNEXION']        = (int) $DB_ROW['delai_connexion_secondes']; // Vaut (int)NULL = 0 à la 1e connexion, mais dans ce cas $_SESSION['FIRST_CONNEXION'] est testé avant.
   $_SESSION['FIRST_CONNEXION']        = ($DB_ROW['user_connexion_date']===NULL) ? TRUE : FALSE ;
   if( ($DB_ROW['user_connexion_date']===NULL) && ($DB_ROW['user_profil_type']!='administrateur') )
   {
     $_SESSION['STOP_CNIL'] = TRUE;
   }
   // Récupérer et Enregistrer en session les données des élèves associées à un responsable légal.
   if($_SESSION['USER_PROFIL_TYPE']=='parent')
   {
     $_SESSION['OPT_PARENT_ENFANTS']   = DB_STRUCTURE_COMMUN::DB_OPT_enfants_parent($_SESSION['USER_ID']);
     $_SESSION['OPT_PARENT_CLASSES']   = DB_STRUCTURE_COMMUN::DB_OPT_classes_parent($_SESSION['USER_ID']);
     $_SESSION['NB_ENFANTS'] = (is_array($_SESSION['OPT_PARENT_ENFANTS'])) ? count($_SESSION['OPT_PARENT_ENFANTS']) : 0 ;
     if( ($_SESSION['NB_ENFANTS']==1) && (is_array($_SESSION['OPT_PARENT_CLASSES'])) )
     {
       $_SESSION['ELEVE_CLASSE_ID']    = (int) $_SESSION['OPT_PARENT_CLASSES'][0]['valeur'];
       $_SESSION['ELEVE_CLASSE_NOM']   = $_SESSION['OPT_PARENT_CLASSES'][0]['texte'];
     }
   }
   // Récupérer et Enregistrer en session les données associées aux profils utilisateurs d'un établissement, activés ou non.
   if($_SESSION['USER_PROFIL_TYPE']=='administrateur')
   {
     $_SESSION['TAB_PROFILS_ADMIN'] = array( 'TYPE'=>array() , 'LOGIN_MODELE'=>array() , 'MDP_LONGUEUR_MINI'=>array() , 'DUREE_INACTIVITE'=>array() );
     $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres( 'user_profil_type,user_profil_login_modele,user_profil_mdp_longueur_mini,user_profil_mdp_date_naissance,user_profil_duree_inactivite' /*listing_champs*/ , FALSE /*only_actif*/ );
     foreach($DB_TAB as $DB_ROW)
     {
       $_SESSION['TAB_PROFILS_ADMIN']['TYPE']              [$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_type'];
       $_SESSION['TAB_PROFILS_ADMIN']['LOGIN_MODELE']      [$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_login_modele'];
       $_SESSION['TAB_PROFILS_ADMIN']['MDP_LONGUEUR_MINI'] [$DB_ROW['user_profil_sigle']] = (int) $DB_ROW['user_profil_mdp_longueur_mini'];
       $_SESSION['TAB_PROFILS_ADMIN']['MDP_DATE_NAISSANCE'][$DB_ROW['user_profil_sigle']] = (int) $DB_ROW['user_profil_mdp_date_naissance'];
       $_SESSION['TAB_PROFILS_ADMIN']['DUREE_INACTIVITE']  [$DB_ROW['user_profil_sigle']] = (int) $DB_ROW['user_profil_duree_inactivite'];
     }
   }
   // Récupérer et Enregistrer en session les noms des profils utilisateurs d'un établissement (activés) pour afficher les droits de certaines pages.
   else
   {
     $_SESSION['TAB_PROFILS_DROIT'] = array( 'TYPE'=>array() , 'JOIN_GROUPES'=>array() , 'JOIN_MATIERES'=>array() , 'NOM_LONG_PLURIEL'=>array() );
     $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres( 'user_profil_type,user_profil_join_groupes,user_profil_join_matieres,user_profil_nom_long_pluriel' /*listing_champs*/ , TRUE /*only_actif*/ );
     foreach($DB_TAB as $DB_ROW)
     {
       $_SESSION['TAB_PROFILS_DROIT']['TYPE']            [$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_type'];
       $_SESSION['TAB_PROFILS_DROIT']['JOIN_GROUPES']    [$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_join_groupes'];
       $_SESSION['TAB_PROFILS_DROIT']['JOIN_MATIERES']   [$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_join_matieres'];
       $_SESSION['TAB_PROFILS_DROIT']['NOM_LONG_PLURIEL'][$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_nom_long_pluriel'];
     }
   }
   // Fabriquer $_SESSION['IMG_...'] et $_SESSION['BACKGROUND_...'] en fonction de $_SESSION['USER_DALTONISME'] à partir de $_SESSION['NOTE_IMAGE_...'] et $_SESSION['CSS_BACKGROUND-COLOR']['...']
   // remarque : $_SESSION['USER_DALTONISME'] ne peut être utilisé que pour les profils élèves/parents/profs/directeurs, pas les admins ni le webmestre
   SessionUser::adapter_daltonisme() ;
   // Enregistrer en session le CSS personnalisé
   SessionUser::actualiser_style();
   // Enregistrer en session le menu personnalisé ; détection de la langue remis ici pour le cas de bascule entre comptes.
   Lang::setlocale( LC_MESSAGES, Lang::get_locale_used() );
   SessionUser::memoriser_menu();
   // Juste pour davantage de lisibilité si besoin de debug...
   ksort($_SESSION);
   // Enfin, on profite de cet événement pour faire du ménage ou simuler une tâche planifiée
   SessionUser::cron();
 }
 * 
 * Vous devriez avoir reçu une copie de la Licence Publique Générale GNU Affero avec SACoche ;
 * si ce n’est pas le cas, consultez : <http://www.gnu.org/licenses/>.
 * 
 */
if (!defined('SACoche')) {
    exit('Ce fichier ne peut être appelé directement !');
}
$TITRE = html(Lang::_("Réglage des autorisations"));
// Tableau avec les noms des profils activés dans l'établissement
$tab_profils_libelles = array();
$tab_profil_join_groupes = array();
$tab_profil_join_matieres = array();
Layout::add('js_inline_before', 'var tab_profil_join_groupes  = new Array();');
Layout::add('js_inline_before', 'var tab_profil_join_matieres = new Array();');
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres('user_profil_type,user_profil_join_groupes,user_profil_join_matieres,user_profil_nom_court_pluriel', TRUE);
$DB_TAB[] = array('user_profil_sigle' => 'ONLY_COORD', 'user_profil_type' => '', 'user_profil_join_groupes' => 0, 'user_profil_join_matieres' => 0, 'user_profil_nom_court_pluriel' => 'restriction aux<br />coordonnateurs<br />matières');
$DB_TAB[] = array('user_profil_sigle' => 'ONLY_PP', 'user_profil_type' => '', 'user_profil_join_groupes' => 0, 'user_profil_join_matieres' => 0, 'user_profil_nom_court_pluriel' => 'restriction aux<br />professeurs<br />principaux');
$DB_TAB[] = array('user_profil_sigle' => 'ONLY_LV', 'user_profil_type' => '', 'user_profil_join_groupes' => 0, 'user_profil_join_matieres' => 0, 'user_profil_nom_court_pluriel' => 'restriction aux<br />professeurs<br />de LV');
foreach ($DB_TAB as $DB_ROW) {
    $tab_profils_libelles[$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_nom_court_pluriel'];
    $is_profil_join_groupe = $DB_ROW['user_profil_type'] == 'professeur' && $DB_ROW['user_profil_join_groupes'] == 'config' ? TRUE : FALSE;
    $tab_profil_join_groupes[$DB_ROW['user_profil_sigle']] = $is_profil_join_groupe;
    $is_profil_join_groupe = $is_profil_join_groupe ? 'true' : 'false';
    Layout::add('js_inline_before', 'tab_profil_join_groupes["' . $DB_ROW['user_profil_sigle'] . '" ] = ' . $is_profil_join_groupe . ';');
    $is_profil_join_matiere = $DB_ROW['user_profil_type'] == 'professeur' && $DB_ROW['user_profil_join_matieres'] == 'config' ? TRUE : FALSE;
    $tab_profil_join_matieres[$DB_ROW['user_profil_sigle']] = $is_profil_join_matiere;
    $is_profil_join_matiere = $is_profil_join_matiere ? 'true' : 'false';
    Layout::add('js_inline_before', 'tab_profil_join_matieres["' . $DB_ROW['user_profil_sigle'] . '"] = ' . $is_profil_join_matiere . ';');
}
// Tableau avec les sigles des profils pouvant être proposés, ou à cocher par défaut
 }
 // On trie
 array_multisort(
   $tab_users_base['ordre'] , SORT_ASC,SORT_NUMERIC,
   $tab_users_base['profil'], SORT_ASC,SORT_STRING,
   $tab_users_base['nom']   , SORT_ASC,SORT_STRING,
   $tab_users_base['prenom'], SORT_ASC,SORT_STRING,
   $tab_users_base['id'],
   $tab_users_base['id_ent'],
   $tab_users_base['id_sconet']
 );
 // On retire l'ordre dont on n'a plus besoin
 unset($tab_users_base['ordre']);
 // Lister les profils ; ne peut être récupéré via la requête précédente à cause de profils présents dans l'ENT dont il n'y aurait aucun utilisateur dans la base SACoche
 $tab_profils = array();
 $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres( 'user_profil_nom_court_singulier' /*listing_champs*/ , FALSE /*only_actif*/ );
 foreach($DB_TAB as $DB_ROW)
 {
   $tab_profils[$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_nom_court_singulier'];
 }
 // Observer le contenu de l'ENT et comparer avec le contenu de la base
 $lignes_ras     = '';
 $lignes_modif   = '';
 $lignes_pb      = '';
 $lignes_inconnu = ''; // de SACoche non trouvé dans l'ENT
 $lignes_reste   = ''; // de l'ENT non trouvé dans SACoche
 // Pour chaque user SACoche ...
 foreach($tab_users_base['id_ent'] as $i_base => $id_ent_SACoche)
 {
   $i_ENT = 0;
   // Si id_sconet (user_sconet_id) est renseigné (élèves uniquement), on recherche l'utilisateur de l'ENT de même id_sconet
echo $select_f_statuts;
?>
</div>
  <p class="ti"><button id="f_doublon" name="f_doublon" type="submit" class="rechercher">Rechercher</button> des responsables homonymes susceptibles d'être des comptes en double.</p>
</form>

<hr />

<?php 
if (empty($_POST['f_afficher'])) {
    return;
    // Ne pas exécuter la suite de ce fichier inclus.
}
// Options du formulaire de profils
$options = '';
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres('user_profil_nom_long_singulier', TRUE, 'parent');
foreach ($DB_TAB as $DB_ROW) {
    $options .= '<option value="' . $DB_ROW['user_profil_sigle'] . '">' . $DB_ROW['user_profil_sigle'] . ' &rarr; ' . $DB_ROW['user_profil_nom_long_singulier'] . '</option>';
}
// Lister les parents, par nom / prénom ou recherche d'homonymies
if (!$find_doublon) {
    $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_parents_avec_infos_enfants(FALSE, $statut, $debut_nom, $debut_prenom);
} elseif ($find_doublon) {
    $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::lister_parents_homonymes();
    if (!empty($DB_TAB)) {
        $tab_parents_id = array();
        foreach ($DB_TAB as $DB_ROW) {
            $tab_parents_id = array_merge($tab_parents_id, explode(',', $DB_ROW['identifiants']));
        }
        $DB_TAB = count($tab_parents_id) ? DB_STRUCTURE_ADMINISTRATEUR::DB_lister_parents_avec_infos_enfants(FALSE, TRUE, '', '', implode(',', $tab_parents_id)) : array();
        // Préparation de l'export CSV
 * si ce n’est pas le cas, consultez : <http://www.gnu.org/licenses/>.
 * 
 */
if (!defined('SACoche')) {
    exit('Ce fichier ne peut être appelé directement !');
}
$TITRE = html(Lang::_("Professeurs / Personnels"));
// Récupérer d'éventuels paramètres pour restreindre l'affichage
// Pas de passage par la page ajax.php, mais pas besoin ici de protection contre attaques type CSRF
$statut = isset($_POST['f_statut']) ? Clean::entier($_POST['f_statut']) : 1;
// Construire et personnaliser le formulaire pour restreindre l'affichage
$select_f_statuts = HtmlForm::afficher_select(Form::$tab_select_statut, 'f_statut', FALSE, $statut, '');
// Options du formulaire de profils, et variable en session pour la page ajax associée
$options = '';
$_SESSION['tmp'] = array();
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres('user_profil_nom_long_singulier', TRUE, array('professeur', 'directeur'));
foreach ($DB_TAB as $DB_ROW) {
    $options .= '<option value="' . $DB_ROW['user_profil_sigle'] . '">' . $DB_ROW['user_profil_sigle'] . ' &rarr; ' . $DB_ROW['user_profil_nom_long_singulier'] . '</option>';
    $_SESSION['tmp'][$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_nom_long_singulier'];
}
// Javascript
Layout::add('js_inline_before', 'var input_date      = "' . TODAY_FR . '";');
Layout::add('js_inline_before', 'var date_mysql      = "' . TODAY_MYSQL . '";');
Layout::add('js_inline_before', 'var tab_login_modele      = new Array();');
Layout::add('js_inline_before', 'var tab_mdp_longueur_mini = new Array();');
foreach ($_SESSION['TAB_PROFILS_ADMIN']['LOGIN_MODELE'] as $profil_sigle => $login_modele) {
    Layout::add('js_inline_before', 'tab_login_modele["' . $profil_sigle . '"] = "' . $login_modele . '";');
}
foreach ($_SESSION['TAB_PROFILS_ADMIN']['MDP_LONGUEUR_MINI'] as $profil_sigle => $mdp_longueur_mini) {
    Layout::add('js_inline_before', 'tab_mdp_longueur_mini["' . $profil_sigle . '"] = ' . $mdp_longueur_mini . ';');
}
 * 
 */

if(!defined('SACoche')) {exit('Ce fichier ne peut être appelé directement !');}
$TITRE = html(Lang::_("Professeurs / Personnels"));

// Récupérer d'éventuels paramètres pour restreindre l'affichage
// Pas de passage par la page ajax.php, mais pas besoin ici de protection contre attaques type CSRF
$statut = (isset($_POST['f_statut'])) ? Clean::entier($_POST['f_statut']) : 1  ;
// Construire et personnaliser le formulaire pour restreindre l'affichage
$select_f_statuts = HtmlForm::afficher_select(Form::$tab_select_statut , 'f_statut' /*select_nom*/ , FALSE /*option_first*/ , $statut /*selection*/ , '' /*optgroup*/);

// Options du formulaire de profils, et variable en session pour la page ajax associée
$options = '';
$_SESSION['tmp'] = array();
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres( 'user_profil_nom_long_singulier' /*listing_champs*/ , TRUE /*only_actif*/ , array('professeur','directeur') /*only_listing_profils_types*/ );
foreach($DB_TAB as $DB_ROW)
{
  $options .= '<option value="'.$DB_ROW['user_profil_sigle'].'">'.$DB_ROW['user_profil_sigle'].' &rarr; '.$DB_ROW['user_profil_nom_long_singulier'].'</option>';
  $_SESSION['tmp'][$DB_ROW['user_profil_sigle']] = $DB_ROW['user_profil_nom_long_singulier'];
}

// Javascript
Layout::add( 'js_inline_before' , 'var input_date      = "'.TODAY_FR.'";' );
Layout::add( 'js_inline_before' , 'var date_mysql      = "'.TODAY_MYSQL.'";' );
Layout::add( 'js_inline_before' , 'var    LOGIN_LONGUEUR_MAX = '.   LOGIN_LONGUEUR_MAX.';' );
Layout::add( 'js_inline_before' , 'var PASSWORD_LONGUEUR_MAX = '.PASSWORD_LONGUEUR_MAX.';' );
Layout::add( 'js_inline_before' , 'var tab_login_modele      = new Array();' );
Layout::add( 'js_inline_before' , 'var tab_mdp_longueur_mini = new Array();' );
foreach($_SESSION['TAB_PROFILS_ADMIN']['LOGIN_MODELE'] as $profil_sigle => $login_modele)
{
Esempio n. 15
0
 * si ce n’est pas le cas, consultez : <http://www.gnu.org/licenses/>.
 * 
 */

if(!defined('SACoche')) {exit('Ce fichier ne peut être appelé directement !');}
$TITRE = html(Lang::_("Format des identifiants de connexion"));

// Options du formulaire select
$options = '';
for($mdp_length=4 ; $mdp_length<9 ; $mdp_length++)
{
  $options .= '<option value="'.$mdp_length.'">'.$mdp_length.' caractères</option>';
}

// Lister les profils de l'établissement
$DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_profils_parametres( 'user_profil_nom_court_pluriel,user_profil_nom_long_pluriel,user_profil_login_modele,user_profil_mdp_longueur_mini,user_profil_mdp_date_naissance' /*listing_champs*/ , TRUE /*only_actif*/ );

?>
<div><span class="manuel"><a class="pop_up" href="<?php echo SERVEUR_DOCUMENTAIRE ?>?fichier=support_administrateur__gestion_format_logins">DOC : Format des identifiants</a></span></div>

<hr />

<h2>Appliquer à tous les profils</h2>

<form action="#" method="post">
  <p>
    <label class="tab">Identifiants :</label>Modèle du nom d'utilisateur <input type="text" id="f_login_ALL" name="f_login_ALL" value="ppp.nnnnnnnn" size="<?php echo LOGIN_LONGUEUR_MAX ?>" maxlength="<?php echo LOGIN_LONGUEUR_MAX ?>" /><br />
    <span class="tab"></span>Longueur minimale du mot de passe <select id="f_mdp_ALL" name="f_mdp_ALL"><?php echo str_replace('value="6"','value="6" selected',$options) ?></select><br />
    <span class="tab"></span><button id="bouton_valider_ALL" type="button" class="parametre">Valider.</button><label id="ajax_msg_ALL">&nbsp;</label>
  </p>
</form>