Changeset 1315

Show
Ignore:
Timestamp:
08/28/08 18:36:44 (3 months ago)
Author:
_ck_
Message:

0.7.2 session start compatibility fix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • human-test/trunk/human-test.php

    r946 r1315  
    44Plugin URI:  http://bbpress.org/plugins/topic/77 
    55Description:  uses various methods to exclude bots from registering (and eventually posting) on bbPress 
    6 Version: 0.7.1 
     6Version: 0.7.2 
    77Author: _ck_ 
    88Author URI: http://bbshowcase.org 
     
    1111 
    1212Donate: http://amazon.com/paypage/P2FBORKDEFQIVM 
    13  
    14 Instructions:   install, activate, check registration page for new field and test a new registration. 
    15  
    16 todo: 
    17 "negative fields" that are hidden and supposed to remain blank but spam bots try to fill, therefore fail 
    18 optionally write questions in captcha-like graphics (tricks spammers to enter graphic as code instead of answer) 
    19 optionally notify admin of failed registration 
    20  
    21 history: 
    22 0.01    first public release - hard-coded and only can test for 2+2=4 (obviously improvements coming soon) 
    23 0.05    now generates random numbers for addition between 3 and 10 (and uses sessions on registration page only) 
    24 0.06    minor logic bug fix to prevent multiple attempts against same answer, additional text localization 
    25 0.07    SESSION support improvement, fine-tuning to question placement 
    2613*/  
    2714 
     
    4936        echo '<noscript><i>'.__("registration requires JavaScript").'</i></noscript>';  // warn no-script users  
    5037        echo '</th><td width="72%"><input name="human_test" type="text" id="human_test" size="30" maxlength="140" value="" />'; // answer field 
    51         echo '<input type="hidden" name = "'.session_name().'" value = "'.session_id().'">';  // improved session support without cookies or urls 
     38        echo '<input type="hidden" name = "'.session_name().'" value = "'.session_id().'" />';        // improved session support without cookies or urls 
    5239        echo '</td></tr></table></fieldset>'; 
    5340 
     
    5946if (human_register_page()) :  //  only display on register.php and hide on profile page 
    6047        // one way or another we're gonna need sessions for now 
    61         // @session_cache_limiter('nocache');  // "nocache" destroys form data with back button - "public" preserves form values when hitting back 
    62          
     48        if (!isset($_SESSION)) { 
     49        // @session_cache_limiter('nocache');  // "nocache" destroys form data with back button - "public" preserves form values when hitting back      
    6350        @ini_set('session.use_trans_sid', false); 
    6451        @ini_set("url_rewriter.tags",""); 
    6552        @session_start();       // sent with headers - errors masked with @ if sessions started previously - which it actually has to be for the following to  
    66  
     53        } 
    6754        if ($_POST || isset($_POST['human_test'])) { 
    6855                $human_test =  stripslashes_deep($_POST['human_test']);          
  • human-test/trunk/readme.txt

    r945 r1315  
    5656 
    5757* more attempts to fix session support on different server configs 
     58 
     59= Version 0.7.2 (2008-08-28) = 
     60 
     61* don't start session if already started to behave with other plugins that use sessions 
     62 
     63== To Do == 
     64 
     65* "negative fields" that are hidden and supposed to remain blank but spam bots try to fill, therefore fail 
     66 
     67* optionally write questions in captcha-like graphics (tricks spammers to enter graphic as code instead of answer) 
     68 
     69* optionally notify admin of failed registration 
     70