Changeset 3935
- Timestamp:
- Sep 28, 2009, 9:22:59 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/template/goto/user_list.tpl
r3752 r3935 8 8 <legend>{'Add a user'|@translate}</legend> 9 9 <label>{'Username'|@translate} <input type="text" name="login" maxlength="50" size="20"></label> 10 <label>{'Password'|@translate} <input type="password" name="password"></label> 11 <label>{'Confirm Password'|@translate} <input type="password" name="password_conf" id="password_conf"></label> 12 <label>{'Email address'|@translate} <input type="text" name="email"></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} 16 <label>{'Email address'|@translate} <input type="text" name="email"></label> 13 17 <label> <input class="submit" type="submit" name="submit_add" value="{'Submit'|@translate}" {$TAG_INPUT_ENABLED}></label> 14 18 </fieldset> -
trunk/admin/user_list.php
r3752 r3935 184 184 // +-----------------------------------------------------------------------+ 185 185 186 if (isset($_POST['submit_add'])) 187 { 188 if(empty($_POST['password'])) 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'])) 189 191 { 190 array_push($page['errors'], l10n('Password is missing')); 191 } 192 else if(empty($_POST['password_conf'])) 193 { 194 array_push($page['errors'], l10n('Password confirmation is missing')); 195 } 196 else if(empty($_POST['email'])) 197 { 198 array_push($page['errors'], l10n('Email address is missing')); 199 } 200 else if ($_POST['password'] != $_POST['password_conf']) 201 { 202 array_push($page['errors'], l10n('Password confirmation error')); 203 } 204 else 205 { 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 { 206 210 $page['errors'] = register_user( 207 211 $_POST['login'], $_POST['password'], $_POST['email'], false); 208 212 209 if (count($page['errors']) == 0)213 if (count($page['errors']) == 0) 210 214 { 211 215 array_push( … … 217 221 ); 218 222 } 223 } 219 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 } 243 } 220 244 } 221 245 … … 504 528 { 505 529 $template->assign('adviser', true); 530 } 531 532 // Display or Hide double password type 533 if ($conf['double_password_type_in_admin']) 534 { 535 $template->assign('Double_Password', true); 506 536 } 507 537 -
trunk/include/config_default.inc.php
r3720 r3935 317 317 // Define default method to use ('http' or 'html' in order to do redirect) 318 318 $conf['default_redirect_method'] = 'http'; 319 320 // Define using double password type in admin's users management panel 321 $conf['double_password_type_in_admin'] = false; 319 322 320 323 // +-----------------------------------------------------------------------+
Note: See TracChangeset
for help on using the changeset viewer.