Plugin Directory

Changeset 1072291


Ignore:
Timestamp:
01/21/2015 07:09:20 AM (11 years ago)
Author:
lynton_reed
Message:

Additional security features added. Fixes for IPhone browser "next" button problem.

Location:
work-the-flow-file-upload/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • work-the-flow-file-upload/trunk/README.txt

    r988003 r1072291  
    44Tags: file upload, upload, workflow, html5, image, gallery
    55Requires at least: 3.5.1
    6 Tested up to: 4.0
    7 Stable tag: 2.4.1
     6Tested up to: 4.1
     7Stable tag: 2.5.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    325325
    326326== Changelog ==
     327= 2.5.0 =
     328* Fix for IOS and Mac Safari browsers getting stuck on the same stage. (Special thanks to Marie for her detailed help in testing on many platforms).
     329* Note that Mac / Safari 5.x will not work, the minimum required version is 6.04.
     330* Additional security features added.
     331
    327332= 2.4.1 =
    328333* Fix for generated .htaccess file preventing image display on some servers.
     
    467472
    468473== Upgrade Notice ==
     474= 2.5.0 =
     475* Fix for IOS and Mac Safari browsers getting stuck on the same stage. (Special thanks to Marie for her detailed help in testing on many platforms).
     476* Note that Mac / Safari 5.x will not work, the minimum required version is 6.04.
     477* Additional security features added.
     478
    469479= 2.4.1 =
    470480* Fix for generated .htaccess file preventing image display on some servers.
  • work-the-flow-file-upload/trunk/admin/class-wtf-fu-admin.php

    r984253 r1072291  
    5252     */
    5353    private function __construct() {
     54       
     55        //log_me("admin constructor");
    5456
    5557        $plugin = Wtf_Fu::get_instance();
  • work-the-flow-file-upload/trunk/public/assets/js/wtf-fu-file-upload.js

    r907953 r1072291  
    1010    // Capture form data fields to pass on to ajax request as POST vars.
    1111    var WtfFuUploadFormData = $("#fileupload").serializeArray();
    12 
     12   
     13    // add in the nonce to the request data.
     14    WtfFuUploadFormData.push({name : "security", value : WtfFuAjaxVars.security});
     15   
     16    // console.log(WtfFuUploadFormData);
    1317    // Initialize the jQuery File Upload widget:
    1418    $('#fileupload').fileupload({
     
    2933 
    3034    $.ajax({
    31        url: WtfFuAjaxVars.url, // $('#fileupload').fileupload('option', 'url'),
    32        data: WtfFuUploadFormData, // serialized form fields,
     35       url: WtfFuAjaxVars.url,
     36       data: WtfFuUploadFormData,
    3337       dataType: 'json',
    3438       context: $('#fileupload')[0]
  • work-the-flow-file-upload/trunk/public/assets/js/wtf-fu-workflow.js

    r954842 r1072291  
    2020                if (item.querySelector('#accordion') !== null) {
    2121                    wtf_accordion_init();
    22                 }
    23                
     22                }               
    2423                //console.log(item);
    2524            }
     
    3332    observer.observe(target, config);
    3433
     34    var clicked_name;
     35    var clicked_value;
     36
     37    $(document).on('click' , '#workflow_submit_button',  function(event) {
     38            clicked_name = $(this).attr('name');
     39            clicked_value = $(this).val();
     40            console.log("clicked called");
     41    });
    3542
    3643    $(document).on('submit', '#wtf_workflow_form', function(event) {
    37 
    38         // The selected button that submitted the form.
    39         var btn = $(":input[type=submit]:focus");
    4044
    4145        $(":input[type='submit']").attr("disabled", true);
     
    4650            workflow_id: this.workflow_id.value,
    4751            stage: this.stage.value,
    48             button_name: btn.attr('name'),
    49             button_value: btn.val()
     52            button_name: clicked_name,
     53            button_value: clicked_value
    5054        };
    5155
  • work-the-flow-file-upload/trunk/public/class-wtf-fu.php

    r988003 r1072291  
    4444     * @var     string
    4545     */
    46     const VERSION = '2.4.1';
     46    const VERSION = '2.5.0';
    4747
    4848    /**
     
    6767    private function __construct() {
    6868
    69         //log_me('__construct  Wtf_Fu ');
     69        // log_me('__construct  Wtf_Fu ');
    7070        //log_me('memory=' . memory_get_usage(true) . "\n");
    7171        //log_me('peak memory=' . memory_get_peak_usage(true) . "\n");
     
    9595        // Short code hooks to methods which instantiate the required shortcode
    9696        // handler classes and return the handler output.
    97         add_shortcode('wtf_fu', array($this, 'wtf_fu_shortcode'));
     97        add_shortcode('wtf_fu', array($this, 'wtf_fu_shortcode'));                             
    9898        add_shortcode('wtf_fu_upload', array($this, 'file_upload_shortcode'));
    9999        add_shortcode('wtf_fu_show_files', array($this, 'show_files_shortcode'));
     
    437437                wp_enqueue_script($fileupload_handle);
    438438
    439                 $ret = wp_localize_script($fileupload_handle, 'WtfFuAjaxVars', array('url' => admin_url('admin-ajax.php'),
    440                     'absoluteurl' => wtf_fu_JQUERY_FILE_UPLOAD_URL . 'cors/result.html?%s'
     439                $ret = wp_localize_script($fileupload_handle, 'WtfFuAjaxVars',
     440                        array(
     441                            'url' => admin_url('admin-ajax.php'),
     442                            'absoluteurl' => wtf_fu_JQUERY_FILE_UPLOAD_URL . 'cors/result.html?%s',
     443                            'security' => wp_create_nonce('wtf_fu_upload_nonce')
    441444                ));
    442445
     
    464467
    465468    function file_upload_shortcode($attr) {
     469        // log_me("upload_shortcode hook fired");
    466470        $shortcode_instance = new Wtf_Fu_Fileupload_Shortcode($attr);
    467471        $content = $shortcode_instance->generate_content();
  • work-the-flow-file-upload/trunk/public/includes/class-wtf-fu-fileupload-shortcode.php

    r984253 r1072291  
    4242
    4343    public static function wtf_fu_load_ajax_function() {
     44       
     45//        log_me(array("ajax handler REQUEST:" => $_REQUEST));       
     46        check_ajax_referer( 'wtf_fu_upload_nonce', 'security' );
    4447       
    4548        ob_start();
     
    209212        $options['action'] = 'load_ajax_function';
    210213
     214       
    211215        //
    212216        // Put unmassaged options into POST vars for subsequent posts of
     
    217221            $form_vars = $form_vars . '<input type="hidden" name="' . $k . '" value="' . $v . '" />';
    218222        };
     223       
     224       
     225       
     226        // log_me(array("form created"=>$form_vars));
    219227
    220228        // The form action MUST be the wp admin hander which will then delegate
  • work-the-flow-file-upload/trunk/public/includes/class-wtf-fu-show-files-shortcode.php

    r954842 r1072291  
    6565                , $attr);
    6666
     67       
     68        /*
     69         * Get files for ALL users if so requested.
     70         */
     71//        if ($this->options['show_files_for_all_users'] === true) {
     72//            $globstr = '/[0-9]+/' . wp_upload_dir() . $this->options['wtf_upload_dir'];
     73//           
     74//            if (!empty($this->options['wtf_upload_subdir'])) {
     75//                $globstr .= "/{$this->options['wtf_upload_subdir']}";
     76//            }       
     77//            $filearray = glob( $globstr . '/*');
     78//        }
     79       
    6780        /*
    6881         * Current User upload directory paths.
     
    7083        $this->paths = wtf_fu_get_user_upload_paths($this->options['wtf_upload_dir'], $this->options['wtf_upload_subdir'], 0, $this->options['use_public_dir']);
    7184       
    72         log_me(array("showfiles paths="=>$this->paths));
    73         log_me("use_public_dir = {$this->options['use_public_dir']}");
     85        //log_me(array("showfiles paths="=>$this->paths));
     86        //log_me("use_public_dir = {$this->options['use_public_dir']}");
    7487
    7588        /*
  • work-the-flow-file-upload/trunk/work-the-flow-file-upload.php

    r988003 r1072291  
    55 * Plugin URI:        http://wtf-fu.com
    66 * Description:       Front end Html5 File Upload and configurable Workflow steps. Multiple file drag and drop, gallery image display, file reordering and archiving.
    7  * Version:           2.4.1
     7 * Version:           2.5.0
    88 * Author:            Lynton Reed
    99 * Author URI:        http://wtf-fu.com
     
    7777 * because of a front end AJAX call.
    7878 */
    79 //if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
    80 if ( is_admin() ) {
     79if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
     80//if ( is_admin() ) {
    8181    require_once( plugin_dir_path( __FILE__ ) . 'admin/class-wtf-fu-admin.php' );
    8282    add_action( 'plugins_loaded', array( 'Wtf_Fu_Admin', 'get_instance' ) ); 
Note: See TracChangeset for help on using the changeset viewer.