66 lines
1.9 KiB
PHP
Executable File
66 lines
1.9 KiB
PHP
Executable File
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
|
require_once __ROOT__.'/manager/security.php';
|
|
|
|
|
|
/***************/
|
|
/*** PROFILE ***/
|
|
/***************/
|
|
if( connected() ){ // si l'utilisateur est connecté
|
|
echo "<section name='myprofile' data-title='Profil'>";
|
|
echo 'profil';
|
|
echo '</section>';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************/
|
|
/*** ATTRIBUTION DES RÔLES ***/
|
|
/*****************************/
|
|
if( permission('admin') ){
|
|
// inclusion du manager utilisateur
|
|
require_once __ROOT__.'/manager/user.php';
|
|
|
|
// création de la requête
|
|
$request = new stdClass(); $answer = new stdClass();
|
|
$request->level_1 = 'getListeEnseignantsModules';
|
|
|
|
// gestion de la requête
|
|
user_switch_level_1($request, $answer);
|
|
|
|
if( $answer->request == 'success' ){ // si aucune erreur
|
|
|
|
echo "<section name='attributionrole' data-title='Rôles' class='basic' >";
|
|
|
|
// var_dump( $answer->userlist );
|
|
|
|
echo "<table class='basic col5'><tbody>";
|
|
foreach($answer->userlist as $user){
|
|
echo "<tr>";
|
|
echo "<td><span class='link'>".$user['id']."</span></td>";
|
|
echo "<td>".$user['prenom']."</td>";
|
|
echo "<td>".$user['nom']."</td>";
|
|
|
|
// si l'utilisateur est admin
|
|
if( in_array('admin', $user['role']) )
|
|
echo "<td><input type='checkbox' id='".$user['id']."admin' checked><label for='".$user['id']."admin'></label> admin</td>";
|
|
else
|
|
echo "<td><input type='checkbox' id='".$user['id']."admin'><label for='".$user['id']."admin'></label> admin</td>";
|
|
|
|
// si l'utilisateur est référent
|
|
if( in_array('master', $user['role']) )
|
|
echo "<td><input type='checkbox' id='".$user['id']."referent' checked><label for='".$user['id']."referent'></label> référent</td>";
|
|
else
|
|
echo "<td><input type='checkbox' id='".$user['id']."referent'><label for='".$user['id']."referent'></label> référent</td>";
|
|
|
|
echo "</tr>";
|
|
}
|
|
echo "</tbody></table>";
|
|
|
|
echo "</section>";
|
|
|
|
}
|
|
|
|
}
|