Clean
This commit is contained in:
parent
cb59edb58b
commit
8e7fa102b8
@ -185,7 +185,6 @@ function dol_ftp_delete($connect_id, $file, $newsection)
|
||||
if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) {
|
||||
return ssh2_sftp_unlink($connect_id, $newremotefileiso);
|
||||
} else {
|
||||
var_dump($newremotefileiso);
|
||||
return @ftp_delete($connect_id, $newremotefileiso);
|
||||
}
|
||||
}
|
||||
@ -242,8 +241,8 @@ function dol_ftp_rmdir($connect_id, $file, $newsection)
|
||||
$newremotefileiso = utf8_decode($remotefile);
|
||||
|
||||
if (!empty($conf->global->FTP_CONNECT_WITH_SFTP)) {
|
||||
$result = ssh2_sftp_rmdir($connect_id, $newremotefileiso);
|
||||
return ssh2_sftp_rmdir($connect_id, $newremotefileiso);
|
||||
} else {
|
||||
$result = @ftp_rmdir($connect_id, $newremotefileiso);
|
||||
return @ftp_rmdir($connect_id, $newremotefileiso);
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,17 +188,15 @@ if (GETPOST("const", 'array') && GETPOST("delete") && GETPOST("delete") == $lang
|
||||
|
||||
if ($conn_id && $ok && !$mesg) {
|
||||
foreach (GETPOST('const', 'array') as $const) {
|
||||
var_dump($const);
|
||||
if (isset($const["check"])) { // Is checkbox checked
|
||||
$langs->load("other");
|
||||
|
||||
// Remote file
|
||||
$file = $const["file"];
|
||||
$newsection = $const["section"];
|
||||
$newsection = $section;
|
||||
|
||||
$result = dol_ftp_delete($conn_id, $file, $newsection);
|
||||
var_dump($newsection);
|
||||
|
||||
if ($result) {
|
||||
setEventMessages($langs->trans("FileWasRemoved", $file), null, 'mesgs');
|
||||
} else {
|
||||
@ -230,7 +228,7 @@ if ($action == 'confirm_deletesection' && $confirm == 'yes') {
|
||||
if ($conn_id && $ok && !$mesg) {
|
||||
$newsection = $section;
|
||||
|
||||
$result = dol_ftp_rmdir($connect_id, $file, $newsection);
|
||||
$result = dol_ftp_rmdir($conn_id, $file, $newsection);
|
||||
|
||||
if ($result) {
|
||||
setEventMessages($langs->trans("DirWasRemoved", $file), null, 'mesgs');
|
||||
@ -361,12 +359,12 @@ if (!function_exists('ftp_connect')) {
|
||||
if (!empty($ftp_server)) {
|
||||
// Confirm remove file
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode(GETPOST('section')).'&file='.urlencode(GETPOST('file')), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 1);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode(GETPOST('section')).'&file='.urlencode(GETPOST('file')), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile', GETPOST('file')), 'confirm_deletefile', '', '', 1);
|
||||
}
|
||||
|
||||
// Confirmation de la suppression d'une ligne categorie
|
||||
if ($action == 'delete_section') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode(GETPOST('section')).'&file='.urlencode(GETPOST('file')), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', $ecmdir->label), 'confirm_deletesection', '', '', 1);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode(GETPOST('section')).'&file='.urlencode(GETPOST('file')), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection', GETPOST('file')), 'confirm_deletesection', '', '', 1);
|
||||
}
|
||||
|
||||
print $langs->trans("Server").': <b>'.$ftp_server.'</b><br>';
|
||||
@ -456,8 +454,6 @@ if (!function_exists('ftp_connect')) {
|
||||
} else {
|
||||
$buff = ftp_rawlist($conn_id, $newsectioniso);
|
||||
$contents = ftp_nlist($conn_id, $newsectioniso); // Sometimes rawlist fails but never nlist
|
||||
//var_dump($contents);
|
||||
//var_dump($buff);
|
||||
}
|
||||
|
||||
$nboflines = count($contents);
|
||||
@ -467,7 +463,6 @@ if (!function_exists('ftp_connect')) {
|
||||
while ($i < $nboflines && $i < 1000) {
|
||||
$vals = preg_split('@ +@', utf8_encode($buff[$i]), 9);
|
||||
//$vals=preg_split('@ +@','drwxr-xr-x 2 root root 4096 Aug 30 2008 backup_apollon1',9);
|
||||
//var_dump($vals);
|
||||
$file = $vals[8];
|
||||
if (empty($file)) {
|
||||
$rawlisthasfailed = true;
|
||||
|
||||
@ -444,7 +444,7 @@ AddAddress=Add address
|
||||
SupplierCategory=Vendor category
|
||||
JuridicalStatus200=Independent
|
||||
DeleteFile=Delete file
|
||||
ConfirmDeleteFile=Are you sure you want to delete this file?
|
||||
ConfirmDeleteFile=Are you sure you want to delete this file <b>%s</b>?
|
||||
AllocateCommercial=Assigned to sales representative
|
||||
Organization=Organization
|
||||
FiscalYearInformation=Fiscal Year
|
||||
|
||||
@ -443,7 +443,7 @@ AddAddress=Créer adresse
|
||||
SupplierCategory=Catégorie du fournisseur
|
||||
JuridicalStatus200=Indépendant
|
||||
DeleteFile=Suppression d'un fichier
|
||||
ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier ?
|
||||
ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier <b>%s</b>?
|
||||
AllocateCommercial=Affecter un commercial
|
||||
Organization=Organisme
|
||||
FiscalYearInformation=Exercice fiscal
|
||||
|
||||
Loading…
Reference in New Issue
Block a user