check(9); include dirname(__FILE__).'/inc/connexion.php'; $id = (!empty($_REQUEST['id'])) ? $_REQUEST['id'] : NULL; $page_titre = __('Editor creation'); $err = ''; $alert = ''; $user_id = ''; $user_nom = ''; $user_prenom = ''; $user_pseudo = ''; $user_email = ''; $user_pwd = ''; $user_level = 1; $user_lang = DC_LANG; $user_post_format = 'wiki'; $user_edit_size = 10; $user_pref_cat = ''; $user_delta = 0; $user_post_pub = 1; $arry_levels = array(__('inactive') => 0, __('editor') => 1, __('advanced editor') => 5, __('administrator') => 9); # 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'); } } if (!empty($id) || !empty($_POST['user_id'])) { if (!empty($id)) { $rsUser = $blog->getUser($id); if (!$rsUser->isEmpty()) { $user_id = $rsUser->f('user_id'); $user_nom = $rsUser->f('user_nom'); $user_prenom = $rsUser->f('user_prenom'); $user_pseudo = $rsUser->f('user_pseudo'); $user_email = $rsUser->f('user_email'); $user_level = $rsUser->f('user_level'); $user_lang = $rsUser->f('user_lang'); $user_post_format = $rsUser->f('user_post_format'); $user_edit_size = $rsUser->f('user_edit_size'); $user_pref_cat = $rsUser->f('user_pref_cat'); $user_delta = $rsUser->f('user_delta'); $user_post_pub = $rsUser->f('user_post_pub'); $page_titre = sprintf(__('Update of editor %s'),$user_id); if($user_id == $_SESSION['sess_user_id']) { $alert = __('You are about to update you own profile. You will be disconnected after changes.'); } # Suppresion d'un rédacteur if(!empty($_GET['del'])) { if ($blog->delUser($user_id) !== false) { $msg = __('Editor deleted'); header('Location: redac_list.php?msg='.rawurlencode($msg)); exit; } else { $err = $blog->error(1); } } # Mise à jour d'un rédacteur if(!empty($_POST['user_id'])) { $new_user_id = $_POST['user_id']; $user_nom = $_POST['user_nom']; $user_prenom = $_POST['user_prenom']; $user_email = $_POST['user_email']; $user_level = $_POST['user_level']; $user_pwd = $_POST['user_pwd']; $user_pseudo = $_POST['user_pseudo']; $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($user_id,$new_user_id,$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) { if($user_id == $_SESSION['sess_user_id']) { header('Location: index.php?logout=1'); exit; } $msg = __('Editor updated'); header('Location: redac_list.php?msg='.rawurlencode($msg)); exit; } else { $err = $blog->error(1); } } } } elseif(!empty($_POST['user_id'])) { # Création d'un rédacteur $user_id = $_POST['user_id']; $user_nom = $_POST['user_nom']; $user_prenom = $_POST['user_prenom']; $user_pseudo = $_POST['user_pseudo']; $user_email = $_POST['user_email']; $user_level = $_POST['user_level']; $user_pwd = $_POST['user_pwd']; $user_lang = $_POST['user_lang']; $user_post_format = $_POST['user_post_format']; $user_edit_size = $_POST['user_edit_size']; $user_pref_cat = $_POST['user_pref_cat']; $user_delta = $_POST['user_delta']; $user_post_pub = $_POST['user_post_pub']; if ($blog->addUser($user_id,$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 ) { $msg = __('Editor created'); header('Location: redac_list.php?msg='.rawurlencode($msg)); exit; } else { $err = $blog->error(1); } } } openPage($page_titre); if($err != '') { echo '

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

'. $err.'
'; } ?>

'.$alert.'

'; } ?>

('.__('Leave empty to keep password intact').')'; } ?>

()

' : ''; ?>