Changeset 210743
- Timestamp:
- 02/26/2010 11:55:11 PM (16 years ago)
- Location:
- file-proxy/trunk
- Files:
-
- 4 edited
-
com/twothirdsdesign/core/gcp_options.php (modified) (4 diffs)
-
com/twothirdsdesign/file-proxy/ttd_file_proxy.php (modified) (3 diffs)
-
init.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
file-proxy/trunk/com/twothirdsdesign/core/gcp_options.php
r210557 r210743 4 4 * 5 5 * @author Geraint Palmer 6 * @version 1.0. 06 * @version 1.0.1 7 7 */ 8 8 class GcpOptions 9 9 { 10 const VERSION = '1.0. 0';10 const VERSION = '1.0.1'; 11 11 protected $options_key = 'ttd_plugin_options'; 12 12 protected $_options = array( … … 26 26 { 27 27 // tries to create a cache from wordpress DB options table.// uses plugin preset options not in db 28 $this->_optioncache = get_option( $this->options_key );28 $this->_optioncache = get_option( $this->options_key ); 29 29 if (!$this->_optioncache) $this->_optioncache = $this->_options; 30 30 } … … 50 50 public function delete_option($option) 51 51 { 52 $this->_populate_option -cache();52 $this->_populate_option_cache(); 53 53 unset($this->_optioncache[$option]); 54 update_option( $this->options_key, $this->_optioncache);54 update_option( $this->options_key, serialize($this->_optioncache) ); 55 55 } 56 56 … … 62 62 $this->_populate_option_cache(); 63 63 $this->_optioncache[$option] = $value; 64 update_option( $this->options_key, $this->_optioncache);64 update_option( $this->options_key, serialize($this->_optioncache) ); 65 65 } 66 66 -
file-proxy/trunk/com/twothirdsdesign/file-proxy/ttd_file_proxy.php
r210651 r210743 16 16 17 17 protected $_options = array( 18 'key-length' => 7, 19 'uninstall' => true, 20 'url-key' => 'file', 18 'key-length' => 7, 19 'uninstall' => true, 20 'url-key' => 'file', 21 'cache' => 'off', 21 22 ); 22 23 … … 109 110 110 111 $this->update_option("version", TTDPF_VERSION ); 112 111 113 if( defined('WP_CONTENT_DIR') ){ 112 if(!is_dir( WP_CONTENT_DIR.DS.'cache' ) ){114 if(!is_dir( WP_CONTENT_DIR.DS.'cache' ) && is_writable( WP_CONTENT_DIR )){ 113 115 mkdir( WP_CONTENT_DIR.DS.'cache' ); 114 116 } 115 if(!is_dir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain ) ){117 if(!is_dir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain ) && is_writable( WP_CONTENT_DIR.DS.'cache' )){ 116 118 mkdir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain ); 117 119 } 118 120 if(!is_dir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain )){ 119 exit ("cache dir failure"); 120 } 121 } 122 else 123 mkdir( TTDFP_DIR.DS.'cache' ); 121 $this->update_option('cache', 'disabled'); 122 } 123 } 124 else if(!is_dir( TTDFP_DIR.DS.'cache') && is_writable( TTDFP_DIR )) 125 { 126 mkdir( TTDFP_DIR.DS.'cache' ); 127 if(is_dir( TTDFP_DIR.DS.'cache') && is_writable( TTDFP_DIR )){ 128 $this->update_option('cache', 'off'); 129 } 130 }else{ 131 $this->update_option('cache', 'disabled'); 132 } 124 133 } 125 134 … … 136 145 delete_option($this->options_key); 137 146 138 if( is_dir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain ) )147 if( is_dir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain ) && is_writable( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain ) ) 139 148 $this->rmdirr(WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain ); 140 if( is_dir( TTDFP_DIR.DS.'cache' ) )149 if( is_dir( TTDFP_DIR.DS.'cache' ) && is_writable( TTDFP_DIR.DS. $this->plugin_domain ) ) 141 150 $this->rmdirr( TTDFP_DIR.DS.'cache' ); 142 151 } -
file-proxy/trunk/init.php
r210651 r210743 2 2 /* 3 3 Plugin Name: File Proxy 4 Version: 0. 24 Version: 0.4 5 5 Description: File Proxy is a simple WordPress plug that lest you protect / restrict access to a specific embedded file. It lets you embed files from the upload directory into a post or page using a short code that restricts access to registered users. guest users who click on the link are prompted to login before returning the file.<code>[file-proxy id='attachment_id']link text[/file-proxy]</code>. 6 6 Author: Geraint Palmer … … 16 16 17 17 // Plugin Variables 18 define( 'TTD FP_VERSION', "0.2" );18 define( 'TTDPF_VERSION', "0.2" ); 19 19 20 20 // Define URL … … 27 27 // Another plugin / ttd plugin may have defined this!! 28 28 !defined('DS') ? define( 'DS', DIRECTORY_SEPARATOR ) : NULL; 29 30 if ( DS != DIRECTORY_SEPARATOR ) { 31 exit('Constant conflict: the constant DS is defined and not equal to the DIRECTORY_SEPARATOR'); 32 } 29 33 30 34 define( 'TTDFP_LIB' , TTDFP_DIR.DS.'com'.DS.'twothirdsdesign' ); -
file-proxy/trunk/readme.txt
r210653 r210743 5 5 Requires at least: 2.9.x 6 6 Tested up to: 2.9.2 7 Stable tag: 0. 37 Stable tag: 0.4 8 8 9 9 File Proxy is a simple WordPress plug that lest you protect / restrict access to a specific embedded file. … … 36 36 37 37 == Changelog == 38 = 0.4 = 39 minor bug fix 38 40 39 41 = 0.3 = 40 Corrects Default link text, to file name. 42 Uses filename when link text is not specified. i.e. `[file-proxy id='attachment_id']` 41 43 42 44 = 0.2 = 43 45 Adds some Variable sanitation 44 46 45 = 0.1 =46 First Release47 48 47 == Upgrade Notice == 48 = 0.4 = 49 minor bug fix 49 50 = 0.3 = 50 Corrects Default link text, to link file name. 51 51 Default link text replaced by filename. 52 52 = 0.2 = 53 53 Adds some Variable sanitation, and sql prep to harden plugin security 54 55 = 0.1 =56 First Release
Note: See TracChangeset
for help on using the changeset viewer.