Ejemplo n.º 1
0
 /**
  * Encapsule le comportement du module de modification d'utilisateurs
  *
  * @param string $session
  * @param string $onglet Nom de l'onglet à afficher
  *
  * @return string
  * @access public
  * @static
  */
 public static function modifUserModule($session, $onglet)
 {
     $u_login = getpost_variable('u_login');
     $u_login_to_update = getpost_variable('u_login_to_update');
     $tab_checkbox_sem_imp = getpost_variable('tab_checkbox_sem_imp');
     $tab_checkbox_sem_p = getpost_variable('tab_checkbox_sem_p');
     $return = '';
     // TITRE
     if ($u_login != "") {
         $login_titre = $u_login;
     } elseif ($u_login_to_update != "") {
         $login_titre = $u_login_to_update;
     }
     $return .= '<h1>' . _('admin_modif_user_titre') . ' : <strong>' . $login_titre . '</strong></h1>';
     if ($u_login != "") {
         $return .= \admin\Fonctions::modifier_user($u_login, $tab_checkbox_sem_imp, $tab_checkbox_sem_p, $onglet);
     } elseif ($u_login_to_update != "") {
         $tab_new_jours_an = getpost_variable('tab_new_jours_an');
         $tab_new_solde = getpost_variable('tab_new_solde');
         $tab_new_reliquat = getpost_variable('tab_new_reliquat');
         $tab_new_user['login'] = getpost_variable('new_login');
         $tab_new_user['nom'] = getpost_variable('new_nom');
         $tab_new_user['prenom'] = getpost_variable('new_prenom');
         $tab_new_user['quotite'] = getpost_variable('new_quotite');
         $tab_new_user['is_resp'] = getpost_variable('new_is_resp');
         $tab_new_user['resp_login'] = getpost_variable('new_resp_login');
         $tab_new_user['is_admin'] = getpost_variable('new_is_admin');
         $tab_new_user['is_hr'] = getpost_variable('new_is_hr');
         $tab_new_user['is_active'] = getpost_variable('new_is_active');
         $tab_new_user['see_all'] = getpost_variable('new_see_all');
         $tab_new_user['email'] = getpost_variable('new_email');
         $tab_new_user['jour'] = getpost_variable('new_jour');
         $tab_new_user['mois'] = getpost_variable('new_mois');
         $tab_new_user['year'] = getpost_variable('new_year');
         echo \admin\Fonctions::commit_update_user($u_login_to_update, $tab_new_user, $tab_new_jours_an, $tab_new_solde, $tab_new_reliquat, $tab_checkbox_sem_imp, $tab_checkbox_sem_p);
         redirect(ROOT_PATH . 'admin/admin_index.php?session=' . $session . '&onglet=admin-users', false);
         exit;
     } else {
         // renvoit sur la page principale .
         redirect(ROOT_PATH . 'admin/admin_index.php?session=' . $session . '&onglet=admin-users', false);
         exit;
     }
     return $return;
 }