Changeset 213203
- Timestamp:
- 03/04/2010 10:07:49 PM (16 years ago)
- Location:
- private-wp-suite
- Files:
-
- 2 edited
- 4 copied
-
tags/0.2 (copied) (copied from private-wp-suite/trunk)
-
tags/0.2/private-wp-suite.php (copied) (copied from private-wp-suite/trunk/private-wp-suite.php) (5 diffs)
-
tags/0.2/readme.txt (copied) (copied from private-wp-suite/trunk/readme.txt) (2 diffs)
-
tags/0.2/screenshot-1.png (copied) (copied from private-wp-suite/trunk/screenshot-1.png)
-
trunk/private-wp-suite.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
private-wp-suite/tags/0.2/private-wp-suite.php
r213181 r213203 31 31 Plugin URI: http://poller.se/code/wordpress-plugins/ 32 32 Description: Adds option in the admin panel for making your blog (including rss feeds and uploaded files) private. 33 Version: 0. 133 Version: 0.2 34 34 Author: Fredrik Poller 35 35 Author URI: http://poller.se/ … … 64 64 $plrpws_upload_path = 'wp-content/uploads'; 65 65 66 $plrpws_htaccess_file = $plrpws_upload_path . '/.htaccess'; 67 66 68 // Stolen from wp-includes/vars.php, used to give correct notices to the user below 67 69 $is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false); … … 69 71 // If upload protection is enabled, check that .htaccess file is in place. If it isn't, try to create it. If it can't be created, warn the user. 70 72 if($plrpws_protect_uploads) { 71 $plrpws_htaccess_file = $plrpws_upload_path . '/.htaccess';72 73 $plrpws_htaccess_content = "# Start Private WP suite rewrite rules\nRewriteEngine On\nRewriteBase $plrpws_wp_path/$plrpws_upload_path/\nRewriteRule . $plrpws_wp_path/nonexsistent_file_to_trigger_404_error\nOptions -Indexes\n# End Private WP suite rewrite rules\n"; 73 74 if(file_exists(ABSPATH . $plrpws_htaccess_file)) { … … 90 91 } 91 92 } 93 } else { 94 // Upload protection disabled, we should remove the .htaccess file if it exists 95 if(file_exists(ABSPATH . $plrpws_htaccess_file)) 96 @unlink(ABSPATH . $plrpws_htaccess_file); 92 97 } 93 98 … … 215 220 // Hook into the 404 page 216 221 add_filter('404_template', 'plrpws_protect_uploads'); 222 223 // Function to run when deactivating plugin 224 function plrpws_deactivate() { 225 // Remove .htaccess if it exists 226 $plrpws_upload_path = get_option('upload_path'); 227 if(!$plrpws_upload_path) 228 $plrpws_upload_path = 'wp-content/uploads'; 229 230 $plrpws_htaccess_file = $plrpws_upload_path . '/.htaccess'; 231 232 if(file_exists(ABSPATH . $plrpws_htaccess_file)) 233 @unlink(ABSPATH . $plrpws_htaccess_file); 234 235 // Delete old options 236 delete_option('plrpws_protect_blog'); 237 delete_option('plrpws_protect_feeds'); 238 delete_option('plrpws_protect_uploads'); 239 delete_option('plrpws_exceptions'); 240 } 241 242 // Register deactivation function 243 register_deactivation_hook(__FILE__, 'plrpws_deactivate'); 217 244 218 245 // Function to check if visitor is excempt, used in other functions -
private-wp-suite/tags/0.2/readme.txt
r213181 r213203 4 4 Requires at least: 2.9 5 5 Tested up to: 2.9.2 6 Stable tag: 0. 16 Stable tag: 0.2 7 7 8 8 Adds option in the admin panel for making your blog (including rss feeds and uploaded files) private. … … 29 29 == Changelog == 30 30 31 = 0.2 = 32 * Added deactivation function 33 31 34 = 0.1 = 32 35 * Initial release -
private-wp-suite/trunk/private-wp-suite.php
r213181 r213203 31 31 Plugin URI: http://poller.se/code/wordpress-plugins/ 32 32 Description: Adds option in the admin panel for making your blog (including rss feeds and uploaded files) private. 33 Version: 0. 133 Version: 0.2 34 34 Author: Fredrik Poller 35 35 Author URI: http://poller.se/ … … 64 64 $plrpws_upload_path = 'wp-content/uploads'; 65 65 66 $plrpws_htaccess_file = $plrpws_upload_path . '/.htaccess'; 67 66 68 // Stolen from wp-includes/vars.php, used to give correct notices to the user below 67 69 $is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false); … … 69 71 // If upload protection is enabled, check that .htaccess file is in place. If it isn't, try to create it. If it can't be created, warn the user. 70 72 if($plrpws_protect_uploads) { 71 $plrpws_htaccess_file = $plrpws_upload_path . '/.htaccess';72 73 $plrpws_htaccess_content = "# Start Private WP suite rewrite rules\nRewriteEngine On\nRewriteBase $plrpws_wp_path/$plrpws_upload_path/\nRewriteRule . $plrpws_wp_path/nonexsistent_file_to_trigger_404_error\nOptions -Indexes\n# End Private WP suite rewrite rules\n"; 73 74 if(file_exists(ABSPATH . $plrpws_htaccess_file)) { … … 90 91 } 91 92 } 93 } else { 94 // Upload protection disabled, we should remove the .htaccess file if it exists 95 if(file_exists(ABSPATH . $plrpws_htaccess_file)) 96 @unlink(ABSPATH . $plrpws_htaccess_file); 92 97 } 93 98 … … 215 220 // Hook into the 404 page 216 221 add_filter('404_template', 'plrpws_protect_uploads'); 222 223 // Function to run when deactivating plugin 224 function plrpws_deactivate() { 225 // Remove .htaccess if it exists 226 $plrpws_upload_path = get_option('upload_path'); 227 if(!$plrpws_upload_path) 228 $plrpws_upload_path = 'wp-content/uploads'; 229 230 $plrpws_htaccess_file = $plrpws_upload_path . '/.htaccess'; 231 232 if(file_exists(ABSPATH . $plrpws_htaccess_file)) 233 @unlink(ABSPATH . $plrpws_htaccess_file); 234 235 // Delete old options 236 delete_option('plrpws_protect_blog'); 237 delete_option('plrpws_protect_feeds'); 238 delete_option('plrpws_protect_uploads'); 239 delete_option('plrpws_exceptions'); 240 } 241 242 // Register deactivation function 243 register_deactivation_hook(__FILE__, 'plrpws_deactivate'); 217 244 218 245 // Function to check if visitor is excempt, used in other functions -
private-wp-suite/trunk/readme.txt
r213181 r213203 4 4 Requires at least: 2.9 5 5 Tested up to: 2.9.2 6 Stable tag: 0. 16 Stable tag: 0.2 7 7 8 8 Adds option in the admin panel for making your blog (including rss feeds and uploaded files) private. … … 29 29 == Changelog == 30 30 31 = 0.2 = 32 * Added deactivation function 33 31 34 = 0.1 = 32 35 * Initial release
Note: See TracChangeset
for help on using the changeset viewer.