Plugin Directory

Changeset 210743


Ignore:
Timestamp:
02/26/2010 11:55:11 PM (16 years ago)
Author:
geraint
Message:
 
Location:
file-proxy/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • file-proxy/trunk/com/twothirdsdesign/core/gcp_options.php

    r210557 r210743  
    44 *
    55 * @author      Geraint Palmer
    6  * @version     1.0.0     
     6 * @version     1.0.1     
    77 */
    88class GcpOptions
    99{
    10     const VERSION = '1.0.0';
     10    const VERSION = '1.0.1';
    1111    protected $options_key = 'ttd_plugin_options';
    1212    protected $_options = array(
     
    2626        {
    2727            // 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 );
    2929            if (!$this->_optioncache) $this->_optioncache = $this->_options;
    3030        }
     
    5050    public function delete_option($option)
    5151    {
    52         $this->_populate_option-cache();
     52        $this->_populate_option_cache();
    5353        unset($this->_optioncache[$option]);
    54         update_option( $this->options_key, $this->_optioncache);
     54        update_option( $this->options_key, serialize($this->_optioncache) );
    5555    }
    5656   
     
    6262        $this->_populate_option_cache();
    6363        $this->_optioncache[$option] = $value;
    64         update_option( $this->options_key, $this->_optioncache );
     64        update_option( $this->options_key, serialize($this->_optioncache) );
    6565    }
    6666   
  • file-proxy/trunk/com/twothirdsdesign/file-proxy/ttd_file_proxy.php

    r210651 r210743  
    1616
    1717    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',
    2122    );
    2223   
     
    109110       
    110111        $this->update_option("version", TTDPF_VERSION );
     112       
    111113        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 )){
    113115                mkdir( WP_CONTENT_DIR.DS.'cache' );
    114116            }
    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' )){ 
    116118                mkdir( WP_CONTENT_DIR.DS.'cache'.DS. $this->plugin_domain );
    117119            }
    118120            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        }
    124133    }
    125134       
     
    136145            delete_option($this->options_key);
    137146           
    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 ) )
    139148                $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 ) )
    141150                $this->rmdirr( TTDFP_DIR.DS.'cache' );
    142151        }
  • file-proxy/trunk/init.php

    r210651 r210743  
    22    /*
    33    Plugin Name: File Proxy
    4     Version: 0.2
     4    Version: 0.4
    55    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>.
    66    Author: Geraint Palmer
     
    1616
    1717    // Plugin Variables
    18     define( 'TTDFP_VERSION', "0.2" );
     18    define( 'TTDPF_VERSION', "0.2" );
    1919   
    2020    // Define URL
     
    2727    // Another plugin / ttd plugin may have defined this!!
    2828    !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    }
    2933   
    3034    define( 'TTDFP_LIB'     , TTDFP_DIR.DS.'com'.DS.'twothirdsdesign' );
  • file-proxy/trunk/readme.txt

    r210653 r210743  
    55Requires at least: 2.9.x
    66Tested up to: 2.9.2
    7 Stable tag: 0.3
     7Stable tag: 0.4
    88
    99File Proxy is a simple WordPress plug that lest you protect / restrict access to a specific embedded file.
     
    3636
    3737== Changelog ==
     38= 0.4 =
     39minor bug fix
    3840
    3941= 0.3 =
    40 Corrects Default link text, to file name.
     42Uses filename when link text is not specified. i.e. `[file-proxy id='attachment_id']`
    4143
    4244= 0.2 =
    4345Adds some Variable sanitation
    4446
    45 = 0.1 =
    46 First Release
    47 
    4847== Upgrade Notice ==
     48= 0.4 =
     49minor bug fix
    4950= 0.3 =
    50 Corrects Default link text, to link file name.
    51 
     51Default link text replaced by filename.
    5252= 0.2 =
    5353Adds 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.