Changeset 186243
- Timestamp:
- 12/22/2009 07:15:34 PM (16 years ago)
- Location:
- sabre
- Files:
-
- 1 deleted
- 4 edited
-
tags/1.0.0/classes/sabre_class.php (modified) (8 diffs)
-
tags/1.0.0/classes/sabre_class_admin.php (modified) (1 diff)
-
tags/1.0.0/readme.txt (modified) (2 diffs)
-
trunk/lisezmoi.txt (deleted)
-
trunk/readme.txt (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sabre/tags/1.0.0/classes/sabre_class.php
r185260 r186243 367 367 } 368 368 369 if ($result->captcha != NULL) { 370 $string = strtoupper($result->captcha); 371 $userstring = strtoupper($_POST['captcha']); 372 373 if (($string <> $userstring) || (strlen($userstring) <> $stringlength)) { 374 $error_msg_text = __('Invalid code.', 'sabre'); 375 $errors->add('sabre_captcha', $error_head_text . $error_msg_text); 376 $sabre_errors['sabre_captcha'] = $error_msg_text; 377 } 378 } 379 380 if ($result->math != NULL) { 381 if ($result->math <> $_POST['math']) { 382 $error_msg_text = __('Invalid math result.', 'sabre'); 383 $errors->add('sabre_math', $error_head_text . $error_msg_text); 384 $sabre_errors['sabre_math'] = $error_msg_text; 385 } 386 } 387 388 if ($result->letter != NULL) { 389 if ($result->letter <> strtoupper($_POST['letter'])) { 390 $error_msg_text = __('Invalid letter.', 'sabre'); 391 $errors->add('sabre_text', $error_head_text . $error_msg_text); 392 $sabre_errors['sabre_text'] = $error_msg_text; 393 } 394 } 395 369 396 if ($enable_invite == 'true') { 370 397 for ($i=0; $i < count($invite_codes); $i++) … … 377 404 else { 378 405 $key = array_keys($invite_arr, strtoupper($_POST['invite_code'])); 379 if (is_numeric($invite_codes[$key[0]]['number'])) { 406 if (!empty($invite_codes[$key[0]]['date'])) { 407 if ($invite_codes[$key[0]]['date'] < $curdate) { 408 $error_msg_text = __('Invalid invitation code.', 'sabre'); 409 $errors->add('sabre_invitation', $error_head_text . $error_msg_text); 410 $sabre_errors['sabre_invitation'] = $error_msg_text; 411 } 412 } 413 if (is_numeric($invite_codes[$key[0]]['number']) && empty($sabre_errors)) { 380 414 --$invite_codes[$key[0]]['number']; 381 415 if ($invite_codes[$key[0]]['number'] < 0) { … … 387 421 $sabre_opt['invite_codes'] = $invite_codes; 388 422 } 389 if (!empty($invite_codes[$key[0]]['date'])) {390 if ($invite_codes[$key[0]]['date'] < $curdate) {391 $error_msg_text = __('Invalid invitation code.', 'sabre');392 $errors->add('sabre_invitation', $error_head_text . $error_msg_text);393 $sabre_errors['sabre_invitation'] = $error_msg_text;394 }395 }396 423 } 397 }398 399 if ($result->captcha != NULL) {400 $string = strtoupper($result->captcha);401 $userstring = strtoupper($_POST['captcha']);402 403 if (($string <> $userstring) || (strlen($userstring) <> $stringlength)) {404 $error_msg_text = __('Invalid code.', 'sabre');405 $errors->add('sabre_captcha', $error_head_text . $error_msg_text);406 $sabre_errors['sabre_captcha'] = $error_msg_text;407 }408 }409 410 if ($result->math != NULL) {411 if ($result->math <> $_POST['math']) {412 $error_msg_text = __('Invalid math result.', 'sabre');413 $errors->add('sabre_math', $error_head_text . $error_msg_text);414 $sabre_errors['sabre_math'] = $error_msg_text;415 }416 }417 418 if ($result->letter != NULL) {419 if ($result->letter <> strtoupper($_POST['letter'])) {420 $error_msg_text = __('Invalid letter.', 'sabre');421 $errors->add('sabre_text', $error_head_text . $error_msg_text);422 $sabre_errors['sabre_text'] = $error_msg_text;423 }424 424 } 425 425 … … 427 427 @$wpdb->query($wpdb->prepare("UPDATE `" . SABRE_TABLE . "` SET `user` = %s, `email` = %s, `msg` = '" . maybe_serialize($sabre_errors) . "', `invite` = %s, `last_mod` = '" . $stordate ."', `status` = 'ko' WHERE `id` = %d", $_POST['user_login'], $_POST['user_email'], $_POST['invite_code'], (int)$_POST['sabre_id'])); 428 428 $sabre_opt['total_stopped'] += 1; 429 }429 } 430 430 elseif ($enable_confirm != 'none') { 431 431 @$wpdb->query($wpdb->prepare("UPDATE `" . SABRE_TABLE . "` SET `user` = %s, `email` = %s, `invite` = %s, `msg` = '', `last_mod` = '" . $stordate ."', `status` = 'to confirm' WHERE `id` = %d", $_POST['user_login'], $_POST['user_email'], $_POST['invite_code'], (int)$_POST['sabre_id'])); … … 727 727 728 728 $curdate = current_time('timestamp', 0); 729 $ compdate = date("Y-m-d", $curdate);730 731 $removed = $wpdb->query("DELETE FROM `" . SABRE_TABLE . "` WHERE `status` = 'ko' AND `last_mod` < DATE_SUB( $compdate, INTERVAL $days DAY)");729 $stordate = date("Y-m-d H:i:s", $curdate); 730 731 $removed = $wpdb->query("DELETE FROM `" . SABRE_TABLE . "` WHERE `status` = 'ko' AND `last_mod` < DATE_SUB('$stordate', INTERVAL $days DAY)"); 732 732 if (!mysql_error()) 733 733 return sprintf(__ngettext('%s record deleted.', '%s records deleted.', $removed, 'sabre'), $removed); … … 975 975 $curdate = current_time('timestamp', 0); 976 976 $stordate = date("Y-m-d H:i:s", $curdate); 977 $compdate = date("Y-m-d", $curdate); 978 977 979 978 if ($enable_confirm == 'user') { 980 979 $error[0] = __('Exceeded period for confirmation of registration.', 'sabre'); 981 980 $days = (int)$period; 982 981 if ($delete_user == 'true') { 983 $users = $wpdb->get_results("SELECT `user_id` FROM `" . SABRE_TABLE . "` WHERE `status` = 'to confirm' AND `last_mod` < DATE_SUB( $compdate, INTERVAL $days DAY)");982 $users = $wpdb->get_results("SELECT `user_id` FROM `" . SABRE_TABLE . "` WHERE `status` = 'to confirm' AND `last_mod` < DATE_SUB('$stordate', INTERVAL $days DAY)"); 984 983 if ($users) { 985 984 foreach ($users as $user) { … … 989 988 } 990 989 991 @$wpdb->query("UPDATE `" . SABRE_TABLE . "` SET `status` = 'ko', `last_mod` = '" . $stordate ."', `user_id` = NULL, `msg` = '" . maybe_serialize($error) . "' WHERE `status` = 'to confirm' AND `last_mod` < DATE_SUB( $compdate, INTERVAL $days DAY)");990 @$wpdb->query("UPDATE `" . SABRE_TABLE . "` SET `status` = 'ko', `last_mod` = '" . $stordate ."', `user_id` = NULL, `msg` = '" . maybe_serialize($error) . "' WHERE `status` = 'to confirm' AND `last_mod` < DATE_SUB('$stordate', INTERVAL $days DAY)"); 992 991 } 993 992 … … 995 994 $purge = (int)$purge_days; 996 995 if ($purge > 0) { 997 $query = "DELETE FROM `" . SABRE_TABLE . "` WHERE `last_mod` < DATE_SUB( $compdate, INTERVAL $purge DAY) AND `status` not in ('ok','to confirm')";996 $query = "DELETE FROM `" . SABRE_TABLE . "` WHERE `last_mod` < DATE_SUB('$stordate', INTERVAL $purge DAY) AND `status` not in ('ok','to confirm')"; 998 997 $removed = $wpdb->query($query); 999 998 } -
sabre/tags/1.0.0/classes/sabre_class_admin.php
r180030 r186243 74 74 if ($cur_tab == 'spam') { 75 75 $where = "`status` = 'ko'"; 76 $sabre_opt['last_spam_check'] = current_time('timestamp', 1);76 $sabre_opt['last_spam_check'] = current_time('timestamp', 0); 77 77 $title = __("Invalid registration list", 'sabre'); 78 78 } 79 79 elseif ($cur_tab == 'approved') { 80 80 $where = "`status` = 'ok'"; 81 $sabre_opt['last_approved_check'] = current_time('timestamp', 1);81 $sabre_opt['last_approved_check'] = current_time('timestamp', 0); 82 82 $title = __("Valid registration list", 'sabre'); 83 83 } 84 84 else { 85 85 $where = "`status` = 'to confirm'"; 86 $sabre_opt['last_confirm_check'] = current_time('timestamp', 1);86 $sabre_opt['last_confirm_check'] = current_time('timestamp', 0); 87 87 $title = __("To confirm registration list", 'sabre'); 88 88 } -
sabre/tags/1.0.0/readme.txt
r181589 r186243 4 4 Tags: spam, admin, registration, register, security, antispam, anti-spam, authentication 5 5 Requires at least: 2.5 6 Tested up to: 2. 8.46 Tested up to: 2.9 7 7 Stable tag: 1.0.0 8 8 … … 266 266 267 267 * Compliant with WordPress 2.9 268 * NEW! Captcha test added : The TEXT test. An alternative to the graphic captcha. The user will have to enter the n-th letter of a randomly generated word. 269 * NEW! Custom sender's name and Email on the registration's mails sent by Sabre. 270 * ENHANCED! Invitation codes management: Auto-generation of codes, limited use of the same code, period of validity of the codes. 268 * (NEW) Captcha test added : The TEXT test. An alternative to the graphic captcha. The user will have to enter the n-th letter of a randomly generated word. 269 * (NEW) Custom sender's name and Email on the registration's mails sent by Sabre. 270 * (ENHANCED) Invitation codes management: Auto-generation of codes, limited use of the same code, period of validity of the codes. 271 * (FIXED) Timestamps didn't take into account the GMT offset from the WordPress general options. 271 272 272 273 = v0.9.0 = -
sabre/trunk/readme.txt
r153123 r186243 4 4 Tags: spam, admin, registration, register, security, antispam, anti-spam, authentication 5 5 Requires at least: 2.5 6 Tested up to: 2. 8.47 Stable tag: 0.9.06 Tested up to: 2.9 7 Stable tag: 1.0.0 8 8 9 9 Sabre is an acronym for Simple Anti Bot Registration Engine. … … 23 23 1. Selection of the background colour for the captcha image 24 24 1. Inclusion of a math test in the registration form 25 1. Selection of the math test's complexity 25 1. Selection of the math test's complexity 26 1. Inclusion of a text test in the registration form 26 27 1. Random or fixed choice of the test to run 27 28 1. Unobstrusive tests to detect if registration is done by humans or not … … 70 71 - and WordPress 2.5 or higher 71 72 72 If you're using an earlier version of WordPress, install Sabre 0.6.3 as Sabre 0.9.x is only compatible with WordPress 2.5 and up .73 If you're using an earlier version of WordPress, install Sabre 0.6.3 as Sabre 1.0.x is only compatible with WordPress 2.5 and up . 73 74 74 75 = Where can I find a translation of Sabre in my own language ? = … … 141 142 The other parameter let you define the valid operations the plugin will choose from. Recognized operations are addition, substraction and multiplication. The plugin will choose randomly two numbers between 1 and 20 and one of the listed operations. 142 143 143 1c) Sequence of tests 144 1c) Text Options 145 146 Click on the checkbox "Activate text test" to display, in the registration form , a random word. The user will have to give the n-th letter of this word. 147 148 This is an alternative to the graphic captcha for those who dislike it. 149 150 1d) Sequence of tests 144 151 145 152 Select "All" to add all the active tests in the registration form. … … 147 154 Select "Randomly" and the plugin will choose one of the tests, active or not. 148 155 149 1 d) Stealth Options156 1e) Stealth Options 150 157 151 158 Click on the checkbox "Enable stealth test" to activate a set of internal tests that try to detect if the current registration is done by a human being or not. These tests doesn't interact with the user and run undetected for a regular human registration. … … 161 168 * Control that IP address is not banned by DNSBL servers. You can turn on/off this control, clicking on the checkbox "Check DNS Blacklists". 162 169 163 1 e) Confirmation Options170 1f) Confirmation Options 164 171 165 172 Select the correct item on the dropdown list "Activate confirmation" to force the user or the blog administrator to confirm the registration on your blog. … … 181 188 IMPORTANT : The users with "edit_users" capability will not be controled. Then, it is always possible to use the default admin account created by WordPress during the blog installation. 182 189 183 1 f) Policy Options190 1g) Policy Options 184 191 185 192 Click on the checkbox "Enable policy agreement" to force the user to acknowledge the fact that he read the rules of use of your blog before registration. … … 189 196 Write down the text of your disclaimer in the "Policy text" input box. Just write plain text. HTML tags are not allowed. 190 197 191 1 g) Invitation Options198 1h) Invitation Options 192 199 193 200 Click on the checkbox "Enable invitation" if you want to control who can register on your blog by asking the user to give his invitation code during registration. 194 201 195 Fill the "Invitation codes" input box with the valid invitation codes you want. Example : PROMOETE2008, SZ78PQR, etc... 196 Each code must be on a single line. Then, you can communicate those codes to the persons who will be allowed to register on your blog. 202 Fill the "Code" input box with the valid invitation codes you want. Example : PROMO2008, SZ78PQR, etc... or click on the "Gen" button to let Sabre generate an invitation code for you. To delete a code, just click on the "Sup" button. 203 If you want to limit the number of use for a specific code, just type a number in the "Usage" zone. Sabre will rest one each time the code is used. When the counter reaches zero, the code is no longer valid. 204 If you want to limit the period of use for a code, just type an expiration date in the "Validity" zone. Format must be YYYY-MM-DD: Example : 2010-10-20 for a code valid until October 20th, 2010. 205 Then, you can communicate those codes to the persons who will be allowed to register on your blog. 206 207 1i) Policy Options 197 208 198 209 Give a title to your text block filling the "Policy name" input box. You can choose names like Disclaimer, Licence agreement, General policy, etc... … … 200 211 Write down the text of your disclaimer in the "Policy text" input box. Just write plain text. HTML tags are not allowed. 201 212 202 1 h) Miscellaneous Options213 1j) Miscellaneous Options 203 214 204 215 Click on the checkbox "User password" to let the user choose his own password during the registration process. Otherwise, WordPress will generate a random password. The password strength is displayed in real time to help the user to choose a strong and safe password. 216 217 Enter the name you want in the "Sender's name" input box. This name will appear as the sender of the registration mail sent by Sabre to the user. Will default to the site's name if left blank. 218 219 Enter the Email address of your choice in the "Sender's Email" input box. It will appear as the sender's Email of the registration mail sent by Sabre. Will default to the administrator's Email set in the WordPress general parameters if left blank. 205 220 206 221 Click on the checkbox "Show banner" to add a reference and a link to Sabre's site at the bottom of the registration form. It's up to you to decide if you want to advertise Sabre or not ! … … 247 262 248 263 == Changelog == 264 265 = v1.0.0 = 266 267 * Compliant with WordPress 2.9 268 * (NEW) Captcha test added : The TEXT test. An alternative to the graphic captcha. The user will have to enter the n-th letter of a randomly generated word. 269 * (NEW) Custom sender's name and Email on the registration's mails sent by Sabre. 270 * (ENHANCED) Invitation codes management: Auto-generation of codes, limited use of the same code, period of validity of the codes. 271 * (FIXED) Timestamps didn't take into account the GMT offset from the WordPress general options. 249 272 250 273 = v0.9.0 =
Note: See TracChangeset
for help on using the changeset viewer.