[ Index ] |
|
Code source de Dotclear 1.2.5 |
1 <?php 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of DotClear. 4 # Copyright (c) 2004 Olivier Meunier and contributors. All rights 5 # reserved. 6 # 7 # DotClear is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # DotClear is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with DotClear; if not, write to the Free Software 19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 # 21 # ***** END LICENSE BLOCK ***** 22 23 require dirname(__FILE__).'/inc/prepend.php'; 24 25 $auth->check(1); 26 27 include dirname(__FILE__).'/inc/connexion.php'; 28 29 $err = ''; 30 31 # Tableau des formats 32 $arry_format = array('HTML' => 'html', 'Wiki' => 'wiki'); 33 34 # Tableau des publication 35 $arry_post_pub = array(__('Online') => 1, __('Offline') => 0); 36 37 # Tableau des décalages 38 for ($i=-24; $i<=24; $i++) { 39 $arry_delta_time[(string) $i] = (string) $i; 40 } 41 42 # Récupération des catégories 43 $rsCat = $blog->getCat(); 44 45 $arry_cat = array(); 46 if ($rsCat->isEmpty()) { 47 $arry_cat[''] = 0; 48 } else { 49 while ($rsCat->fetch()) { 50 $arry_cat[$rsCat->f('cat_libelle')] = $rsCat->f('cat_id'); 51 } 52 } 53 54 # Récupération de l'utilisateur 55 $rs = $blog->getUser($_SESSION['sess_user_id']); 56 57 $user_nom = $rs->f('user_nom'); 58 $user_prenom = $rs->f('user_prenom'); 59 $user_pseudo = $rs->f('user_pseudo'); 60 $user_email = $rs->f('user_email'); 61 $user_pwd = ''; 62 $user_post_format = $rs->f('user_post_format'); 63 $user_edit_size = $rs->f('user_edit_size'); 64 $user_pref_cat = $rs->f('user_pref_cat'); 65 $user_lang = $rs->f('user_lang'); 66 $user_delta = $rs->f('user_delta'); 67 $user_post_pub = $rs->f('user_post_pub'); 68 69 # Mise à jour des préférences 70 if(!empty($_POST)) 71 { 72 $user_prenom = $_POST['user_prenom']; 73 $user_nom = $_POST['user_nom']; 74 $user_pseudo = $_POST['user_pseudo']; 75 $user_email = $_POST['user_email']; 76 $user_pwd = trim($_POST['user_pwd']); 77 $user_post_format = $_POST['user_post_format']; 78 $user_edit_size = $_POST['user_edit_size']; 79 $user_pref_cat = $_POST['user_pref_cat']; 80 $user_lang = $_POST['user_lang']; 81 $user_delta = $_POST['user_delta']; 82 $user_post_pub = $_POST['user_post_pub']; 83 84 if($blog->updUser($_SESSION['sess_user_id'],$_SESSION['sess_user_id'], 85 $rs->f('user_level'),$user_pwd,$user_nom,$user_prenom,$user_pseudo, 86 $user_email,$user_post_format,$user_edit_size,$user_pref_cat,$user_lang, 87 $user_delta,$user_post_pub) !== false) 88 { 89 # On update la session pour que les modifs soient prises en compte 90 # tout de suite 91 $_SESSION['sess_user_nom'] = $user_nom; 92 $_SESSION['sess_user_prenom'] = $user_prenom; 93 $_SESSION['sess_user_pseudo'] = $user_pseudo; 94 $_SESSION['sess_user_email'] = $user_email; 95 $_SESSION['sess_user_format'] = $user_post_format; 96 $_SESSION['sess_user_edit_size'] = $user_edit_size; 97 $_SESSION['sess_user_pref_cat'] = $user_pref_cat; 98 $_SESSION['sess_user_lang'] = $user_lang; 99 $_SESSION['sess_user_delta'] = $user_delta; 100 $_SESSION['sess_user_post_pub'] = $user_post_pub; 101 102 if($_SESSION['sess_user_pseudo'] != '') 103 $_SESSION['sess_user_cn'] = $_SESSION['sess_user_pseudo']; 104 else 105 $_SESSION['sess_user_cn'] = trim($_SESSION['sess_user_prenom'].' '.$_SESSION['sess_user_nom']); 106 107 $msg = __('Editor updated'); 108 header('Location: user_prefs.php?msg='.rawurlencode($msg)); 109 exit; 110 } else { 111 $err = $blog->error(1); 112 } 113 } 114 115 # Sous menu 116 openPage(__('User preferences')); 117 118 if($err != '') 119 { 120 echo '<div class="erreur"><p><strong>'.__('Error(s)').' :</strong></p>'.$err.'</div>'; 121 } 122 ?> 123 124 <h2><?php echo __('User preferences'); ?></h2> 125 126 <form action="user_prefs.php" method="post" class="clear"> 127 128 <p class="field"><label class="float" for="user_prenom"><?php 129 echo __('Firstname'); ?> (<?php echo __('optional'); ?>) : 130 <?php echo helpLink('user','user_prenom'); ?></label> 131 <?php echo form::field('user_prenom',30,255,$user_prenom); ?> 132 </p> 133 134 <p class="field"><label class="float" for="user_nom"><strong><?php 135 echo __('Name'); ?> :</strong> 136 <?php echo helpLink('user','user_nom'); ?></label> 137 <?php echo form::field('user_nom',30,255,$user_nom); ?> 138 </p> 139 140 <p class="field"><label class="float" for="user_pseudo"><?php 141 echo __('Nickname'); ?> (<?php echo __('optional'); ?>) : 142 <?php echo helpLink('user','user_pseudo'); ?></label> 143 <?php echo form::field('user_pseudo',30,255,$user_pseudo); ?> 144 </p> 145 146 <p class="field"><label class="float" for="user_email"><?php 147 echo __('Email'); ?> (<?php echo __('optional'); ?>) : 148 <?php echo helpLink('user','user_email'); ?></label> 149 <?php echo form::field('user_email',30,255,$user_email); ?> 150 </p> 151 152 <p class="field"><label class="float" for="user_pwd"><?php 153 echo __('Password'); ?> : 154 <?php echo helpLink('user','user_pwd'); ?></label> 155 <?php echo form::field('user_pwd',30,255); ?> 156 <br />(<?php echo __('Leave empty to keep password intact'); ?>)</p> 157 158 <p class="field"><label class="float" for="user_post_format"><strong><?php 159 echo __('Prefered edit format'); ?> :</strong> 160 <?php echo helpLink('user','user_post_format'); ?></label> 161 <?php echo form::combo('user_post_format',$arry_format,$user_post_format); ?> 162 </p> 163 164 <p class="field"><label class="float" for="user_post_pub"><strong><?php 165 echo __('Default publication status'); ?> :</strong> 166 <?php echo helpLink('user','user_post_pub'); ?></label> 167 <?php echo form::combo('user_post_pub',$arry_post_pub,$user_post_pub); ?> 168 </p> 169 170 <p class="field"><label class="float" for="user_pref_cat"><strong><?php 171 echo __('Prefered category'); ?> :</strong> 172 <?php echo helpLink('user','user_pref_cat'); ?></label> 173 <?php echo form::combo('user_pref_cat',$arry_cat,$user_pref_cat); ?> 174 </p> 175 176 <p class="field"><label class="float" for="user_edit_size"><strong><?php 177 echo __('Entry edit field height'); ?> :</strong> 178 <?php echo helpLink('user','user_edit_size'); ?></label> 179 <?php echo form::field('user_edit_size',2,3,$user_edit_size); ?> 180 </p> 181 182 <p class="field"><label class="float" for="user_lang"><strong><?php 183 echo __('Language'); ?> :</strong> 184 <?php echo helpLink('user','user_lang'); ?></label> 185 <?php echo form::combo('user_lang',l10n::getISOcodes(1),$user_lang); ?></p> 186 187 <p class="field"><label class="float" for="user_delta"><strong><?php 188 echo __('Number of hours between user\'s local time and the server time'); ?> :</strong> 189 <?php echo helpLink('user','user_delta'); ?></label> 190 <?php echo form::combo('user_delta',$arry_delta_time,$user_delta); ?> 191 (<?php echo sprintf(__('Server time is %s'),date('Y-m-d H:i')); ?>)</p> 192 193 <p class="field"><input class="submit" type="submit" value="<?php echo __('save'); ?>" /></p> 194 </form> 195 196 <?php closePage(); ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Feb 23 21:40:15 2007 | par Balluche grâce à PHPXref 0.7 |