check(1); include dirname(__FILE__).'/inc/connexion.php'; $err = ''; # Tableau des formats $arry_format = array('HTML' => 'html', 'Wiki' => 'wiki'); # Tableau des publication $arry_post_pub = array(__('Online') => 1, __('Offline') => 0); # Tableau des décalages for ($i=-24; $i<=24; $i++) { $arry_delta_time[(string) $i] = (string) $i; } # Récupération des catégories $rsCat = $blog->getCat(); $arry_cat = array(); if ($rsCat->isEmpty()) { $arry_cat[''] = 0; } else { while ($rsCat->fetch()) { $arry_cat[$rsCat->f('cat_libelle')] = $rsCat->f('cat_id'); } } # Récupération de l'utilisateur $rs = $blog->getUser($_SESSION['sess_user_id']); $user_nom = $rs->f('user_nom'); $user_prenom = $rs->f('user_prenom'); $user_pseudo = $rs->f('user_pseudo'); $user_email = $rs->f('user_email'); $user_pwd = ''; $user_post_format = $rs->f('user_post_format'); $user_edit_size = $rs->f('user_edit_size'); $user_pref_cat = $rs->f('user_pref_cat'); $user_lang = $rs->f('user_lang'); $user_delta = $rs->f('user_delta'); $user_post_pub = $rs->f('user_post_pub'); # Mise à jour des préférences if(!empty($_POST)) { $user_prenom = $_POST['user_prenom']; $user_nom = $_POST['user_nom']; $user_pseudo = $_POST['user_pseudo']; $user_email = $_POST['user_email']; $user_pwd = trim($_POST['user_pwd']); $user_post_format = $_POST['user_post_format']; $user_edit_size = $_POST['user_edit_size']; $user_pref_cat = $_POST['user_pref_cat']; $user_lang = $_POST['user_lang']; $user_delta = $_POST['user_delta']; $user_post_pub = $_POST['user_post_pub']; if($blog->updUser($_SESSION['sess_user_id'],$_SESSION['sess_user_id'], $rs->f('user_level'),$user_pwd,$user_nom,$user_prenom,$user_pseudo, $user_email,$user_post_format,$user_edit_size,$user_pref_cat,$user_lang, $user_delta,$user_post_pub) !== false) { # On update la session pour que les modifs soient prises en compte # tout de suite $_SESSION['sess_user_nom'] = $user_nom; $_SESSION['sess_user_prenom'] = $user_prenom; $_SESSION['sess_user_pseudo'] = $user_pseudo; $_SESSION['sess_user_email'] = $user_email; $_SESSION['sess_user_format'] = $user_post_format; $_SESSION['sess_user_edit_size'] = $user_edit_size; $_SESSION['sess_user_pref_cat'] = $user_pref_cat; $_SESSION['sess_user_lang'] = $user_lang; $_SESSION['sess_user_delta'] = $user_delta; $_SESSION['sess_user_post_pub'] = $user_post_pub; if($_SESSION['sess_user_pseudo'] != '') $_SESSION['sess_user_cn'] = $_SESSION['sess_user_pseudo']; else $_SESSION['sess_user_cn'] = trim($_SESSION['sess_user_prenom'].' '.$_SESSION['sess_user_nom']); $msg = __('Editor updated'); header('Location: user_prefs.php?msg='.rawurlencode($msg)); exit; } else { $err = $blog->error(1); } } # Sous menu openPage(__('User preferences')); if($err != '') { echo '

'.__('Error(s)').' :

'.$err.'
'; } ?>


()

()