View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0004659 | mantisbt | feature | public | 2004-10-04 07:05 | 2004-11-06 06:25 |
| Reporter | sly | Assigned To | thraxisp | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 0.19.0 | ||||
| Fixed in Version | 0.19.1 | ||||
| Summary | 0004659: FTP unload don't work fine | ||||
| Description | I've found some bugs when set upload/download with FTP a) UID file name are't used in all FTP file functions. | ||||
| Additional Information | All bugs are fixed in attached mantis-0.19.0-qem-1.patch file | ||||
| Tags | No tags attached. | ||||
| Attached Files | mantis-0.19.0-qem-1.patch (3,787 bytes)
diff -u --recursive --new-file mantis-0.19.0/core/file_api.php mantis-0.19.0-qem-1/core/file_api.php
--- mantis-0.19.0/core/file_api.php 2004-08-31 15:11:50.000000000 +0200
+++ mantis-0.19.0-qem-1/core/file_api.php 2004-10-04 13:43:34.000000000 +0200
@@ -230,7 +230,7 @@
file_delete_local ( $row['diskfile'] );
if ( FTP == $t_method ) {
- file_ftp_delete ( $ftp, $row['filename'] );
+ file_ftp_delete ( $ftp, $row['diskfile'] );
}
}
@@ -273,7 +273,7 @@
file_delete_local ( $row['diskfile'] );
if ( FTP == $t_method ) {
- file_ftp_delete ( $ftp, $row['filename'] );
+ file_ftp_delete ( $ftp, $row['diskfile'] );
}
}
@@ -363,7 +363,7 @@
if ( FTP == $t_upload_method ) {
$ftp = file_ftp_connect();
- file_ftp_delete ( $ftp, $t_filename );
+ file_ftp_delete ( $ftp, $t_diskfile );
file_ftp_disconnect( $ftp );
}
diff -u --recursive --new-file mantis-0.19.0/file_download.php mantis-0.19.0-qem-1/file_download.php
--- mantis-0.19.0/file_download.php 2004-06-16 06:28:28.000000000 +0200
+++ mantis-0.19.0-qem-1/file_download.php 2004-10-04 13:43:58.000000000 +0200
@@ -88,7 +88,7 @@
readfile( $v_diskfile );
} else {
$ftp = file_ftp_connect();
- file_ftp_get ( $ftp, $v_diskfile, $v_filename );
+ file_ftp_get ( $ftp, $v_diskfile, $v_diskfile );
file_ftp_disconnect( $ftp );
readfile( $v_diskfile );
}
diff -u --recursive --new-file mantis-0.19.0/proj_doc_add.php mantis-0.19.0-qem-1/proj_doc_add.php
--- mantis-0.19.0/proj_doc_add.php 2004-08-31 15:11:50.000000000 +0200
+++ mantis-0.19.0-qem-1/proj_doc_add.php 2004-10-04 13:44:12.000000000 +0200
@@ -97,7 +97,7 @@
$query = "INSERT INTO $t_project_file_table
(project_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content)
VALUES
- ($t_project_id, '$c_title', '$c_description', '$t_disk_file_name', '$c_file_name', '$c_file_path', $c_file_size, '$c_file_type', " . db_now() .", '$c_content')";
+ ($t_project_id, '$c_title', '$c_description', '$c_disk_file_name', '$c_file_name', '$c_file_path', $c_file_size, '$c_file_type', " . db_now() .", '$c_content')";
$result = db_query( $query );
}
diff -u --recursive --new-file mantis-0.19.0/proj_doc_delete.php mantis-0.19.0-qem-1/proj_doc_delete.php
--- mantis-0.19.0/proj_doc_delete.php 2004-02-29 10:07:44.000000000 +0100
+++ mantis-0.19.0-qem-1/proj_doc_delete.php 2004-10-04 10:50:00.000000000 +0200
@@ -9,7 +9,12 @@
# $Id: proj_doc_delete.php,v 1.20 2004/02/29 09:07:45 vboctor Exp $
# --------------------------------------------------------
?>
-<?php require_once( 'core.php' ) ?>
+<?php
+ require_once( 'core.php' );
+
+ $t_core_path = config_get( 'core_path' );
+ require_once( $t_core_path . 'file_api.php' );
+?>
<?php
# Check if project documentation feature is enabled.
if ( OFF == config_get( 'enable_project_documentation' ) ) {
@@ -26,17 +31,22 @@
helper_ensure_confirmed( lang_get( 'confirm_file_delete_msg' ),
lang_get( 'file_delete_button' ) );
- if ( DISK == $g_file_upload_method ) {
+
+ if ( ( DISK == $g_file_upload_method ) || ( FTP == $g_file_upload_method ) ) {
# grab the file name
$query = "SELECT diskfile
FROM $g_mantis_project_file_table
WHERE id='$c_file_id'";
$result = db_query( $query );
$t_diskfile = db_result( $result );
-
- # in windows replace with system("del $t_diskfile");
- chmod( $t_diskfile, 0775 );
- unlink( $t_diskfile );
+ if ( FTP == $g_file_upload_method ) {
+ $ftp = file_ftp_connect();
+ file_ftp_delete ( $ftp, $t_diskfile );
+ file_ftp_disconnect( $ftp );
+ }
+ if ( file_exists( $t_diskfile ) ) {
+ system("del $t_diskfile");
+ }
}
$query = "DELETE FROM $g_mantis_project_file_table
| ||||
TAKE CAREIn attached mantis-0.19.0-qem-1.path & mantis-0.19.0-qem-2.zip the file proj_doc_delete.php is been configured for windows instead of unix so please use the attachment last_mantis_0.19.0-qem-1.zip. |
|
|
I'm applying the patches. In the process, I'm reworking project documents to use the file_api access routines. This means all file access uses the same routines. It also appears that project documenta can be displayed for "All Projects" (project_id == 0), but they can't be uploaded. |
|
|
Fixed in CVS |
|