2015-10-30 11:52:50 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
|
|
|
require_once __ROOT__.'/manager/security.php';
|
|
|
|
|
|
|
|
|
|
|
|
/***************/
|
|
|
|
/*** PROFILE ***/
|
|
|
|
/***************/
|
2015-11-06 22:00:08 +00:00
|
|
|
if( connected() ){ // si l'utilisateur est connecté
|
2015-11-15 14:42:12 +00:00
|
|
|
echo "<section name='myprofile' data-title='Profil'>";
|
2015-10-30 11:52:50 +00:00
|
|
|
echo 'profil';
|
|
|
|
echo '</section>';
|
|
|
|
|
2015-11-20 08:54:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************/
|
|
|
|
/*** 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 = 'getListeEnseignants';
|
|
|
|
|
|
|
|
// gestion de la requête
|
|
|
|
user_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
if( $answer->request == 'success' ){ // si aucune erreur
|
|
|
|
|
2015-11-20 09:32:07 +00:00
|
|
|
echo "<section name='attributionrole' data-title='Rôles' class='basic' >";
|
|
|
|
|
|
|
|
// var_dump( $answer->userlist );
|
|
|
|
|
|
|
|
echo "<table class='basic col4'><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']."' checked><label for='".$user['id']."'></label> admin</td>";
|
|
|
|
else
|
|
|
|
echo "<td><input type='checkbox' id='".$user['id']."'><label for='".$user['id']."'></label> admin</td>";
|
|
|
|
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
echo "</tbody></table>";
|
2015-11-20 08:54:15 +00:00
|
|
|
|
|
|
|
echo "</section>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|