Skip to content

Commit

Permalink
update #38
Browse files Browse the repository at this point in the history
Enable error message...
But still didn't fix the problem which seems to be on local
installations only.
  • Loading branch information
creativecat committed Dec 19, 2012
1 parent c75f1d1 commit bd13c74
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 22 deletions.
22 changes: 5 additions & 17 deletions upload/backend/media/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* @license http://www.gnu.org/licenses/gpl.html
* @license_terms please see LICENSE and COPYING files in your package
*
*
*/

// include class.secure.php to protect this file and the whole CMS!
Expand Down Expand Up @@ -59,6 +58,10 @@
{
$admin->print_error( 'No directory was selected', false );
}
if ( !is_writeable($file_path) )
{
$admin->print_error( 'Directory is not writeable.', false );
}
$upload_counter = $admin->get_post('upload_counter');
$file_overwrite = $admin->get_post('overwrite');
// ============================================================================
Expand All @@ -83,22 +86,7 @@
// =======================================
// ! Try to include the upload.class.php
// =======================================
// =======================================
// ! Try to include the Zip-Helper.php
// =======================================
$helper_link = sanitize_path( LEPTON_PATH . '/framework/LEPTON/Helper/Upload.php' );
if ( file_exists( $helper_link ) )
{
require_once( $helper_link );
}
else {
$admin->print_error('The Upload helper was not found. Please check if "' . $helper_link . '" is installed.', false);
}

// ===============================
// ! Create the class for PclZip
// ===============================
$files = new LEPTON_Helper_Upload( $_FILES[$file_name] );
$files = $admin->get_helper('LEPTON_Helper_Upload', $_FILES[$file_name]);

if ( $files->uploaded )
{
Expand Down
2 changes: 1 addition & 1 deletion upload/framework/LEPTON/Helper/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ function LEPTON_Helper_Upload( $file )
{
$this->no_upload_check = TRUE;
// this is a local filename, i.e.not uploaded
$this->log .= '<b>' . $this->translate("source is a local file") . ' ' . $file . '</b><br />';
$this->log .= '<b>Source is a local file ' . $file . '</b><br />';

if ($this->uploaded && !file_exists($file))
{
Expand Down
4 changes: 2 additions & 2 deletions upload/templates/freshcat/js/backend_media.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,13 @@ jQuery(document).ready(function()

// Activate the upload form to send data with ajax
dialog_form(
$('#fc_media_index_upload'), function()
$('#fc_media_index_upload'), function( data )
{
var current_ul = get_active_media(),
folder_path = current_ul.find('input[name=folder_path]').val();

$('#fc_media_index_upload input[name=folder_path]').val( folder_path );
}, function()
}, function( data, textStatus, jqXHR )
{
var media_upload = $('#fc_media_index_upload'),
reload_ul = get_active_media();
Expand Down
5 changes: 4 additions & 1 deletion upload/templates/freshcat/js/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,15 @@ function dialog_form( currentForm, beforeSend, afterSend )
}
else {
// else return error
return_error( jqXHR.process , data.message);
return_error( jqXHR.process , $( data ).find('.fc_error_box > p').text());
}
},
error: function( jqXHR, textStatus, errorThrown )
{
jqXHR.process.remove();
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
alert(textStatus + ': ' + errorThrown );
}
});
Expand Down
2 changes: 1 addition & 1 deletion upload/templates/freshcat/templates/form_upload_files.lte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ul class="fc_br_bottom fc_br_topleft fc_gradient1 fc_shadow_small" id="fc_media_index_upload_ul">
<li>
<form name="upload" action="upload.php" method="post" enctype="multipart/form-data" id="fc_media_index_upload">
<form name="upload" action="{$ADMIN_URL}/media/upload.php" method="post" enctype="multipart/form-data" id="fc_media_index_upload">
<div class="clear">
<input type="hidden" name="form_title" value="{translate('Upload File(s)')}" />
<input type="hidden" name="folder_path" value="{$initial_folder}" />
Expand Down

0 comments on commit bd13c74

Please sign in to comment.