Changeset 1097331
- Timestamp:
- 02/23/2015 04:07:29 PM (11 years ago)
- Location:
- file-proxy/trunk
- Files:
-
- 9 edited
-
com/twothirdsdesign/core/data_model.php (modified) (1 diff)
-
com/twothirdsdesign/core/gcp_options.php (modified) (1 diff)
-
com/twothirdsdesign/core/ttd_plugin_admin_class.php (modified) (1 diff)
-
com/twothirdsdesign/core/ttd_plugin_class.php (modified) (1 diff)
-
com/twothirdsdesign/file-proxy/admin/admin.php (modified) (1 diff)
-
com/twothirdsdesign/file-proxy/ttd_file_proxy.php (modified) (6 diffs)
-
index.php (modified) (1 diff)
-
init.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
file-proxy/trunk/com/twothirdsdesign/core/data_model.php
r210557 r1097331 1 <?php 2 /** 1 <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 2 /** 3 3 * Pretend this is a file 4 4 * -
file-proxy/trunk/com/twothirdsdesign/core/gcp_options.php
r1097328 r1097331 1 <?php 1 <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 2 2 /** 3 3 * Options Manager Class -
file-proxy/trunk/com/twothirdsdesign/core/ttd_plugin_admin_class.php
r221247 r1097331 1 <?php 1 <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 2 2 /** 3 3 * TtdPluginClass -
file-proxy/trunk/com/twothirdsdesign/core/ttd_plugin_class.php
r216667 r1097331 1 <?php 1 <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 2 2 /** 3 3 * TtdPluginClass -
file-proxy/trunk/com/twothirdsdesign/file-proxy/admin/admin.php
r221247 r1097331 1 <?php 1 <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 2 2 require_once( TTDFP_CORE.DS.'ttd_plugin_admin_class.php' ); 3 3 /** -
file-proxy/trunk/com/twothirdsdesign/file-proxy/ttd_file_proxy.php
r1097328 r1097331 1 <?php 1 <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 2 2 /** 3 3 * Ttd File Proxy - Plugin Class File … … 7 7 */ 8 8 9 class T tdFileProxy extends TtdPluginClass9 class TTDFileProxy extends TtdPluginClass 10 10 { 11 11 protected $plugin_domain = 'TtdFileProxy'; … … 25 25 'redirect-target' => 'file', 26 26 ); 27 28 // pages where our plugin needs translation 29 protected $local_pages = array('plugins.php'); 27 30 28 31 function __construct() 29 32 { 30 33 parent::__construct(); 31 32 // pages where our plugin needs translation33 $local_pages = array('plugins.php');34 34 35 35 // init options manager 36 36 $this->options = new GcpOptions($this->options_key, $this->_options); 37 38 // load localisation 39 // $screen = get_current_screen(); 40 41 // if( in_array( $screen, $local_pages ) ) 42 // $this->handle_load_domain(); 43 44 // Add admin menu interface 37 38 // Add admin interfaces 45 39 $this->admin(); 46 40 47 //add_action('template_redirect', array( &$this,'uri_detect'));41 //add_action('template_redirect', array($this,'uri_detect')); 48 42 49 43 // add activation hooks 50 44 register_activation_hook ( TTDFP_PLUGIN_FILE , array($this, 'activate' )); 51 45 register_deactivation_hook ( TTDFP_PLUGIN_FILE , array($this, 'deactivate')); 52 register_uninstall_hook ( TTDFP_PLUGIN_FILE , array("TtdFileProxy", 'uninstall'));46 register_uninstall_hook ( TTDFP_PLUGIN_FILE , "TTDFileProxy::uninstall" ); 53 47 54 48 // shortcodes 55 49 add_shortcode('file-proxy', array($this, 'return_proxy_link')); 56 add_shortcode('ttdfp-url', array($this, 'return_proxy_url'));50 //add_shortcode('ttdfp-url', array($this, 'return_proxy_url')); 57 51 58 52 // adds proxy rewrite rule & query_var 53 add_filter('query_vars', array($this, 'query_vars')); 59 54 //add_filter('generate_rewrite_rules', array(&$this,'add_rewrite_rules')); 60 add_filter('query_vars', array($this, 'query_vars'));61 55 //add_filter('wp_redirect', array(&$this, 'test'), 0, 2); 62 56 … … 65 59 66 60 } 67 68 69 /* function test($location, $status){ 70 echo $status . " - " . $location; 71 } */ 72 73 function admin(){ 74 if( is_admin() ){ 61 62 /** 63 * Loads the Options Panel in the dashboard if required. 64 * 65 * @return void 66 * @author Geraint Palmer 67 * @since 0.6 68 **/ 69 function admin() 70 { 71 if( is_admin() ) 72 { 73 // load localisation 74 global $pagenow; 75 76 if( in_array( $pagenow, $this->local_pages ) ) 77 $this->handle_load_domain(); 78 79 // load Menus & Controller 75 80 require_once( TTDFP_ADMIN.DS.'admin.php' ); 76 81 $ttd_file_proxy_admin = new TtdFileProxyAdmin( $this ); … … 232 237 global $wp_query, $wp_rewrite; 233 238 $this->flush_rules(); 234 $id = isset( $_GET['file'] ) ? absint( $_GET['file'] ) : null; //$this->get_option('url-key') ]; 235 236 echo $id; 237 238 //print_r($_GET['file']); 239 $id = isset( $_GET['file'] ) ? intval( $_GET['file'] ) : null; 240 239 241 if ( isset( $id )) { 240 echo '<pre>';print_r($wp_rewrite->wp_rewrite_rules() ); echo '</pre>'; 241 242 242 243 // Sanatize url var. 243 $id = intval( $id ); 244 if( $id <= 0 ){ return; } 245 246 if(!is_user_logged_in()){ 247 244 if( $id < 0 ){ return; } 245 246 if(!is_user_logged_in()) 247 { 248 248 wp_redirect( $this->get_option('login-url') ); 249 249 auth_redirect(); … … 251 251 } 252 252 253 //$this->return_file( $id );253 $this->return_file( $id ); 254 254 exit; 255 255 } -
file-proxy/trunk/index.php
r1097022 r1097331 1 <?php exit("File Not Found") ?>1 <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); -
file-proxy/trunk/init.php
r1097328 r1097331 1 <?php 1 <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 2 2 /* 3 3 Plugin Name: File Proxy … … 61 61 { 62 62 // Create Plugin Instance 63 $ttd_file_proxy = new T tdFileProxy();63 $ttd_file_proxy = new TTDFileProxy(); 64 64 } 65 65 ?> -
file-proxy/trunk/readme.txt
r1097328 r1097331 79 79 * This version requires WordPress 4.1 or later 80 80 * Update Compatibility with WordPress 4.1 81 * Plugin Reboot. 82 * Moved to http://github.com/geraintp/file-proxy 81 83 82 84 = 0.5 =
Note: See TracChangeset
for help on using the changeset viewer.