Changeset 338121
- Timestamp:
- 01/28/2011 10:38:11 AM (15 years ago)
- Location:
- sabre/tags/1.2.0
- Files:
-
- 7 edited
-
classes/sabre_class.php (modified) (13 diffs)
-
classes/sabre_class_admin.php (modified) (1 diff)
-
languages/sabre-fr_FR.mo (modified) (previous)
-
languages/sabre-fr_FR.po (modified) (4 diffs)
-
languages/sabre.pot (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
-
sabre.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sabre/tags/1.2.0/classes/sabre_class.php
r271734 r338121 32 32 33 33 /***********************************************************************/ 34 35 34 /* Handling of Sabre in the Admin/Manage menu */ 36 35 /***********************************************************************/ … … 95 94 // Choose the sequence of tests 96 95 if ($sabre_seq == 'Random') { 97 $dice = mt_rand(1,3); 98 switch ($dice) { 99 case 1 : 100 $enable_math = 'false'; 101 $enable_captcha = 'true'; 102 $enable_text = 'false'; 103 break; 104 case 2 : 105 $enable_math = 'true'; 106 $enable_captcha = 'false'; 107 $enable_text = 'false'; 108 break; 109 case 3 : 110 $enable_math = 'false'; 111 $enable_captcha = 'false'; 112 $enable_text = 'true'; 113 break; 114 } 96 $arr1 = array(); 97 $arr2 = array( 'enable_captcha' => 'false', 98 'enable_math' => 'false', 99 'enable_text' => 'false' ); 100 if ($enable_captcha == 'true') 101 $arr1[] = 'enable_captcha'; 102 if ($enable_math == 'true') 103 $arr1[] = 'enable_math'; 104 if ($enable_text == 'true') 105 $arr1[] = 'enable_text'; 106 $dice = mt_rand(0,(count($arr1) - 1)); 107 $arr2[$arr1[$dice]] = 'true'; 108 extract ($arr2, EXTR_OVERWRITE); 115 109 } 116 110 … … 175 169 echo '<input type="password" name="user_pwd1" id="user_pwd1" class="input" value="" size="20" tabindex="25" /></label>'; 176 170 echo '<input type="password" name="user_pwd2" id="user_pwd2" class="input" value="" size="20" tabindex="26" /></label><br />'; 177 // echo '<strong>' . __('Strength indicator') . '</strong><br />';178 // echo '<label id="pass-strength-result">' . __('Too short', 'sabre') . '</label><br />' . __('Hint: Your password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).');171 echo '<strong>' . __('Strength indicator', 'sabre') . '</strong>'; 172 echo '<label id="pass-strength-result">' . __('Too short', 'sabre') . '</label><br />' . __('Hint: Your password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).', 'sabre'); 179 173 echo '</p>'; 180 174 } … … 217 211 if ( $errmsg = $errors->get_error_message('sabre_no_policy') ) 218 212 echo '<p class="error">' .$errmsg .'</p>'; 219 echo '< /label><input type="checkbox" name="policy" id="policy" class="input" value="yes" tabindex="45" /></label>';213 echo '<input type="checkbox" name="policy" id="policy" value="yes" tabindex="43" />'; 220 214 _e('I agree', 'sabre'); 221 echo '</ p>';215 echo '</label></p>'; 222 216 } 223 217 if ($enable_invite == 'true') { … … 921 915 $sabre_opt['enable_text'] = (isset($form_values['sabre_enable_text']) ? 'true' : 'false'); 922 916 923 $sabre_opt['enable_confirm'] = $form_values['sabre_enable_confirm'];917 $sabre_opt['enable_confirm'] = (isset($form_values['sabre_enable_confirm']) ? $form_values['sabre_enable_confirm'] : 'none'); 924 918 $sabre_opt['period'] = (1 > (int)$form_values['sabre_confirm_period'] ? 1 : (int)$form_values['sabre_confirm_period']); 925 919 $sabre_opt['no_entry'] = (isset($form_values['sabre_no_entry']) ? 'true' : 'false'); … … 962 956 function sabre_css () 963 957 { 964 if ( $_REQUEST['page'] == 'sabre')958 if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'sabre') 965 959 include_once(SABREPATH . 'sabre_css.php'); 966 960 } … … 972 966 function login_css () 973 967 { 974 /* 975 if ($_REQUEST['action'] == 'register' || is_multisite()) { 968 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'register' && !is_multisite()) { 976 969 wp_register_script('password-strength-meter', '/wp-admin/js/password-strength-meter.js', array('jquery'), '20070405'); 977 970 wp_localize_script( 'password-strength-meter', 'pwsL10n', array( … … 979 972 'bad' => __('Bad', 'sabre'), 980 973 'good' => __('Good', 'sabre'), 981 'strong' => __('Strong', 'sabre') 974 'strong' => __('Strong', 'sabre'), 975 'mismatch' => __('Mismatch', 'sabre') 982 976 ) ); 983 977 wp_print_scripts('password-strength-meter'); … … 988 982 var pass = jQuery('#user_pwd1').val(); 989 983 var user = jQuery('#user_login').val(); 984 var pass2 = jQuery('#user_pwd2').val(); 990 985 991 986 // get the result as an object, i'm tired of typing it 992 987 var res = jQuery('#pass-strength-result'); 993 988 994 var strength = passwordStrength(pass, user );989 var strength = passwordStrength(pass, user, pass2); 995 990 996 991 jQuery(res).removeClass('short bad good strong'); … … 1007 1002 jQuery(res).addClass('strong'); 1008 1003 jQuery(res).html( pwsL10n.strong ); 1004 } 1005 else if ( strength == 5 ) { 1006 jQuery(res).addClass('short'); 1007 jQuery(res).html( pwsL10n.mismatch ); 1009 1008 } 1010 1009 else { … … 1016 1015 } 1017 1016 1018 jQuery(function($) { 1019 $('#user_pwd1').keyup( check_pass_strength ) 1020 $('.color-palette').click(function(){$(this).siblings('input[name=admin_color]').attr('checked', 'checked')}); 1017 jQuery(document).ready(function($) { 1018 $('#user_pwd1').keyup( check_pass_strength ); 1019 $('#user_pwd2').keyup( check_pass_strength ); 1020 $('.color-palette').click(function(){$(this).siblings('input[name=admin_color]').attr('checked', 'checked')}); 1021 1021 } ); 1022 1022 … … 1028 1028 1029 1029 } 1030 */1030 1031 1031 echo "<link rel=\"stylesheet\" href=\"" . SABREURL . "sabre_login.css" . "\" type=\"text/css\" />\r\n\r\n"; 1032 1032 … … 1524 1524 global $wp_version; 1525 1525 1526 1527 1526 if (version_compare($wp_version, '3.0', '<')) { 1528 1527 deactivate_plugins('sabre'); // Deactivate ourself -
sabre/tags/1.2.0/classes/sabre_class_admin.php
r271734 r338121 304 304 echo '<option value="All" ' . $this->selected($sabre_seq, 'All') . ' >' . __('All', 'sabre') . '</option>'; 305 305 echo '<option value="Random" ' . $this->selected($sabre_seq, 'Random') . ' >' . __('Randomly', 'sabre') . '</option>'; 306 307 306 echo '</select></td><td>' . __('(How do we use the above tests?)', 'sabre') . '</td></tr>'; 308 307 echo '</table>'; -
sabre/tags/1.2.0/languages/sabre-fr_FR.po
r271734 r338121 3 3 "Project-Id-Version: \n" 4 4 "POT-Creation-Date: \n" 5 "PO-Revision-Date: 201 0-08-03 15:09+0100\n"5 "PO-Revision-Date: 2011-01-06 18:30+0100\n" 6 6 "Last-Translator: DLO <DLO@DLO.com>\n" 7 7 "Language-Team: \n" … … 41 41 msgstr "Code invité utilisé." 42 42 43 msgid "Strength indicator" 44 msgstr "Indicateur de sûreté" 45 46 msgid "Hint: Your password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! \" ? $ % ^ & )." 47 msgstr "Conseil: Votre mot de passe doit comporter au moins sept caractères. Pour le rendre plus sûr, utilisez des majuscules, des minuscules, des chiffres et des symboles tels que ! \" ? $ % ^ & )." 48 43 49 msgid "Too short" 44 50 msgstr "Très faible" … … 52 58 msgid "Strong" 53 59 msgstr "Forte" 60 61 msgid "Mismatch" 62 msgstr "Non identique" 54 63 55 64 msgid "Please enter your invitation code:" … … 484 493 msgstr "Mot de passe: %s" 485 494 486 msgid "[%s] Your username and password" 487 msgstr "[%s] Votre identifiant et mot de passe" 495 msgid "Use the password defined during your registration" 496 msgstr "Utilisez le mot de passe choisi pendant l'enregistrement" 497 498 msgid "[%s] - Your registration information" 499 msgstr "[%s] - Vos informations d'enregistrement" 488 500 489 501 msgid "You must confirm your registration within %s day by following the link below" -
sabre/tags/1.2.0/languages/sabre.pot
r271734 r338121 41 41 msgstr "" 42 42 43 msgid "Strength indicator" 44 msgstr "" 45 46 msgid "Hint: Your password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! \" ? $ % ^ & )." 47 msgstr "" 48 43 49 msgid "Too short" 44 50 msgstr "" … … 51 57 52 58 msgid "Strong" 59 msgstr "" 60 61 msgid "Mismatch" 53 62 msgstr "" 54 63 … … 484 493 msgstr "" 485 494 486 msgid "[%s] Your username and password" 495 msgid "Use the password defined during your registration" 496 msgstr "" 497 498 msgid "[%s] - Your registration information" 487 499 msgstr "" 488 500 -
sabre/tags/1.2.0/readme.txt
r271734 r338121 4 4 Tags: spam, admin, registration, register, security, antispam, anti-spam, authentication 5 5 Requires at least: 3.0 6 Tested up to: 3. 0.16 Tested up to: 3.1.0 7 7 Stable tag: 1.2.0 8 8 … … 86 86 1. [Spanish](http://www.faltantornillos.net/proyectos/gnu/otros/sabre-es_ES.tar.gz) (thanks to Daniel) 87 87 1. [Finnish](http://systemshed.com/sabre/sabre_fi_FI.zip) (thanks to Kimmo Sinkko) 88 1. [German](http://matthiaskoch.net/?p=37) (thanks to Matthias Koch) 88 1. [German](http://www.inbegriff.de/wp-content/uploads/languages.rar) (thanks to Andreas Schulz) 89 1. [German - old version](http://matthiaskoch.net/?p=37) (thanks to Matthias Koch) 89 90 1. [Polish](http://dev.m1chu.eu/index.php?title=Polska_translacja_Sabre) (thanks to m1chu) 90 91 1. [Portuguese - Brazil](http://www.tudoparawordpress.com.br/download/plugins/sabre.0.8.1-pt-BR.zip) (thanks to Gustavo) … … 275 276 = v1.2.0 = 276 277 277 * Compliant with WordPress 3.0 or higher in mono and multisite mode. 278 * CAUTION: This version won't run with WordPress prior to 3.0. See the NOTE 1 of the Description paragraph if you want to use Sabre with an older version of WordPress. 278 * CAUTION: This version won't run with WordPress versions prior to 3.0. See the NOTE 1 of the Description paragraph if you want to use Sabre with an older version of WordPress. 279 * Compliant with WordPress 3.0 or higher. 280 * (NEW) Usable in multisite mode. See list of features for restrictions. 281 * (ENHANCED) Random security test now choose among active tests only. 282 * (ENHANCED) Password no longer included in the registration mail if the custom password option is activated. 283 * (FIXED) Few bugs fixed like Password strength indicator and missing HTML tags. 279 284 280 285 = v1.1.2 = -
sabre/tags/1.2.0/sabre.php
r271734 r338121 79 79 $plaintext_pass = $_POST['user_pwd1']; 80 80 wp_set_password($plaintext_pass, $user_id); 81 delete_user_setting('default_password_nag', $user_id); 82 update_user_option($user_id, 'default_password_nag', false, true); 81 83 } 82 84 83 85 $message = sprintf(__('Thank you for registering on %s', 'sabre'), get_option('blogname')) . "\r\n\r\n"; 84 86 $message .= sprintf(__('Username: %s', 'sabre'), $user_login) . "\r\n"; 85 $message .= sprintf(__('Password: %s', 'sabre'), $plaintext_pass) . "\r\n\r\n"; 87 if ($sabre_opt['user_pwd'] == 'true') 88 $message .= __('Use the password defined during your registration', 'sabre') . "\r\n\r\n"; 89 else $message .= sprintf(__('Password: %s', 'sabre'), $plaintext_pass) . "\r\n\r\n"; 86 90 if ($sabre_opt['enable_confirm'] == 'user') { 87 91 $message .= sprintf(__ngettext('You must confirm your registration within %s day by following the link below', 'You must confirm your registration within %s days by following the link below', $sabre_opt['period'], 'sabre'), $sabre_opt['period']) . "\r\n\r\n"; … … 96 100 } 97 101 98 wp_mail($user_email, sprintf(__('[%s] Your username and password', 'sabre'), get_option('blogname')), $message, $mail_from);102 wp_mail($user_email, sprintf(__('[%s] - Your registration information', 'sabre'), get_option('blogname')), $message, $mail_from); 99 103 100 104 }
Note: See TracChangeset
for help on using the changeset viewer.