Changeset 534709
- Timestamp:
- 04/22/2012 02:41:06 PM (14 years ago)
- Location:
- password-protect-wordpress-blog
- Files:
-
- 4 deleted
- 8 edited
-
readme.txt (deleted)
-
screenshot-1.png (deleted)
-
screenshot-2.png (deleted)
-
screenshot-3.png (deleted)
-
trunk/_static/vendor.js (modified) (1 diff)
-
trunk/lava/_cache (modified) (1 prop)
-
trunk/lava/_classes/h2o/filters.php (modified) (3 diffs)
-
trunk/lava/_classes/lavaMiscFunctions.php (modified) (1 diff)
-
trunk/lava/_classes/lavaSetting.php (modified) (3 diffs)
-
trunk/lava/_classes/lavaSettingsPage.php (modified) (1 diff)
-
trunk/plugin.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
password-protect-wordpress-blog/trunk/_static/vendor.js
r527810 r534709 229 229 function doApiRequest( method, args ) { 230 230 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-blog/trunk/lava/_cache
-
Property
svn:ignore
set to
h2o_3ec3df5015b3ebbedbfb9d2df78cdb64
h2o_a70eb7bb5cb35ce3fd3a660dcdc96d40
-
Property
svn:ignore
set to
-
password-protect-wordpress-blog/trunk/lava/_classes/h2o/filters.php
r527802 r534709 47 47 48 48 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*)?/"; 50 50 preg_match_all($reg_exUrl, $string, $matches); 51 51 $usedPatterns = array(); … … 53 53 if(!array_key_exists($pattern, $usedPatterns)){ 54 54 $usedPatterns[$pattern]=true; 55 if( substr( $pattern, 0, 1 ) == " " ) { 56 $pattern = substr( $pattern, 1 ); 57 } 55 58 $string = str_replace($pattern, "<a href=\"{$pattern}\" rel=\"nofollow\">{$pattern}</a>", $string); 56 59 } … … 364 367 } 365 368 366 /* U ltizie php funciton as Filters */369 /* Utilize php funciton as Filters */ 367 370 h2o::addFilter(array('md5', 'sha1', 'numberformat'=>'number_format', 'wordwrap', 'trim', 'upper' => 'strtoupper', 'lower' => 'strtolower')); 368 371 -
password-protect-wordpress-blog/trunk/lava/_classes/lavaMiscFunctions.php
r531339 r534709 76 76 'browser' => 'unknown' 77 77 ); 78 if( strpos( $ua, "i pad" ) ) {78 if( strpos( $ua, "iPad" ) ) { 79 79 $info['device'] = "iPad"; 80 80 $info['os'] = 'ios'; -
password-protect-wordpress-blog/trunk/lava/_classes/lavaSetting.php
r527802 r534709 383 383 { 384 384 385 $value = htmlentities($value, ENT_QUOTES); 385 //$value = htmlentities($value, ENT_QUOTES); 386 $value = utf8_encode( $value ); 386 387 $cache = $this->getCache(); 387 388 … … 407 408 $settingInputID = "{$pluginSlug}-{$settingWho}-{$settingKey}"; 408 409 $settingOptions = $this->getProperty( "setting-options" ); 409 $settingValue = $this->getValue( true );410 $settingValue = $this->getValue( false ); 410 411 411 412 return array( … … 440 441 if( $format == false) 441 442 { 442 $value = html_entity_decode( $value ); 443 //$value = html_entity_decode( $value ); 444 $value = utf8_decode($value); 443 445 return $value; 444 446 } -
password-protect-wordpress-blog/trunk/lava/_classes/lavaSettingsPage.php
r527802 r534709 2 2 class lavaSettingsPage extends lavaPage 3 3 { 4 public $multisiteSupport = true;5 public $who = "settings";4 public $multisiteSupport = true; 5 public $who = "settings"; 6 6 7 function loadPage()8 {9 $this->saveSettings();10 $this->resetSettings();11 $this->addAction( "toolbarButtons" );12 //queue notifications13 //do redirect14 }7 function loadPage() 8 { 9 $this->saveSettings(); 10 $this->resetSettings(); 11 $this->addAction( "toolbarButtons" ); 12 //queue notifications 13 //do redirect 14 } 15 15 16 function displayPage()17 {18 $settings = $this->_settings()->fetchSettings( $this->who );16 function displayPage() 17 { 18 $settings = $this->_settings()->fetchSettings( $this->who ); 19 19 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 } 47 22 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">'; 49 47 50 $this->runActions( "settingsPre" );48 $this->runActions( "settingsHiddenInputs" ); 51 49 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" ); 65 51 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 } 80 65 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 ); 119 80 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 135 84 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 148 89 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 } 156 120 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 } 172 178 173 179 function toolbarButtons() -
password-protect-wordpress-blog/trunk/plugin.php
r531663 r534709 4 4 Plugin URI: http://www.volcanicpixels.com/password-protect-wordpress-plugin/ 5 5 Description: 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.0 26 Version: 4.03 7 7 Author: Daniel Chatfield 8 8 Author URI: http://www.volcanicpixels.com … … 15 15 16 16 $pluginName = "Private Blog"; 17 $pluginVersion = "4.0 2";17 $pluginVersion = "4.03"; 18 18 19 19 $thePlugin = lava::newPlugin( __FILE__, $pluginName, $pluginVersion ); -
password-protect-wordpress-blog/trunk/readme.txt
r531663 r534709 5 5 Requires at least: 3.3.1 6 6 Tested up to: 3.3.1 7 Stable tag: 4.0 27 Stable tag: 4.03 8 8 9 9 This plugin password protects your wordpress blog with a single password. … … 132 132 * 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) 133 133 * 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.