Changeset 3945 for branches/2.0/admin
- Timestamp:
- Sep 29, 2009, 12:59:12 PM (15 years ago)
- Location:
- branches/2.0/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/admin/template/goto/user_list.tpl
r2578 r3945 7 7 <fieldset> 8 8 <legend>{'Add a user'|@translate}</legend> 9 <label>{'Username'|@translate} <input type="text" name="login" maxlength="50" size="20" /></label> 10 <label>{'Password'|@translate} <input type="text" name="password" /></label> 9 <label>{'Username'|@translate} <input type="text" name="login" maxlength="50" size="20"></label> 10 {if $Double_Password} 11 <label>{'Password'|@translate} <input type="password" name="password"></label> 12 <label>{'Confirm Password'|@translate} <input type="password" name="password_conf" id="password_conf"></label> 13 {else} 14 <label>{'Password'|@translate} <input type="text" name="password"></label> 15 {/if} 11 16 <label>{'Email address'|@translate} <input type="text" name="email" /></label> 12 17 <label> <input class="submit" type="submit" name="submit_add" value="{'Submit'|@translate}" {$TAG_INPUT_ENABLED} /></label> -
branches/2.0/admin/user_list.php
r3046 r3945 184 184 // +-----------------------------------------------------------------------+ 185 185 186 if (isset($_POST['submit_add'])) 187 { 188 $page['errors'] = register_user( 189 $_POST['login'], $_POST['password'], $_POST['email'], false); 190 191 if (count($page['errors']) == 0) 192 { 193 array_push( 194 $page['infos'], 195 sprintf( 196 l10n('user "%s" added'), 197 $_POST['login'] 198 ) 199 ); 186 // Check for config_default var - If True : Using double password type else single password type 187 // This feature is discussed on Piwigo's english forum 188 if ($conf['double_password_type_in_admin'] == true) 189 { 190 if (isset($_POST['submit_add'])) 191 { 192 if(empty($_POST['password'])) 193 { 194 array_push($page['errors'], l10n('Password is missing')); 195 } 196 else if(empty($_POST['password_conf'])) 197 { 198 array_push($page['errors'], l10n('Password confirmation is missing')); 199 } 200 else if(empty($_POST['email'])) 201 { 202 array_push($page['errors'], l10n('Email address is missing')); 203 } 204 else if ($_POST['password'] != $_POST['password_conf']) 205 { 206 array_push($page['errors'], l10n('Password confirmation error')); 207 } 208 else 209 { 210 $page['errors'] = register_user( 211 $_POST['login'], $_POST['password'], $_POST['email'], false); 212 213 if (count($page['errors']) == 0) 214 { 215 array_push( 216 $page['infos'], 217 sprintf( 218 l10n('user "%s" added'), 219 $_POST['login'] 220 ) 221 ); 222 } 223 } 224 } 225 } 226 else if ($conf['double_password_type_in_admin'] == false) 227 { 228 if (isset($_POST['submit_add'])) 229 { 230 $page['errors'] = register_user( 231 $_POST['login'], $_POST['password'], $_POST['email'], false); 232 233 if (count($page['errors']) == 0) 234 { 235 array_push( 236 $page['infos'], 237 sprintf( 238 l10n('user "%s" added'), 239 $_POST['login'] 240 ) 241 ); 242 } 200 243 } 201 244 } … … 487 530 } 488 531 532 // Display or Hide double password type 533 if ($conf['double_password_type_in_admin']) 534 { 535 $template->assign('Double_Password', true); 536 } 537 489 538 // Filter status options 490 539 $status_options[-1] = '------------'; … … 659 708 'USERNAME' => $local_user['username'] 660 709 .($local_user['id'] == $conf['guest_id'] 661 ? '< BR />['.l10n('is_the_guest').']' : '')710 ? '<br>['.l10n('is_the_guest').']' : '') 662 711 .($local_user['id'] == $conf['default_user_id'] 663 ? '< BR />['.l10n('is_the_default').']' : ''),712 ? '<br>['.l10n('is_the_default').']' : ''), 664 713 'STATUS' => l10n('user_status_'. 665 714 $local_user['status']).(($local_user['adviser'] == 'true') 666 ? '< BR />['.l10n('adviser').']' : ''),715 ? '<br>['.l10n('adviser').']' : ''), 667 716 'EMAIL' => get_email_address_as_display_text($local_user['email']), 668 717 'GROUPS' => $groups_string,
Note: See TracChangeset
for help on using the changeset viewer.