Plugin Directory

Changeset 534710


Ignore:
Timestamp:
04/22/2012 02:42:17 PM (14 years ago)
Author:
jcnetsys
Message:

Update to 4.03 - check github

Location:
password-protect-wordpress
Files:
1 added
4 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • password-protect-wordpress/trunk/_static/vendor.js

    r527811 r534710  
    229229function doApiRequest( method, args ) {
    230230    args = addDefaultArgs( args );
    231     var request_url = getVendorUrl() + method + '/?install_id=' + getInstallId();
    232 
    233     if( typeof(args) != "undefined" ) {
    234         for( arg_name in args ) {
    235             request_url += '&' + arg_name + '=' + args[arg_name];
    236         }
    237     }
    238 
    239     return jQuery.getJSON( request_url );
    240 }
    241 
    242 
     231    var request_url = getVendorUrl() + method + '/?jsoncallback=?&install_id=' + getInstallId();
     232
     233    if( typeof(args) == "undefined" ) {
     234        args = {};
     235    }
     236    return jQuery.getJSON( request_url, args );
     237}
  • password-protect-wordpress/trunk/lava/_classes/h2o/filters.php

    r527785 r534710  
    4747
    4848    static function urlize( $string, $truncate = false ) {
    49         $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
     49        $reg_exUrl = "/(^| )(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
    5050        preg_match_all($reg_exUrl, $string, $matches);
    5151        $usedPatterns = array();
     
    5353            if(!array_key_exists($pattern, $usedPatterns)){
    5454                $usedPatterns[$pattern]=true;
     55                if( substr( $pattern, 0, 1 ) == " " ) {
     56                    $pattern = substr( $pattern, 1 );
     57                }
    5558                $string = str_replace($pattern, "<a href=\"{$pattern}\" rel=\"nofollow\">{$pattern}</a>", $string);
    5659            }
     
    364367}
    365368
    366 /*  Ultizie php funciton as Filters */
     369/*  Utilize php funciton as Filters */
    367370h2o::addFilter(array('md5', 'sha1', 'numberformat'=>'number_format', 'wordwrap', 'trim', 'upper' => 'strtoupper', 'lower' => 'strtolower'));
    368371
  • password-protect-wordpress/trunk/lava/_classes/lavaMiscFunctions.php

    r531336 r534710  
    7676            'browser' => 'unknown'
    7777        );
    78         if( strpos( $ua, "ipad" ) ) {
     78        if( strpos( $ua, "iPad" ) ) {
    7979            $info['device'] = "iPad";
    8080            $info['os'] = 'ios';
  • password-protect-wordpress/trunk/lava/_classes/lavaSetting.php

    r527785 r534710  
    383383    {
    384384       
    385         $value = htmlentities($value, ENT_QUOTES);
     385        //$value = htmlentities($value, ENT_QUOTES);
     386        $value = utf8_encode( $value );
    386387        $cache = $this->getCache();
    387388       
     
    407408        $settingInputID = "{$pluginSlug}-{$settingWho}-{$settingKey}";
    408409        $settingOptions = $this->getProperty( "setting-options" );
    409         $settingValue = $this->getValue( true );
     410        $settingValue = $this->getValue( false );
    410411
    411412        return array(
     
    440441        if( $format == false)
    441442        {
    442             $value = html_entity_decode( $value );
     443            //$value = html_entity_decode( $value );
     444            $value = utf8_decode($value);
    443445            return $value;
    444446        }
  • password-protect-wordpress/trunk/lava/_classes/lavaSettingsPage.php

    r527785 r534710  
    22class lavaSettingsPage extends lavaPage
    33{
    4     public $multisiteSupport = true;
    5     public $who = "settings";
     4    public $multisiteSupport = true;
     5    public $who = "settings";
    66
    7     function loadPage()
    8     {
    9         $this->saveSettings();
    10         $this->resetSettings();
    11         $this->addAction( "toolbarButtons" );
    12         //queue notifications
    13         //do redirect
    14     }
     7    function loadPage()
     8    {
     9        $this->saveSettings();
     10        $this->resetSettings();
     11        $this->addAction( "toolbarButtons" );
     12        //queue notifications
     13        //do redirect
     14    }
    1515
    16     function displayPage()
    17     {
    18         $settings = $this->_settings()->fetchSettings( $this->who );
     16    function displayPage()
     17    {
     18        $settings = $this->_settings()->fetchSettings( $this->who );
    1919
    20         $this->doSettings( $settings );
    21     }
    22    
    23     function doSettings( $settings )
    24     {
    25         $settings = apply_filters( $this->_slug( $this->who . "settingsOrder" ), $settings );
    26         $hiddenForms = $this->runFilters( "hiddenForms", array() );
    27         foreach( $hiddenForms as $form )
    28         {
    29             ?>
    30             <form id="<?php echo $form['id'] ?>" class="invisible" method="post">
    31                 <?php foreach( $form['fields'] as $name => $value ): ?>
    32                     <input class="lava-<?php echo $name ?>" type="hidden" name="<?php echo $name ?>" value="<?php echo $value ?>" />
    33                 <?php endforeach; ?>
    34                 <?php
    35                      wp_nonce_field();
    36                     foreach( $form['capabilities'] as $capability => $name):
    37                     if( current_user_can( $capability ) )
    38                     {
    39                         $action = $this->_slug( $name );
    40                         wp_nonce_field( $action, $name, false );
    41                     }
    42                 endforeach; ?>
    43             </form>
    44             <?php
    45         }
    46         echo '<form id="lava-settings-form" class="settings-wrap" method="post">';
     20        $this->doSettings( $settings );
     21    }
    4722
    48         $this->runActions( "settingsHiddenInputs" );
     23    function doSettings( $settings )
     24    {
     25        $settings = apply_filters( $this->_slug( $this->who . "settingsOrder" ), $settings );
     26        $hiddenForms = $this->runFilters( "hiddenForms", array() );
     27        foreach( $hiddenForms as $form )
     28        {
     29            ?>
     30            <form id="<?php echo $form['id'] ?>" class="invisible" method="post">
     31                <?php foreach( $form['fields'] as $name => $value ): ?>
     32                    <input class="lava-<?php echo $name ?>" type="hidden" name="<?php echo $name ?>" value="<?php echo $value ?>" />
     33                <?php endforeach; ?>
     34                <?php
     35                     wp_nonce_field();
     36                    foreach( $form['capabilities'] as $capability => $name):
     37                    if( current_user_can( $capability ) )
     38                    {
     39                        $action = $this->_slug( $name );
     40                        wp_nonce_field( $action, $name, false );
     41                    }
     42                endforeach; ?>
     43            </form>
     44            <?php
     45        }
     46        echo '<form id="lava-settings-form" class="settings-wrap" method="post">';
    4947
    50         $this->runActions( "settingsPre" );
     48        $this->runActions( "settingsHiddenInputs" );
    5149
    52         foreach( $settings as $setting )
    53         {
    54             //action hook
    55             echo $setting->doSetting();
    56             //action hook
    57         }
    58         ?>
    59         <div class="lava-action-tray" style="margin-left:30px; margin-top:20px;">
    60             <input type="submit" class="lava-btn js-fallback" name="action" value="<?php _e( "Save Settings", $this->_framework() ) ?>" />
    61         </div>
    62         <?php
    63         echo '</form>';
    64     }
     50        $this->runActions( "settingsPre" );
    6551
    66     function saveSettings()
    67     {
    68         if( !isset( $_REQUEST['setting-nonce'] ) )
    69         {//nothing being submitted
    70             return;
    71         }
    72         if( $_REQUEST['purpose'] != "save" )
    73         {
    74             //not saving
    75             return;
    76         }
    77         $referrer = wp_referer_field( false );
    78         $messageNonce = rand( 1000, 9999);
    79         $redirect = add_query_arg( "message_nonce", $messageNonce );
     52        foreach( $settings as $setting )
     53        {
     54            //action hook
     55            echo $setting->doSetting();
     56            //action hook
     57        }
     58        ?>
     59        <div class="lava-action-tray" style="margin-left:30px; margin-top:20px;">
     60            <input type="submit" class="lava-btn js-fallback" name="action" value="<?php _e( "Save Settings", $this->_framework() ) ?>" />
     61        </div>
     62        <?php
     63        echo '</form>';
     64    }
    8065
    81         if( is_network_admin() and !current_user_can( "manage_network_options") )
    82         {
    83             //Queue access denied message
    84            
    85         }
    86         else if( is_admin() and !current_user_can( "manage_options") )
    87         {
    88             //Queue access denied message
    89            
    90         }
    91         else
    92         {//user is authorized to do something
    93             $redirect = add_query_arg( "action_done", "saved", $redirect );
    94             if( is_network_admin() )
    95             {
    96                 //do network save
    97             }
    98             elseif( is_admin() )
    99             {
    100                 $theSettings = $_POST[ $this->_slug() ];
    101                 foreach( $theSettings as $setting => $value )
    102                 {
    103                     $value = stripslashes( $value );
    104                     $settingArray = explode( "/", $setting );
    105                     if( $this->_settings()->settingExists( $settingArray[1], $settingArray[0] ) ):
    106                         $this->_settings()
    107                             ->fetchSetting( $settingArray[1], $settingArray[0] )
    108                                 ->updateValue( $value, true, true )
    109                     ;
    110                     endif;
    111                 }
    112                 $this->_settings()->updateCache();
    113             }
    114        
    115         }
    116         wp_redirect( $redirect );
    117         exit;
    118     }
     66    function saveSettings()
     67    {
     68        if( !isset( $_REQUEST['setting-nonce'] ) )
     69        {//nothing being submitted
     70            return;
     71        }
     72        if( $_REQUEST['purpose'] != "save" )
     73        {
     74            //not saving
     75            return;
     76        }
     77        $referrer = wp_referer_field( false );
     78        $messageNonce = rand( 1000, 9999);
     79        $redirect = add_query_arg( "message_nonce", $messageNonce );
    11980
    120     function resetSettings()
    121     {
    122         if( !isset( $_REQUEST['setting-nonce'] ) )
    123         {//nothing being submitted
    124             return;
    125         }
    126         if( $_REQUEST['purpose'] != "reset" )
    127         {
    128             //not resetting
    129             return;
    130         }
    131         $referrer = wp_referer_field( false );
    132         $messageNonce = rand( 1000, 9999);
    133         $redirect = add_query_arg( "message_nonce", $messageNonce );
    134         $redirect = add_query_arg( "action_done", "reset", $redirect );
     81        if( is_network_admin() and !current_user_can( "manage_network_options") )
     82        {
     83            //Queue access denied message
    13584
    136         if( is_network_admin() and !current_user_can( "manage_network_options") )
    137         {
    138             //Queue access denied message
    139            
    140         }
    141         else if( is_admin() and !current_user_can( "manage_options") )
    142         {
    143             //Queue access denied message
    144            
    145         }
    146         else
    147         {//user is authorized to do something
     85        }
     86        else if( is_admin() and !current_user_can( "manage_options") )
     87        {
     88            //Queue access denied message
    14889
    149             if( is_network_admin() )
    150             {
    151                 //do network reset
    152             }
    153             elseif( is_admin() )
    154             {
    155                 $resetScope = $_REQUEST[ 'reset-scope' ];
     90        }
     91        else
     92        {//user is authorized to do something
     93            $redirect = add_query_arg( "action_done", "saved", $redirect );
     94            if( is_network_admin() )
     95            {
     96                //do network save
     97            }
     98            elseif( is_admin() )
     99            {
     100                $theSettings = $_POST[ $this->_slug() ];
     101                echo( rand() );
     102                foreach( $theSettings as $setting => $value )
     103                {
     104                    //$value = html_entity_decode( $value );
     105                    //echo "\n $setting : $value";
     106                    $value = stripslashes( $value );
     107                    $settingArray = explode( "/", $setting );
     108                    if( $this->_settings()->settingExists( $settingArray[1], $settingArray[0] ) ):
     109                        $this->_settings()
     110                            ->fetchSetting( $settingArray[1], $settingArray[0] )
     111                                ->updateValue( $value, true, true )
     112                    ;
     113                    else:
     114                        die('setting doesn\'t exist');
     115                    endif;
     116                }
     117                //exit;
     118                $this->_settings()->updateCache();
     119            }
    156120
    157                 switch( $resetScope )
    158                 {
    159                     case "total":
    160                         //delete everything and run the plugin activated hook
    161                         delete_option( $this->_slug( "settings" ) );
    162                         delete_option( $this->_slug( "config" ) );
    163                         delete_option( $this->_slug( "messages" ) );
    164                         delete_option( $this->_slug( "skins" ) );
    165                 }
    166             }
    167        
    168         }
    169         wp_redirect( $redirect );
    170         exit;
    171     }
     121        }
     122        wp_redirect( $redirect );
     123        exit;
     124    }
     125
     126    function resetSettings()
     127    {
     128        if( !isset( $_REQUEST['setting-nonce'] ) )
     129        {//nothing being submitted
     130            return;
     131        }
     132        if( $_REQUEST['purpose'] != "reset" )
     133        {
     134            //not resetting
     135            return;
     136        }
     137        $referrer = wp_referer_field( false );
     138        $messageNonce = rand( 1000, 9999);
     139        $redirect = add_query_arg( "message_nonce", $messageNonce );
     140        $redirect = add_query_arg( "action_done", "reset", $redirect );
     141
     142        if( is_network_admin() and !current_user_can( "manage_network_options") )
     143        {
     144            //Queue access denied message
     145
     146        }
     147        else if( is_admin() and !current_user_can( "manage_options") )
     148        {
     149            //Queue access denied message
     150
     151        }
     152        else
     153        {//user is authorized to do something
     154
     155            if( is_network_admin() )
     156            {
     157                //do network reset
     158            }
     159            elseif( is_admin() )
     160            {
     161                $resetScope = $_REQUEST[ 'reset-scope' ];
     162
     163                switch( $resetScope )
     164                {
     165                    case "total":
     166                        //delete everything and run the plugin activated hook
     167                        delete_option( $this->_slug( "settings" ) );
     168                        delete_option( $this->_slug( "config" ) );
     169                        delete_option( $this->_slug( "messages" ) );
     170                        delete_option( $this->_slug( "skins" ) );
     171                }
     172            }
     173
     174        }
     175        wp_redirect( $redirect );
     176        exit;
     177    }
    172178
    173179    function toolbarButtons()
  • password-protect-wordpress/trunk/plugin.php

    r531662 r534710  
    44Plugin URI: http://www.volcanicpixels.com/password-protect-wordpress-plugin/
    55Description: Private Blog is a wordpress plugin which allows you to password protect all of your wordpress blog including all posts and feeds with a single password.
    6 Version: 4.02
     6Version: 4.03
    77Author: Daniel Chatfield
    88Author URI: http://www.volcanicpixels.com
     
    1515
    1616$pluginName = "Private Blog";
    17 $pluginVersion = "4.02";
     17$pluginVersion = "4.03";
    1818
    1919$thePlugin = lava::newPlugin( __FILE__, $pluginName, $pluginVersion );
  • password-protect-wordpress/trunk/readme.txt

    r531662 r534710  
    55Requires at least: 3.3.1
    66Tested up to: 3.3.1
    7 Stable tag: 4.02
     7Stable tag: 4.03
    88
    99This plugin password protects your wordpress blog with a single password.
     
    132132* Fixed issue with header buffer being flushed by All In One SEO pack when theme uses weird get_header call (I mean WTF was that theme designer doing)
    133133* Turned error reporting off
     134
     135= 4.03 =
     136
     137* Fixed an issue with some of the admin side javascript and IE
     138* Fixed an issue where if an HTML link was entered as the message for a skin the href attribute would be incorrectly urlized
     139* Changed encoding of settings to UTF-8 to non ASCII characters that are not covered by the HTML spec (Russian characters for example)
Note: See TracChangeset for help on using the changeset viewer.