Changeset 2215
- Timestamp:
- 02/05/2005 02:19:00 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/wp-admin.css
r2202 r2215 206 206 } 207 207 208 .submit, #quicktags, .editform th, #postcustomsubmit , #login form{208 .submit, #quicktags, .editform th, #postcustomsubmit { 209 209 text-align: right; 210 210 } -
trunk/wp-login.php
r2130 r2215 48 48 window.onload = focusit; 49 49 </script> 50 <style type="text/css"> 51 #user_login, #email, #submit { 52 font-size: 1.7em; 53 } 54 </style> 50 55 </head> 51 56 <body> … … 61 66 <p> 62 67 <input type="hidden" name="action" value="retrievepassword" /> 63 <label><?php _e('Login') ?>: <input type="text" name="user_login" id="user_login" value="" size="12" tabindex="1" /></label><br /> 64 <label><?php _e('E-mail') ?>: <input type="text" name="email" id="email" value="" size="12" tabindex="2" /></label><br /> 68 <label><?php _e('Login') ?>:<br /> 69 <input type="text" name="user_login" id="user_login" value="" size="20" tabindex="1" /></label></p> 70 <p><label><?php _e('E-mail') ?>:<br /> 71 <input type="text" name="email" id="email" value="" size="25" tabindex="2" /></label><br /> 65 72 </p> 66 <p class="submit"><input type="submit" name="submit" value="<?php _e('Retrieve Password'); ?> »" tabindex="3" /></p>73 <p class="submit"><input type="submit" name="submit" id="submit" value="<?php _e('Retrieve Password'); ?> »" tabindex="3" /></p> 67 74 </form> 75 <ul> 76 <li><a href="<?php bloginfo('home'); ?>" title="<?php _e('Are you lost?') ?>">« <?php _e('Back to blog') ?></a></li> 77 <?php if (get_settings('users_can_register')) : ?> 78 <li><a href="<?php bloginfo('wpurl'); ?>/wp-register.php"><?php _e('Register') ?></a></li> 79 <?php endif; ?> 80 <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Login') ?></a></li> 81 </ul> 68 82 </div> 69 83 </body> … … 73 87 74 88 case 'retrievepassword': 75 76 89 $user_data = get_userdatabylogin($_POST['user_login']); 77 90 // redefining user_login ensures we return the right case in the email … … 83 96 84 97 // Generate something random for a password... md5'ing current time with a rand salt 85 $ user_pass = substr(md5(uniqid(microtime())), 0, 6);98 $key = substr( md5( uniqid( microtime() ) ), 0, 50); 86 99 // now insert the new pass md5'd into the db 87 $wpdb->query("UPDATE $wpdb->users SET user_pass = MD5('$user_pass') WHERE user_login = '$user_login'"); 88 $message = __('Login') . ": $user_login\r\n"; 89 $message .= __('Password') . ": $user_pass\r\n"; 90 $message .= get_settings('siteurl') . '/wp-login.php'; 91 92 $m = wp_mail($user_email, sprintf(__("[%s] Your login and password"), get_settings('blogname')), $message); 100 $wpdb->query("UPDATE $wpdb->users SET user_activation_key = '$key' WHERE user_login = '$user_login'"); 101 $message .= __("Someone has asked to reset a password for the login this site\n\n " . get_option('siteurl') ) . "\n\n"; 102 $message .= __('Login') . ": $user_login\r\n\r\n"; 103 $message .= __("To reset your password visit the following address, otherwise just ignore this email and nothing will happen.\n\n"); 104 $message .= get_settings('siteurl') . "/wp-login.php?action=resetpass&key=$key"; 105 mail($user_email, sprintf(__("[%s] Password Reset"), get_settings('blogname')), $message); 106 $m = wp_mail($user_email, sprintf(__("[%s] Password Reset"), get_settings('blogname')), $message); 93 107 94 108 if ($m == false) { … … 98 112 } else { 99 113 echo '<p>' . sprintf(__("The e-mail was sent successfully to %s's e-mail address."), $user_login) . '<br />'; 114 echo "<a href='wp-login.php' title='" . __('Check your e-mail first, of course') . "'>" . __('Click here to login!') . '</a></p>'; 115 die(); 116 } 117 118 break; 119 120 case 'resetpass' : 121 122 // Generate something random for a password... md5'ing current time with a rand salt 123 $key = $_GET['key']; 124 $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_activation_key = '$key'"); 125 if ( !$user ) 126 die( __('Sorry, that key does not appear to be valid.') ); 127 128 $new_pass = md5( substr( md5( uniqid( microtime() ) ), 0, 7) ); 129 $wpdb->query("UPDATE $wpdb->users SET user_pass = '$new_pass', user_activation_key = '' WHERE user_login = '$user->user_login'"); 130 $message = __('Login') . ": $user_login\r\n"; 131 $message .= __('Password') . ": $new_pass\r\n"; 132 $message .= get_settings('siteurl') . '/wp-login.php'; 133 134 $m = wp_mail($user->user_email, sprintf(__("[%s] Your new password"), get_settings('blogname')), $message); 135 136 if ($m == false) { 137 echo '<p>' . __('The e-mail could not be sent.') . "<br />\n"; 138 echo __('Possible reason: your host may have disabled the mail() function...') . "</p>"; 139 die(); 140 } else { 141 echo '<p>' . sprintf(__("Your new password is in the mail."), $user_login) . '<br />'; 100 142 echo "<a href='wp-login.php' title='" . __('Check your e-mail first, of course') . "'>" . __('Click here to login!') . '</a></p>'; 143 die(); 144 } 145 101 146 // send a copy of password change notification to the admin 102 147 wp_mail(get_settings('admin_email'), sprintf(__('[%s] Password Lost/Change'), get_settings('blogname')), sprintf(__('Password Lost and Changed for user: %s'), $user_login)); 103 die();104 }105 106 148 break; 107 149 … … 159 201 window.onload = focusit; 160 202 </script> 203 <style type="text/css"> 204 #log, #pwd, #submit { 205 font-size: 1.7em; 206 } 207 </style> 161 208 </head> 162 209 <body> … … 170 217 171 218 <form name="loginform" id="loginform" action="wp-login.php" method="post"> 172 <p><label><?php _e('Login') ?>: 173 <p><label><?php _e('Password') ?>: <input type="password" name="pwd" value="" size="20" tabindex="2" /></label></p>219 <p><label><?php _e('Login') ?>:<br /><input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label></p> 220 <p><label><?php _e('Password') ?>:<br /> <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label></p> 174 221 <p class="submit"> 175 <input type="submit" name="submit" value="<?php _e('Login'); ?> »" tabindex="3" />222 <input type="submit" name="submit" id="submit" value="<?php _e('Login'); ?> »" tabindex="3" /> 176 223 <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>" /> 177 224 </p> -
trunk/wp-register.php
r1997 r2215 27 27 28 28 $user_login = $_POST['user_login']; 29 $pass1 = $_POST['pass1'];30 $pass2 = $_POST['pass2'];31 29 $user_email = $_POST['user_email']; 32 30 … … 35 33 die (__('<strong>ERROR</strong>: Please enter a login.')); 36 34 } 37 38 /* checking the password has been typed twice */39 if ($pass1 == '' || $pass2 == '') {40 die (__('<strong>ERROR</strong>: Please enter your password twice.'));41 }42 43 /* checking the password has been typed twice the same */44 if ($pass1 != $pass2) {45 die (__('<strong>ERROR</strong>: Please type the same password in the two password fields.'));46 }47 $user_nickname = $user_login;48 35 49 36 /* checking e-mail address */ … … 64 51 $user_browser = $wpdb->escape($_SERVER['HTTP_USER_AGENT']); 65 52 66 $user_login = $wpdb->escape($user_login); 67 $pass1 = $wpdb->escape($pass1); 68 $user_nickname = $wpdb->escape($user_nickname); 69 $user_nicename = sanitize_title($user_nickname); 53 $user_login = $wpdb->escape( preg_replace('|a-z0-9 _.-|i', '', $user_login) ); 54 $user_nickname = $user_login; 55 $user_nicename = sanitize_title($user_nickname); 70 56 $now = gmdate('Y-m-d H:i:s'); 71 57 if (get_settings('new_users_can_blog') >= 1) $user_level = 1; 58 $password = substr( md5( uniqid( microtime() ) ), 0, 7); 72 59 73 60 $result = $wpdb->query("INSERT INTO $wpdb->users 74 61 (user_login, user_pass, user_nickname, user_email, user_ip, user_browser, user_registered, user_level, user_idmode, user_nicename) 75 62 VALUES 76 ('$user_login', MD5('$pass 1'), '$user_nickname', '$user_email', '$user_ip', '$user_browser', '$now', '$user_level', 'nickname', '$user_nicename')");63 ('$user_login', MD5('$password'), '$user_nickname', '$user_email', '$user_ip', '$user_browser', '$now', '$user_level', 'nickname', '$user_nicename')"); 77 64 78 65 if ($result == false) { … … 84 71 $stars .= '*'; 85 72 } 73 74 $message = __('Login') . ": $user_login\r\n"; 75 $message .= __('Password') . ": $new_pass\r\n"; 76 $message .= get_settings('siteurl') . '/wp-login.php'; 77 78 wp_mail($user_email, sprintf(__("[%s] Your login information"), get_settings('blogname')), $message); 86 79 87 80 $message = sprintf(__("New user registration on your blog %1\$s:\n\nLogin: %2\$s \n\nE-mail: %3\$s"), get_settings('blogname'), $user_login, $user_email); … … 102 95 <h2><?php _e('Registration Complete') ?></h2> 103 96 <p><?php _e('Login:') ?> <strong><?php echo $user_login; ?></strong><br /> 104 <?php _e('Password:') ?> <strong> <?php echo $stars; ?></strong><br />97 <?php _e('Password:') ?> <strong>emailed to you</strong><br /> 105 98 <?php _e('E-mail:') ?> <strong><?php echo $user_email; ?></strong></p> 106 99 <form action="wp-login.php" method="post" name="login"> … … 150 143 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" /> 151 144 <link rel="stylesheet" href="wp-admin/wp-admin.css" type="text/css" /> 145 <style type="text/css"> 146 #user_email, #user_login, #submit { 147 font-size: 1.7em; 148 } 149 </style> 152 150 </head> 153 151 154 152 <body> 155 153 <div id="login"> 156 <h2><?php _e('Registration') ?></h2> 154 <h1><a href="http://wordpress.org/">WordPress</a></h1> 155 <h2><?php _e('Register for this blog') ?></h2> 157 156 158 <form method="post" action="wp-register.php"> 159 <input type="hidden" name="action" value="register" /> 160 <label for="user_login"><?php _e('Login:') ?></label> <input type="text" name="user_login" id="user_login" size="10" maxlength="20" /><br /> 161 <label for="pass1"><?php _e('Password:') ?></label> <input type="password" name="pass1" id="pass1" size="10" maxlength="100" /><br /> 162 163 <input type="password" name="pass2" size="10" maxlength="100" /><br /> 164 <label for="user_email"><?php _e('E-mail') ?></label>: <input type="text" name="user_email" id="user_email" size="15" maxlength="100" /><br /> 165 <input type="submit" value="<?php _e('OK') ?>" class="search" name="submit" /> 157 <form method="post" action="wp-register.php" id="registerform"> 158 <p><input type="hidden" name="action" value="register" /> 159 <label for="user_login"><?php _e('Login:') ?></label><br /> <input type="text" name="user_login" id="user_login" size="20" maxlength="20" /><br /></p> 160 <p><label for="user_email"><?php _e('E-mail') ?></label>:<br /> <input type="text" name="user_email" id="user_email" size="25" maxlength="100" /></p> 161 <p>A password will be emailed to you.</p> 162 <p class="submit"><input type="submit" value="<?php _e('Register') ?> »" id="submit" name="submit" /></p> 166 163 </form> 164 <ul> 165 <li><a href="<?php bloginfo('home'); ?>" title="<?php _e('Are you lost?') ?>">« <?php _e('Back to blog') ?></a></li> 166 <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php"><?php _e('Login') ?></a></li> 167 <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=lostpassword" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a></li> 168 </ul> 167 169 </div> 168 170
Note: See TracChangeset
for help on using the changeset viewer.