Plugin Directory

Changeset 186243


Ignore:
Timestamp:
12/22/2009 07:15:34 PM (16 years ago)
Author:
dlo
Message:

v1.0.0

Location:
sabre
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • sabre/tags/1.0.0/classes/sabre_class.php

    r185260 r186243  
    367367    }
    368368
     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
    369396    if ($enable_invite == 'true') {
    370397        for ($i=0; $i < count($invite_codes); $i++)
     
    377404        else {
    378405            $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)) {
    380414                --$invite_codes[$key[0]]['number'];
    381415                if ($invite_codes[$key[0]]['number'] < 0) {
     
    387421                $sabre_opt['invite_codes'] = $invite_codes;
    388422            }
    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             }
    396423        }   
    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         }
    424424    }
    425425
     
    427427        @$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']));
    428428        $sabre_opt['total_stopped'] += 1;
    429     }
     429        }
    430430    elseif ($enable_confirm != 'none') {
    431431        @$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']));
     
    727727
    728728    $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)");
    732732    if (!mysql_error())
    733733        return sprintf(__ngettext('%s record deleted.', '%s records deleted.', $removed, 'sabre'), $removed);
     
    975975    $curdate = current_time('timestamp', 0);
    976976    $stordate = date("Y-m-d H:i:s", $curdate);
    977     $compdate = date("Y-m-d", $curdate);
    978 
     977   
    979978    if ($enable_confirm == 'user') {
    980979        $error[0] = __('Exceeded period for confirmation of registration.', 'sabre');
    981980        $days = (int)$period;
    982981        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)");
    984983            if ($users) {
    985984                foreach ($users as $user) {
     
    989988            }
    990989
    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)");
    992991    }
    993992
     
    995994    $purge = (int)$purge_days;
    996995    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')";
    998997        $removed = $wpdb->query($query);
    999998    }
  • sabre/tags/1.0.0/classes/sabre_class_admin.php

    r180030 r186243  
    7474            if ($cur_tab == 'spam') {
    7575                $where = "`status` = 'ko'";
    76                 $sabre_opt['last_spam_check'] = current_time('timestamp', 1);
     76                $sabre_opt['last_spam_check'] = current_time('timestamp', 0);
    7777                $title = __("Invalid registration list", 'sabre');
    7878            }
    7979            elseif ($cur_tab == 'approved') {
    8080                $where = "`status` = 'ok'";
    81                 $sabre_opt['last_approved_check'] = current_time('timestamp', 1);
     81                $sabre_opt['last_approved_check'] = current_time('timestamp', 0);
    8282                $title = __("Valid registration list", 'sabre');
    8383            }
    8484            else {
    8585                $where = "`status` = 'to confirm'";
    86                 $sabre_opt['last_confirm_check'] = current_time('timestamp', 1);
     86                $sabre_opt['last_confirm_check'] = current_time('timestamp', 0);
    8787                $title = __("To confirm registration list", 'sabre');
    8888            }
  • sabre/tags/1.0.0/readme.txt

    r181589 r186243  
    44Tags: spam, admin, registration, register, security, antispam, anti-spam, authentication
    55Requires at least: 2.5
    6 Tested up to: 2.8.4
     6Tested up to: 2.9
    77Stable tag: 1.0.0
    88
     
    266266
    267267* 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. 
    271272
    272273= v0.9.0 =
  • sabre/trunk/readme.txt

    r153123 r186243  
    44Tags: spam, admin, registration, register, security, antispam, anti-spam, authentication
    55Requires at least: 2.5
    6 Tested up to: 2.8.4
    7 Stable tag: 0.9.0
     6Tested up to: 2.9
     7Stable tag: 1.0.0
    88
    99Sabre is an acronym for Simple Anti Bot Registration Engine.
     
    23231. Selection of the background colour for the captcha image
    24241. Inclusion of a math test in the registration form
    25 1. Selection of the math test's complexity
     251. Selection of the math test's complexity
     261. Inclusion of a text test in the registration form
    26271. Random or fixed choice of the test to run
    27281. Unobstrusive tests to detect if registration is done by humans or not
     
    7071- and WordPress 2.5 or higher
    7172
    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 .
     73If 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 .
    7374
    7475= Where can I find a translation of Sabre in my own language ? =
     
    141142The 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.
    142143
    143 1c) Sequence of tests
     1441c) Text Options
     145
     146Click 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
     148This is an alternative to the graphic captcha for those who dislike it.
     149
     1501d) Sequence of tests
    144151
    145152Select "All" to add all the active tests in the registration form.
     
    147154Select "Randomly" and the plugin will choose one of the tests, active or not.
    148155
    149 1d) Stealth Options
     1561e) Stealth Options
    150157
    151158Click 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.
     
    161168* Control that IP address is not banned by DNSBL servers. You can turn on/off this control, clicking on the checkbox "Check DNS Blacklists".   
    162169
    163 1e) Confirmation Options
     1701f) Confirmation Options
    164171
    165172Select the correct item on the dropdown list "Activate confirmation" to force the user or the blog administrator to confirm the registration on your blog.
     
    181188IMPORTANT : 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.
    182189
    183 1f) Policy Options
     1901g) Policy Options
    184191
    185192Click 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.
     
    189196Write down the text of your disclaimer in the "Policy text" input box. Just write plain text. HTML tags are not allowed.
    190197
    191 1g) Invitation Options
     1981h) Invitation Options
    192199
    193200Click 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.
    194201
    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.
     202Fill 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.
     203If 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.
     204If 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.
     205Then, you can communicate those codes to the persons who will be allowed to register on your blog.
     206
     2071i) Policy Options
    197208
    198209Give a title to your text block filling the "Policy name" input box. You can choose names like Disclaimer, Licence agreement, General policy, etc...
     
    200211Write down the text of your disclaimer in the "Policy text" input box. Just write plain text. HTML tags are not allowed.
    201212
    202 1h) Miscellaneous Options
     2131j) Miscellaneous Options
    203214
    204215Click 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
     217Enter 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
     219Enter 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.
    205220
    206221Click 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 !
     
    247262
    248263== 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. 
    249272
    250273= v0.9.0 =
Note: See TracChangeset for help on using the changeset viewer.