• Resolved xonnext

    (@xonnext)


    Could you please add something like this in the sdm-download-request-handler.php. Add code between ‘// CGID start’ and ‘// CGID end’ and delete the code behind ‘// Delete’.

    Or something better that you can think of. Now with every update I have to manually change this file tot avoid your Oops page.

    See my page on https://cgid.nl/presentaties/ and press [Presentatie bekijken] to see how it ends me to my own designed Oops page.

    Thanks..!

    //Check download password (if applicable for this download)

    $post_object = get_post( $download_id ); // Get post object

    $post_pass = $post_object->post_password; // Get post password

    if ( ! empty( $post_pass ) ) {//This download item has a password. So validate the password.

    $pass_val = $_REQUEST[ ‘pass_text’ ];

    if ( empty( $pass_val ) ) {//No password was submitted with the downoad request.

    $dl_post_url = get_permalink( $download_id );

    // CGID start

    header(‘Location: /niet-gevonden’); // CGID
    exit; } // CGID

    // CGID end

    // Delete $error_msg = __( ‘Error! This download requires a password.’, ‘simple-download-monitor’ );

    // Delete $error_msg .= ‘<p>’;

    // Delete $error_msg .= ‘‘ . __( ‘Click here’, ‘simple-download-monitor’ ) . ‘‘;

    // Delete $error_msg .= __( ‘ and enter a valid password for this item’, ‘simple-download-monitor’ );

    // Delete $error_msg .= ‘</p>’;

    // Delete wp_die( $error_msg );

    // Delete }

    if ( $post_pass != $pass_val ) {

    //Incorrect password submitted.

    // CGID start

    header(‘Location: /niet-gevonden’); // CGID
    exit; // CGID

    // CGID end

    // Delete wp_die( __( ‘Error! Incorrect password. This download requires a valid password.’, ‘simple-download-monitor’ ) );

    } else {

    //Password is valid. Go ahead with the download

    }

    }

    //End of password check

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, thank you for reaching out to us and sharing your code.

    The plugin developers will investigate further your code and your request.

    Kind regards

    Plugin Author mra13

    (@mra13)

    I will add two action hooks for password-protected downloads (when a download request is submitted without a password or incorrect password). You can then use those action hooks to do your redirection from your custom code. It will be available in the next release of the plugin.

    Thread Starter xonnext

    (@xonnext)

    Thank you for your reaction and solution..!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Oops… page’ is closed to new replies.