Changeset 84

Show
Ignore:
Timestamp:
06/26/07 14:29:33 (2 years ago)
Author:
pdingle
Message:

added selector trigger, customdata, managedonly, timevalidation to the wp_options table and removed case where customdatapath pointed to either a dummy file or the custom file (now you check the pw_custom_data boolean and include the custom file if applicable)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-infocard/pw-config.php

    r78 r84  
    77define ('PW_SHOW_BINARY', false); 
    88define ('PW_PLUGINPATH', '/wp-content/plugins/wp-infocard'); 
    9 define ('PW_SELECTORTRIGGER', 'html' ); // this can also be set to XHTML 
    109define ('PW_MANAGEDONLY', false ); 
    1110define ('PW_VERSION', 'b3'); 
    1211define ('PW_VERSION_DATE', '20June07'); 
    13 define ('PW_SELECTORTRIGGER', 'html'); 
    1412define ('PW_USECAPTCHAS', false ); 
    15 define ('PW_CUSTOMDATAPATH', dirname(__FILE__) . '/' . PW_PLUGIN. '/customdata.pw.php'); 
    16 //define ('PW_CUSTOMDATAPATH', dirname(__FILE__) . '/custom/customdata.pw.php'); 
    17  
    18 include_once( PW_CUSTOMDATAPATH ); 
    19  
    20 include_once( dirname(__FILE__) . '/' . PW_PLUGIN. '/pw-claimtypes.php'); 
    2113define ('PW_DEBUG_ON', get_settings('pw_debug_on')); 
    22 define ('PW_TIMEVALIDATION_ON', false); 
     14define ('PW_SELECTOR_TRIGGER', get_settings('pw_selector_trigger')); 
     15define ('PW_CUSTOM_DATA', get_settings('pw_custom_data')); 
     16define ('PW_MANAGEDONLY', get_settings('pw_trust_managed_cards')); 
     17define ('PW_TRUST_MANAGED_CARDS', get_settings('pw_trust_managed_cards')); 
     18define ('PW_CUSTOMDATAPATH', dirname(__FILE__) . '/custom/customdata.pw.php'); 
     19define ('PW_TIMEVALIDATION_ON', get_settings('pw_time_validation')); 
    2320define ('PW_PATH', ABSPATH . PW_PLUGINPATH); 
    2421define ('PW_IMGPATH', PW_PATH . '/pwlib/images'); 
     
    2926define ('PW_SITEMESGURL', PW_PLUGINURL . '/site-messages/infocard-usermessage.php'); 
    3027define ('PW_SECURESITEURL', get_settings('securesiteurl') ); 
    31 define ('PW_FP_ICON', 'infocard_60x42.png' ); // icon must be in /pwlib/images/ic-logo 
     28 
     29if ( PW_CUSTOM_DATA)  
     30        include_once( PW_CUSTOMDATAPATH ); 
     31include_once( dirname(__FILE__) . '/' . PW_PLUGIN. '/pw-claimtypes.php'); 
     32define ('PW_FP_ICON', 'infocard_60x42.png' ); // icon must be in /pwlib/images 
    3233?> 
  • trunk/wp-infocard/wp/admin.pw.php

    r81 r84  
    169169                $this->createOption('pw_debug_on', 0); 
    170170                $this->createOption('pw_enable_pass', 0); 
    171  
    172  
     171                $this->createOption('pw_selector_trigger', 'html'); 
     172                $this->createOption('pw_custom_data', 0); 
     173                $this->createOption('pw_time_validation', 1); 
     174                $this->createOption('pw_trust_managed_cards', 0); 
     175                $this->createOption('pw_trusted_idp_list', ''); 
    173176 
    174177        } // end function setup 
     
    326329                $ic_debug = $new_debug = pw_admin::getOption('pw_debug_on'); 
    327330                $ic_pass = $new_pass = pw_admin::getOption('pw_enable_pass'); 
     331                $ic_trigger = $new_trigger = pw_admin::getOption('pw_selector_trigger'); 
     332                $ic_customdata = $new_customdata = pw_admin::getOption('pw_custom_data'); 
     333                $ic_timeval = $new_timeval = pw_admin::getOption('pw_time_validation'); 
     334                $ic_managed = $new_managed = pw_admin::getOption('pw_trust_managed_cards'); 
     335                $ic_idplist = $new_idplist = pw_admin::getOption('pw_trusted_idp_list'); 
    328336 
    329337                // write submitted changes if this page reload shows a submit 
     
    335343                        $new_debug = $_POST['pw_debug_on']; 
    336344                        $new_pass = $_POST['pw_enable_pass']; 
     345                        $new_trigger = $_POST['pw_selector_trigger']; 
     346                        $new_customdata = $_POST['pw_custom_data']; 
     347                        $new_timeval = $_POST['pw_time_validation']; 
     348                        $new_managed = $_POST['pw_trust_managed_cards']; 
     349                        $new_idplist = $_POST['pw_trusted_idp_list']; 
    337350                } 
    338351 
     
    357370                } 
    358371                 
     372                if ( $ic_trigger != $new_trigger ){ 
     373                        update_option('pw_selector_trigger', $new_trigger ); 
     374                } 
     375 
     376                if ( $ic_customdata != $new_customdata ){ 
     377                        update_option('pw_custom_data', $new_customdata ); 
     378                } 
     379 
     380                if ( $ic_timeval != $new_timeval ){ 
     381                        update_option('pw_time_validation', $new_timeval ); 
     382                } 
     383 
     384                if ( $ic_managed != $new_managed ){ 
     385                        update_option('pw_trust_managed_cards', $new_managed ); 
     386                } 
     387 
     388                if ( $ic_idplist != $new_idplist ){ 
     389                        update_option('pw_trusted_idp_list', $new_idplist ); 
     390                } 
     391 
    359392                pw_admin::printSystemCheck($new_secureurl); 
    360393?> 
     
    405438?> 
    406439                        </td></tr> 
    407 <tr><td>&nbsp</td><td/></tr> 
    408 <tr><th colspan="2" align="left">Advanced TroubleShooting</td></tr> 
    409                         <tr><td>&nbsp;</td><td/></tr> 
    410                         <tr><td colspan="2"> 
    411                                 <input name="pw_debug_on" type="checkbox" id="pw_debug_on" value="1" <?php checked('1', ($new_debug)); ?> /> 
    412                                 <?php _e('Debug Mode', 'wp-infocard'); ?> 
     440                        <tr><td>&nbsp</td><td/></tr> 
     441                        <tr><th colspan="2" align="left"> 
     442                                <?php pw_utils::ScreenPrint('Advanced Settings'); ?> 
     443                        </td></tr> 
     444                        <tr><td colspan="2"> 
     445                                <?php pw_utils::screenPrint('Don\'t mess with these unless you understand and accept the consequences. Security breaches or errors could occur if you change these settings under the wrong circumstances.'); ?> 
     446                        </td></tr> 
     447                        <tr><td colspan="2">&nbsp;</td></tr> 
     448                        <tr><td> 
     449                                <?php pw_utils::screenPrint('Debug Mode'); ?> 
     450                        </td><td> 
     451                                <input name="pw_debug_on" type="radio" id="pw_debug_on" value="1" <?php checked('1', ($new_debug)); ?> /> 
     452                                <?php pw_utils::screenPrint('On'); ?> 
     453 
     454                                <input name="pw_debug_on" type="radio" id="pw_debug_on" value="0" <?php checked('0', ($new_debug)); ?> /> 
     455                                <?php pw_utils::screenPrint('Off'); ?> 
     456                        </td></tr> 
     457                        <tr><td> 
     458                                <?php pw_utils::screenPrint('Time Validation'); ?> 
     459                        </td><td> 
     460                                <input name="pw_time_validation" type="radio" id="pw_time_validation" value="1" <?php checked('1', ($new_timeval)); ?> /> 
     461                                <?php pw_utils::screenPrint('On'); ?> 
     462 
     463                                <input name="pw_time_validation" type="radio" id="pw_time_validation" value="0" <?php checked('0', ($new_timeval)); ?> /> 
     464                                <?php pw_utils::screenPrint('Off'); ?> 
     465                        <tr><td> 
     466                                <?php pw_utils::screenPrint('Use Custom Data'); ?> 
     467                        </td><td> 
     468                                <input name="pw_custom_data" type="radio" id="pw_custom_data" value="1" <?php checked('1', ($new_customdata)); ?> /> 
     469                                <?php pw_utils::screenPrint('On'); ?> 
     470 
     471                                <input name="pw_custom_data" type="radio" id="pw_custom_data" value="0" <?php checked('0', ($new_customdata)); ?> /> 
     472                                <?php pw_utils::screenPrint('Off'); ?> 
     473                        </td></tr> 
     474                        <tr><td> 
     475                                <?php pw_utils::screenPrint('Trust Managed Cards'); ?> 
     476                        </td><td> 
     477                                <input name="pw_trust_managed_cards" type="radio" id="pw_trust_managed_cards" value="0" <?php checked('0', ($new_managed)); ?> /> 
     478                                <?php pw_utils::screenPrint('No'); ?> 
     479 
     480                                <input name="pw_trust_managed_cards" type="radio" id="pw_trust_managed_cards" value="1" <?php checked('1', ($new_managed)); ?> /> 
     481                                <?php pw_utils::screenPrint('Yes'); ?> 
     482                        </td></tr> 
     483<?php 
     484                        if ( $new_managed ) 
     485                        { 
     486?> 
     487                        <tr><td/><td> 
     488                                <?php pw_utils::screenPrint('Managed Card Trust List (values must be full sts URLs, each value is separated by a "|")'); ?> 
     489                                <textarea cols="60" rows="3" name="pw_trusted_idp_list" id="pw_trusted_idp_list"><?php print $new_idplist; ?></textarea> 
     490                        </td><tr> 
     491 
     492<?php 
     493                                 
     494                        } 
     495?> 
     496 
     497                        <tr><td> 
     498                                <?php pw_utils::screenPrint('Selector Trigger'); ?> 
     499                        </td><td> 
     500                                <input name="pw_selector_trigger" type="radio" id="pw_selector_trigger" value="html" <?php checked('html', ($new_trigger)); ?> />        
     501                                <?php pw_utils::screenPrint('HTML'); ?> 
     502                                <input name="pw_selector_trigger" type="radio" id="pw_selector_trigger" value="xhtml" <?php checked('xhtml', ($new_trigger)); ?> /> 
     503                                <?php pw_utils::screenPrint('XHTML'); ?> 
    413504                        </td></tr> 
    414505                        <tr><td>&nbsp;</td><td/></tr> 
  • trunk/wp-infocard/wp/pw-claimtypes.php

    r66 r84  
    3838 
    3939// Add any custom claims 
    40 // (note - custom claims come from PW_CUSTOMDATAPATH in pw-config.php) 
    41 pw_customdata::addCustomClaims(); 
     40// (note - if PW_CUSTOM_DATA is set, the file in PW_CUSTOMDATAPATH  
     41//    is included in pw-config.php) 
     42if ( PW_CUSTOM_DATA ) 
     43        pw_customdata::addCustomClaims(); 
    4244 
    4345$datamap['display_name'] = new pw_mapping(  
     
    9496 
    9597// Map any custom claims 
    96 // (note - custom claims come from PW_CUSTOMDATAPATH in pw-config.php
    97 pw_customdata::addCustomDataMap (); 
     98if ( PW_CUSTOM_DATA
     99       pw_customdata::addCustomDataMap (); 
    98100?> 
  • trunk/wp-infocard/wp/userdata.pw.php

    r76 r84  
    129129                                        $datamap['last_name']->add_db_value( $last ); 
    130130                                } 
    131                                 pw_customdata::evaluateIncomingCustomData( $mail_user_id ); 
     131 
     132                                if ( PW_CUSTOM_DATA ) 
     133                                        pw_customdata::evaluateIncomingCustomData( $mail_user_id ); 
    132134                        break; 
    133135 
     
    262264                $userdata = compact('ID', 'user_login', 'user_email', 'user_nicename', 'user_url', 'display_name', 'first_name', 'last_name'); 
    263265 
    264                 pw_customdata::updateNewCustomData( $ID ); 
     266                if ( PW_CUSTOM_DATA ) 
     267                        pw_customdata::updateNewCustomData( $ID ); 
    265268 
    266269                if (wp_update_user($userdata))