From 2b054271e2c51b17a1795b5cd34e5dc334e665ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Sep 2009 23:22:00 +0000 Subject: [PATCH] New: Add module FTP client --- ChangeLog | 1 + htdocs/admin/external_rss.php | 48 +- htdocs/admin/ftpclient.php | 304 ++++++++++++ htdocs/ftp/index.php | 578 +++++++++++++++++++++++ htdocs/ftp/pre.inc.php | 43 ++ htdocs/includes/modules/modFTP.class.php | 158 +++++++ htdocs/langs/ar_AR/admin.lang | 1 - htdocs/langs/da_DA/admin.lang | 2 +- htdocs/langs/de_DE/admin.lang | 2 +- htdocs/langs/en_US/admin.lang | 6 +- htdocs/langs/en_US/ftp.lang | 12 + htdocs/langs/fi_FI/admin.lang | 2 +- htdocs/langs/fr_FR/admin.lang | 8 +- htdocs/langs/fr_FR/ftp.lang | 12 + htdocs/langs/it_IT/admin.lang | 2 +- htdocs/langs/nb_NO/admin.lang | 2 +- htdocs/langs/nl_BE/admin.lang | 2 +- htdocs/langs/nl_NL/admin.lang | 2 +- htdocs/langs/pl_PL/admin.lang | 2 +- htdocs/langs/ro_RO/admin.lang | 2 +- htdocs/langs/ru_RU/admin.lang | 2 +- htdocs/lib/functions.lib.php | 10 +- htdocs/translate.class.php | 2 +- 23 files changed, 1155 insertions(+), 48 deletions(-) create mode 100644 htdocs/admin/ftpclient.php create mode 100644 htdocs/ftp/index.php create mode 100644 htdocs/ftp/pre.inc.php create mode 100644 htdocs/includes/modules/modFTP.class.php create mode 100644 htdocs/langs/en_US/ftp.lang create mode 100644 htdocs/langs/fr_FR/ftp.lang diff --git a/ChangeLog b/ChangeLog index c6ae2ae82e4..035e672a5fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,6 +46,7 @@ For users: for other users than yourself. Can also purge existing sessions. - New: Add experimental point of sale module. - New: Better usage when using with smartphones. +- New: Add module FTP client. - Fix: "Now" link works when date popup is not used. - Fix: Debug seriously the email notification module. - Fix: Error Call to a member function trans when refusing a supplier order. diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index b6a63afea69..4130eaf074f 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -21,11 +21,11 @@ */ /** - \file htdocs/admin/external_rss.php - \ingroup external_rss - \brief Page d'administration/configuration du module ExternalRss - \version $Id$ -*/ + * \file htdocs/admin/external_rss.php + * \ingroup external_rss + * \brief Page d'administration/configuration du module ExternalRss + * \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); @@ -92,7 +92,7 @@ if ($_POST["action"] == 'add' || $_POST["modify"]) $err++; } } - + $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . $_POST["norss"],$_POST[$external_rss_title],'chaine',0,'',$conf->entity); if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . $_POST["norss"],$_POST[$external_rss_urlrss],'chaine',0,'',$conf->entity); @@ -120,7 +120,7 @@ if ($_POST["delete"]) // Supprime boite box_external_rss de definition des boites $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def"; $sql.= " WHERE file ='box_external_rss.php' AND note like '".$_POST["norss"]." %'"; - + $resql=$db->query($sql); if ($resql) { @@ -144,7 +144,7 @@ if ($_POST["delete"]) dol_print_error($db,"sql=$sql"); exit; } - + $i++; } @@ -160,7 +160,7 @@ if ($_POST["delete"]) $result1=dolibarr_del_const($db,"EXTERNAL_RSS_TITLE_" . $_POST["norss"],$conf->entity); if ($result1) $result2=dolibarr_del_const($db,"EXTERNAL_RSS_URLRSS_" . $_POST["norss"],$conf->entity); - + if ($result1 && $result2) { $db->commit(); @@ -188,10 +188,10 @@ print_fiche_titre($langs->trans("ExternalRSSSetup"), $linkback, 'setup'); print '
'; // Formulaire ajout -print '
'; +print ''; print ''; -print ''; +print '
'; print ''; print ''; print ''; @@ -205,7 +205,7 @@ print ''; - '; '; print ''; -?> -
-
'.$langs->trans("NewRSS").''.$langs->trans("Example").'
URL du RSS " size="64">http://wiki.april.org/RecentChanges?format=rss
http://linuxfr.org/backend/news/rss20.rss
http://back.fr.lolix.org/jobs.rss.php3 +
http://wiki.april.org/RecentChanges?format=rss
http://linuxfr.org/backend/news/rss20.rss
http://back.fr.lolix.org/jobs.rss.php3
"> @@ -216,13 +216,12 @@ print '
+print '
'; -'; $sql ="select rowid, file, note from ".MAIN_DB_PREFIX."boxes_def"; $sql.=" WHERE file = 'box_external_rss.php'"; @@ -238,22 +237,22 @@ if ($resql) while ($i < $num) { $obj = $db->fetch_object($resql); - + eregi('^([0-9]+)',$obj->note,$reg); $idrss = $reg[1]; //print "x".$idrss; $var=true; - + $rss = fetch_rss( @constant("EXTERNAL_RSS_URLRSS_".$idrss) ); // fetch_rss initialise les objets suivant: // print_r($rss->channel); // print_r($rss->image); // print_r($rss->items); - - print ""; + + print ""; print ''; - + print ""; print ""; print ""; @@ -307,7 +306,7 @@ if ($resql) print ""; print ""; - + $i++; } } @@ -315,11 +314,8 @@ else { dol_print_error($db); } -?> -
".$langs->trans("RSS")." ".($i+1)."
- -'."\n"; $db->close(); diff --git a/htdocs/admin/ftpclient.php b/htdocs/admin/ftpclient.php new file mode 100644 index 00000000000..eeaae5cad84 --- /dev/null +++ b/htdocs/admin/ftpclient.php @@ -0,0 +1,304 @@ + + * Copyright (C) 2003,2005 Rodolphe Quiedeville + * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file htdocs/admin/ftpclient.php + * \ingroup ftp + * \brief Admin page to setup FTP client module + * \version $Id$ + */ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); + + +$langs->load("admin"); + +if (!$user->admin) accessforbidden(); + +$def = array(); +$lastftpentry=0; + +// positionne la variable pour le nombre de rss externes +$sql ="select MAX(name) name from ".MAIN_DB_PREFIX."const"; +$sql.=" WHERE name like 'FTP_SERVER_%'"; +$result=$db->query($sql); +if ($result) +{ + $obj = $db->fetch_object($result); + eregi('([0-9]+)$',$obj->name,$reg); + if ($reg[1]) $lastftpentry = $reg[1]; +} +else +{ + dol_print_error($db); +} + +if ($_POST["action"] == 'add' || $_POST["modify"]) +{ + $ftp_server = "FTP_SERVER_" . $_POST["numero_entry"]; + + if(isset($_POST[$ftp_server])) + { + $ftp_port = "FTP_PORT_" . $_POST["numero_entry"]; + $ftp_user = "FTP_USER_" . $_POST["numero_entry"]; + $ftp_password = "FTP_PASSWORD_" . $_POST["numero_entry"]; + + $db->begin(); + + $result1=dolibarr_set_const($db, "FTP_PORT_" . $_POST["numero_entry"],$_POST[$ftp_port],'chaine',0,'',$conf->entity); + if ($result1) $result2=dolibarr_set_const($db, "FTP_SERVER_" . $_POST["numero_entry"],$_POST[$ftp_server],'chaine',0,'',$conf->entity); + if ($result2) $result3=dolibarr_set_const($db, "FTP_USER_" . $_POST["numero_entry"],$_POST[$ftp_user],'chaine',0,'',$conf->entity); + if ($result3) $result4=dolibarr_set_const($db, "FTP_PASSWORD_" . $_POST["numero_entry"],$_POST[$ftp_password],'chaine',0,'',$conf->entity); + + if ($result1 && $result2 && $result3 && $result4) + { + $db->commit(); + //$mesg='
'.$langs->trans("Success").'
'; + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + $db->rollback(); + dol_print_error($db); + } + } +} + +if ($_POST["delete"]) +{ + if(isset($_POST["numero_entry"])) + { + $db->begin(); + + // Supprime boite box_external_rss de definition des boites + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def"; + $sql.= " WHERE file ='box_external_rss.php' AND note like '".$_POST["numero_entry"]." %'"; + + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i=0; + while ($i < $num) + { + $obj=$db->fetch_object($resql); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes"; + $sql.= " WHERE box_id = ".$obj->rowid; + $resql=$db->query($sql); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def"; + $sql.= " WHERE rowid = ".$obj->rowid; + $resql=$db->query($sql); + + if (! $resql) + { + $db->rollback(); + dol_print_error($db,"sql=$sql"); + exit; + } + + $i++; + } + + $db->commit(); + } + else + { + $db->rollback(); + dol_print_error($db,"sql=$sql"); + exit; + } + + + $result1=dolibarr_del_const($db,"ftp_port_" . $_POST["numero_entry"],$conf->entity); + if ($result1) $result2=dolibarr_del_const($db,"ftp_server_" . $_POST["numero_entry"],$conf->entity); + if ($result2) $result3=dolibarr_del_const($db,"ftp_user_" . $_POST["numero_entry"],$conf->entity); + if ($result3) $result4=dolibarr_del_const($db,"ftp_password_" . $_POST["numero_entry"],$conf->entity); + + if ($result1 && $result2 && $result3 && $result4) + { + $db->commit(); + //$mesg='
'.$langs->trans("Success").'
'; + header("Location: ftpclient.php"); + exit; + } + else + { + $db->rollback(); + dol_print_error($db); + } + } +} + + +/* + * View + */ + +llxHeader(); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("FTPClientSetup"), $linkback, 'setup'); +print '
'; + +if (! function_exists('ftp_connect')) +{ + print $langs->trans("FTPFeatureNotSupportedByYourPHP"); +} +else +{ + + // Formulaire ajout + print '
'; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + ?> + + + '; + print ''; + ?> + +
+ +
'.$langs->trans("NewFTPClient").''.$langs->trans("Example").'
'.$langs->trans("Server").'localhost
'.$langs->trans("Port").'21
'.$langs->trans("User").'myftplogin
'.$langs->trans("Password").'myftppassword
+ "> + + +
+ + query($sql); + if ($resql) + { + $num =$db->num_rows($resql); + $i=0; + + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + eregi('^([0-9]+)',$obj->note,$reg); + $idrss = $reg[1]; + //print "x".$idrss; + + $var=true; + + print ""; + print ''; + + print ""; + print ""; + print ""; + + $var=!$var; + print ""; + print ""; + print ""; + print ""; + + $var=!$var; + print ""; + print ""; + print ""; + print ""; + + $var=!$var; + print ""; + print ""; + print ""; + print ""; + + $var=!$var; + print ""; + print ""; + print ""; + print ""; + + print ""; + print ""; + print ""; + + print ""; + + $i++; + } + } + else + { + dol_print_error($db); + } + + print '
".$langs->trans("FTP")." ".($i+1)."
".$langs->trans("Server")."
".$langs->trans("Port")."
".$langs->trans("User")."
".$langs->trans("Password")."
"; + print "trans("Modify")."\">"; + print "   "; + print "trans("Delete")."\">"; + print ""; + print "
'; + +} + + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php new file mode 100644 index 00000000000..455ff696a11 --- /dev/null +++ b/htdocs/ftp/index.php @@ -0,0 +1,578 @@ + + * Copyright (C) 2008-2009 Regis Houssin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file htdocs/ftp/index.php + * \ingroup ftp + * \brief Main page for FTP section area + * \version $Id$ + * \author Laurent Destailleur + */ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php"); + +// Load traductions files +$langs->load("ftp"); +$langs->load("companies"); +$langs->load("other"); + +// Security check +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'ftp',''); + +// Load permissions +$user->getrights('ftp'); + +// Get parameters +$action = isset($_GET["action"])?$_GET["action"]:$_POST['action']; +$section=isset($_GET["section"])?$_GET["section"]:$_POST['section']; +if (! $section) $section='/'; +$numero_ftp = isset($_GET["numero_ftp"])?$_GET["numero_ftp"]:$_POST['numero_ftp']; +if (! $numero_ftp) $numero_ftp=1; +$file=isset($_GET["file"])?$_GET["file"]:$_POST['file']; + +$upload_dir = $conf->ftp->dir_temp; +$download_dir = $conf->ftp->dir_temp; + +$page=$_GET["page"]; +$sortorder=$_GET["sortorder"]; +$sortfield=$_GET["sortfield"]; + +$limit = $conf->liste_limit; +$offset = $limit * $page ; +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="label"; + +$s_ftp_server='FTP_SERVER_'.$numero_ftp; +$s_ftp_port='FTP_PORT_'.$numero_ftp; +$s_ftp_user='FTP_USER_'.$numero_ftp; +$s_ftp_password='FTP_PASSWORD_'.$numero_ftp; +$ftp_server=$conf->global->$s_ftp_server; +$ftp_port=$conf->global->$s_ftp_port; +$ftp_user=$conf->global->$s_ftp_user; +$ftp_password=$conf->global->$s_ftp_password; + +$conn_id=0; // FTP connection ID + + + +/******************************************************************* + * ACTIONS + * + * Put here all code to do according to value of "action" parameter + ********************************************************************/ + +// Envoie fichier +if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) +{ + $result=$ecmdir->fetch($_REQUEST["section"]); + if (! $result > 0) + { + dol_print_error($db,$ecmdir->error); + exit; + } + $relativepath=$ecmdir->getRelativePath(); + $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; + + if (! is_dir($upload_dir)) + { + $result=create_exdir($upload_dir); + } + + if (is_dir($upload_dir)) + { + $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0); + if ($result > 0) + { + //$mesg = '
'.$langs->trans("FileTransferComplete").'
'; + //print_r($_FILES); + $result=$ecmdir->changeNbOfFiles('+'); + } + else if ($result < 0) + { + // Echec transfert (fichier depassant la limite ?) + $langs->load("errors"); + $mesg = '
'.$langs->trans("ErrorFileNotUploaded").'
'; + // print_r($_FILES); + } + else + { + // File infected by a virus + $langs->load("errors"); + $mesg = '
'.$langs->trans("ErrorFileIsInfectedWith",$result).'
'; + } + } + else + { + // Echec transfert (fichier depassant la limite ?) + $langs->load("errors"); + $mesg = '
'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'
'; + } +} + +// Action ajout d'un rep +if ($_POST["action"] == 'add' && $user->rights->ftp->setup) +{ + $ecmdir->ref = $_POST["ref"]; + $ecmdir->label = $_POST["label"]; + $ecmdir->description = $_POST["desc"]; + + $id = $ecmdir->create($user); + if ($id > 0) + { + Header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + $mesg='
Error '.$langs->trans($ecmdir->error).'
'; + $_GET["action"] = "create"; + } +} + +// Remove file +if ($_REQUEST['action'] == 'confirm_deletefile' && $_REQUEST['confirm'] == 'yes') +{ + // set up a connection or die + if (! $conn_id) + { + $newsectioniso=utf8_decode($section); + $resultarray=dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso); + $conn_id=$resultarray['conn_id']; + $ok=$resultarray['ok']; + $mesg=$resultarray['mesg']; + } + + if ($conn_id && $ok && ! $mesg) + { + // Remote file + $filename=$file; + $remotefile=$section.(eregi('[\\\/]$',$section)?'':'/').$file; + $newremotefileiso=utf8_decode($remotefile); + + //print "x".$newremotefileiso; + $result=ftp_delete($conn_id, $newremotefileiso); + if ($result) + { + $mesg = '
'.$langs->trans("FileWasRemoved",$file).'
'; + } + else + { + $mesg = '
'.$langs->trans("FTPFailedToRemoveFile",$file).'
'; + } + + //ftp_close($conn_id); Close later + + $action=''; + } + else + { + dol_print_error('',$mesg); + } +} + +// Remove directory +if ($_REQUEST['action'] == 'confirm_deletesection' && $_REQUEST['confirm'] == 'yes') +{ + // set up a connection or die + if (! $conn_id) + { + $newsectioniso=utf8_decode($section); + $resultarray=dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso); + $conn_id=$resultarray['conn_id']; + $ok=$resultarray['ok']; + $mesg=$resultarray['mesg']; + } + + if ($conn_id && $ok && ! $mesg) + { + // Remote file + $filename=$file; + $remotefile=$section.(eregi('[\\\/]$',$section)?'':'/').$file; + $newremotefileiso=utf8_decode($remotefile); + + $result=ftp_rmdir($conn_id, $newremotefileiso); + if ($result) + { + $mesg = '
'.$langs->trans("DirWasRemoved",$file).'
'; + } + else + { + $mesg = '
'.$langs->trans("FTPFailedToRemoveDir",$file).'
'; + } + + //ftp_close($conn_id); Close later + + $action=''; + } + else + { + dol_print_error('',$mesg); + } +} + +// Remove directory +if ($_REQUEST['action'] == 'download') +{ + // set up a connection or die + if (! $conn_id) + { + $newsectioniso=utf8_decode($section); + $resultarray=dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $newsectioniso); + $conn_id=$resultarray['conn_id']; + $ok=$resultarray['ok']; + $mesg=$resultarray['mesg']; + } + + if ($conn_id && $ok && ! $mesg) + { + // Local file + $localfile=tempnam($download_dir,'dol_'); + + // Remote file + $filename=$file; + $remotefile=$section.(eregi('[\\\/]$',$section)?'':'/').$file; + $newremotefileiso=utf8_decode($remotefile); + + $result=ftp_get($conn_id,$localfile,$newremotefileiso,FTP_BINARY); + if ($result) + { + if (! empty($conf->global->MAIN_UMASK)) + @chmod($localfile, octdec($conf->global->MAIN_UMASK)); + + // Define mime type + $type = 'application/octet-stream'; + if (! empty($_GET["type"])) $type=$_GET["type"]; + else $type=dol_mimetype($original_file); + + // Define attachment (attachment=true to force choice popup 'open'/'save as') + $attachment = true; + + if ($encoding) header('Content-Encoding: '.$encoding); + if ($type) header('Content-Type: '.$type); + if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"'); + else header('Content-Disposition: inline; filename="'.$filename.'"'); + + // Ajout directives pour resoudre bug IE + header('Cache-Control: Public, must-revalidate'); + header('Pragma: public'); + + readfile($localfile); + + ftp_close($conn_id); + + exit; + } + else + { + $mesg='
Failed to get file '.$remotefile.'
'; + } + + } + else + { + dol_print_error('',$mesg); + } + + //ftp_close($conn_id); Close later +} + + + + +/******************************************************************* + * PAGE + * + * Put here all code to do according to value of "action" parameter + ********************************************************************/ + +llxHeader(); + +$form=new Form($db); +$formfile=new FormFile($db); +$userstatic = new User($db); + + + +//*********************** +// List +//*********************** +print_fiche_titre($langs->trans("FTPArea")); + +print $langs->trans("FTPAreaDesc")."
"; +print "
\n"; + +if (! function_exists('ftp_connect')) +{ + print $langs->trans("FTPFeatureNotSupportedByYourPHP"); +} +else +{ + if (! empty($ftp_server)) + { + + // Confirm remove file + if ($_GET['action'] == 'delete') + { + $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); + if ($ret == 'html') print '
'; + } + + if ($mesg) { print $mesg."
"; } + + + // Confirmation de la suppression d'une ligne categorie + if ($_GET['action'] == 'delete_section') + { + $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); + if ($ret == 'html') print '
'; + } + + print $langs->trans("Server").': '.$ftp_server.'
'; + print $langs->trans("Port").': '.$ftp_port.'
'; + print $langs->trans("User").': '.$ftp_user.'
'; + + print $langs->trans("Directory").': '.$section.'
'; + print "
\n"; + + // Construit liste des repertoires + print ''."\n"; + + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + + // set up a connection or die + if (! $conn_id) + { + $resultarray=dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $section); + $conn_id=$resultarray['conn_id']; + $ok=$resultarray['ok']; + $mesg=$resultarray['mesg']; + + } + + if ($ok) + { + //$type = ftp_systype($conn_id); + + $newsectioniso=utf8_decode($section); + $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=sizeof($contents); + $var=true; + $rawlisthasfailed=false; + $i=0; + while ($i < $nboflines && $i < 1000) + { + $vals=split(' +',utf8_encode($buff[$i]),9); + + $file=$vals[8]; + if (empty($file)) + { + $rawlisthasfailed=true; + $file=utf8_encode($contents[$i]); + } + + if ($file == '.' || ($file == '..' && $section == '/')) + { + $i++; + continue; + } + + // Is it a directory ? + $is_directory=0; + if ($file == '..') $is_directory=1; + else if (! $rawlisthasfailed) + { + if (eregi('^d',$vals[0])) $is_directory=1; + if (eregi('^l',$vals[0])) $is_link=1; + } + else + { + // Remote file + $filename=$file; + $remotefile=$section.(eregi('[\\\/]$',$section)?'':'/').$file; + $newremotefileiso=utf8_decode($remotefile); + $is_directory=ftp_isdir($conn_id, $newremotefileiso); + } + + $var=!$var; + print ''; + // Name + print ''; + // Size + print ''; + // User + print ''; + // Group + print ''; + // Permissions + print ''; + // Action + print ''; + print ''."\n"; + $i++; + $nbofentries++; + } + + } + + + print "
'.$langs->trans("Content").''.$langs->trans("Size").''.$langs->trans("Date").''.$langs->trans("Owner").''.$langs->trans("Group").''.$langs->trans("Permissions").''; + print ''.img_picto($langs->trans("Refresh"),'refresh').' '; + print '
'; + $newsection=$section.(eregi('[\\\/]$',$section)?'':'/').$file; + $newsection=eregi_replace('[\\\/][^\\\/]+[\\\/]\.\.$','/',$newsection); // Change aaa/xxx/.. to new aaa + if ($is_directory) print ''; + print $file; + if ($is_directory) print ''; + print ''; + if (! $is_directory && ! $is_link) print $vals[4]; + else print ' '; + print ''; + print $vals[5].' '.$vals[6].' '.$vals[7]; + print ''; + print $vals[2]; + print ''; + print $vals[3]; + print ''; + print $vals[0]; + print ''; + if ($is_directory) + { + if ($file != '..') print ''.img_delete().''; + else print ' '; + } + else if ($is_link) + { + print ' '; + } + else + { + print ''.img_file().''; + print '   '; + print ''.img_delete().''; + } + print '
"; + + if (! $ok && $mesg) print $mesg; + + // Actions + /* + if ($user->rights->ftp->write && ! empty($section)) + { + $formfile->form_attach_new_file(DOL_URL_ROOT.'/ftp/index.php','',0,$section,1); + } + else print ' '; + */ + } + else + { + print $langs->trans("SetupOfFTPClientModuleNotComplete"); + } +} + +print '
'; + +// Close FTP connection +if ($conn_id) ftp_close($conn_id); + +// End of page +$db->close(); + +llxFooter('$Date$ - $Revision$'); + + +/** + * Enter description here... + * + * @param unknown_type $ftp_server + * @param unknown_type $ftp_port + * @param unknown_type $ftp_user + * @param unknown_type $ftp_password + * @param unknown_type $section + * @return unknown + */ +function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $section) +{ + $ok=1; + + $conn_id = ftp_connect($ftp_server, $ftp_port, 20); + if ($conn_id) + { + // turn on passive mode transfers + //ftp_pasv ($conn_id, true) ; + + if ($ftp_user) + { + if (ftp_login($conn_id, $ftp_user, $ftp_password)) + { + // Change the dir + $newsectioniso=utf8_decode($section); + ftp_chdir($conn_id, $newsectioniso); + } + else + { + $mesg=$langs->trans("FailedToConnectToFTPServerWithCredentials"); + $ok=0; + } + } + } + else + { + $mesg=$langs->trans("FailedToConnectToFTPServer",$ftp_server,$ftp_port); + $ok=0; + } + + $arrayresult=array('conn_id'=>$conn_id, 'ok'=>$ok, 'mesg'=>$mesg); + + return $arrayresult; +} + + +/** +*/ +function ftp_isdir($connect_id,$dir) +{ + if(ftp_chdir($connect_id,$dir)) + { + ftp_cdup($connect_id); + return 1; + + } + else + { + return 0; + } +} + +?> diff --git a/htdocs/ftp/pre.inc.php b/htdocs/ftp/pre.inc.php new file mode 100644 index 00000000000..f96932bd3f3 --- /dev/null +++ b/htdocs/ftp/pre.inc.php @@ -0,0 +1,43 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file htdocs/ftp/pre.inc.php + * \ingroup ftp + * \brief File to manage left menu for FTP module + * \version $Id$ + */ + +require ("../main.inc.php"); + +$user->getrights('ecm'); + +function llxHeader($head = '', $title='', $help_url='', $morehtml='') +{ + global $conf,$langs,$user; + $langs->load("ftp"); + + top_menu($head, $title); + + $menu = new Menu(); + + + + left_menu($menu->liste, $help_url, $morehtml); +} +?> diff --git a/htdocs/includes/modules/modFTP.class.php b/htdocs/includes/modules/modFTP.class.php new file mode 100644 index 00000000000..62805430e3e --- /dev/null +++ b/htdocs/includes/modules/modFTP.class.php @@ -0,0 +1,158 @@ + + * Copyright (C) 2004-2008 Laurent Destailleur + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** \defgroup ftp Module FTP + * \brief Module for FTP client module + * \version $Id$ + */ + +/** + * \file htdocs/includes/modules/modFTP.class.php + * \ingroup ftp + * \brief Description and activation file for module FTP + */ + +include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); + + +/** \class modFTP + * \brief Description and activation class for module FTP + */ +class modFTP extends DolibarrModules +{ + + /** + * \brief Constructor. Define names, constants, directories, boxes, permissions + * \param DB Database handler + */ + function modFTP($DB) + { + $this->db = $DB; + + // Id for module (must be unique). + // Use here a free id. + $this->numero = 2800; + + // Family can be 'crm','financial','hr','projects','product','ecm','technic','other' + // It is used to sort modules in module setup page + $this->family = "other"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = eregi_replace('^mod','',get_class($this)); + // Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value) + $this->description = "FTP Client"; + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; + // Key used in llx_const table to save module status enabled/disabled (XXX is id value) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) + $this->special = 1; + // Name of png file (without png) used for this module + $this->picto='dir'; + + // Data directories to create when module is enabled + $this->dirs = array("/ftp/temp"); + + // Config pages. Put here list of php page names stored in admmin directory used to setup module + $this->config_page_url = array('ftpclient.php'); + + // Dependencies + $this->depends = array(); // List of modules id that must be enabled if this module is enabled + $this->requiredby = array(); // List of modules id to disable if this one is disabled + + // Constants + $this->const = array(); // List of parameters + + // Boxes + $this->boxes = array(); // List of boxes + $r=0; + + // Add here list of php file(s) stored in includes/boxes that contains class to show a box. + // Example: + //$this->boxes[$r][1] = "myboxa.php"; + //$r++; + //$this->boxes[$r][1] = "myboxb.php"; + //$r++; + + // Permissions + $this->rights_class = 'ftp'; // Permission key + $this->rights = array(); // Permission array used by this module + + $r++; + $this->rights[$r][0] = 2800; + $this->rights[$r][1] = 'Use FTP client in read mode'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'read'; + + $r++; + $this->rights[$r][0] = 2801; + $this->rights[$r][1] = 'Use FTP client in write mode'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'write'; + + + // Menus + //------ + $this->menus = array(); // List of menus to add + $r=0; + + // Top menu + $this->menu[$r]=array('fk_menu'=>0, + 'type'=>'top', + 'titre'=>'FTP', + 'mainmenu'=>'ftp', + 'leftmenu'=>'0', // Use 1 if you also want to add left menu entries using this descriptor. Use 0 if left menu entries are defined in a file pre.inc.php (old school). + 'url'=>'/ftp/index.php', + 'langs'=>'ftp', + 'position'=>100, + 'perms'=>'$user->rights->ftp->read || $user->rights->ftp->write || $user->rights->ftp->setup', + 'enabled'=>1, + 'target'=>'', + 'user'=>0); + $r++; + } + + /** + * \brief Function called when module is enabled. + * The init function add previous constants, boxes and permissions into Dolibarr database. + * It also creates data directories. + */ + function init() + { + $sql = array(); + + return $this->_init($sql); + } + + /** + * \brief Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted. + */ + function remove() + { + $sql = array(); + + return $this->_remove($sql); + } + +} + +?> diff --git a/htdocs/langs/ar_AR/admin.lang b/htdocs/langs/ar_AR/admin.lang index 37982c016a6..37509111593 100644 --- a/htdocs/langs/ar_AR/admin.lang +++ b/htdocs/langs/ar_AR/admin.lang @@ -248,7 +248,6 @@ SeeWikiForAllTeam=إلقاء نظرة على صفحة ويكي قائمة كام UseACacheDelay=التخزين المؤقت للتأخير في الرد على الصادرات ثانية (0 فارغة أو لا مخبأ) DisableLinkToHelpCenter=الاختباء وصلة "هل تحتاج إلى مساعدة أو دعم" على صفحة تسجيل الدخول DisableLinkToHelp=إخفاء ارتباط "ق ٪ أخبار يساعد" على القائمة اليمنى -AddCRIfTooLong=ليس هناك التغليف ، وذلك إذا كان هو من صفحة وثائق لفترة طويلة جدا ، يجب عليك إضافة نفسك النقل textarea في العودة. ModuleDisabled=نميطة المعوقين ModuleDisabledSoNoEvent=نميطة المعوقين بغية خلق حالة أبدا ConfirmPurge=هل أنت متأكد من ذلك لتنفيذ تطهير؟
وهذا من شأنه بالتأكيد حذف جميع بيانات ملفك بأي حال من الأحوال لترميمها (صورة إدارة المحتوى في المؤسسة ، والملفات المرفقة...). diff --git a/htdocs/langs/da_DA/admin.lang b/htdocs/langs/da_DA/admin.lang index 601e2b5dc3d..15d8d990b1b 100644 --- a/htdocs/langs/da_DA/admin.lang +++ b/htdocs/langs/da_DA/admin.lang @@ -868,7 +868,7 @@ BarcodeDescISBN=Barcode typeidentifikationsmærker ISBN BarcodeDescC39=Barcode af type C39 BarcodeDescC128=Barcode af type C128 WithdrawalsSetup=Tilbagetrækning modul opsætning -ExternalRSSSetup=Eksterne RSS import setup +ExternalRSSSetup=Eksterne RSS import setup NewRSS=Ny RSS Feed MailingSetup=Emailing modul opsætning MailingEMailFrom=Afsender E-mail (Fra) for e-mails sendt med e-mail-modulet diff --git a/htdocs/langs/de_DE/admin.lang b/htdocs/langs/de_DE/admin.lang index 7e8e0f44d16..f410c2685ee 100644 --- a/htdocs/langs/de_DE/admin.lang +++ b/htdocs/langs/de_DE/admin.lang @@ -865,7 +865,7 @@ BarcodeDescISBN=Strichcode vom Typ ISBN BarcodeDescC39=Strichcode vom Typ C39 BarcodeDescC128=Strichcode vom Typ C128 WithdrawalsSetup=Rücknahme Modul Setup -ExternalRSSSetup=Externe RSS-Einfuhren Setup +ExternalRSSSetup=Externe RSS-Einfuhren Setup NewRSS=Neuer RSS Feed MailingSetup=EMailing Modul Setup MailingEMailFrom=Absender E-Mail (Aus) für E-Mails per E-Mail-Modul diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2dfe31ad6c0..fc107c93505 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -989,7 +989,7 @@ BarcodeDescC128=Barcode of type C128 ##### Prelevements ##### WithdrawalsSetup=Withdrawal module setup ##### ExternalRSS ##### -ExternalRSSSetup=External RSS imports setup +ExternalRSSSetup=External RSS imports setup NewRSS=New RSS Feed ##### Mailing ##### MailingSetup=EMailing module setup @@ -1104,4 +1104,6 @@ EndPointIs=SOAP clients must send their requests to the Dolibarr endpoint availa BankSetupModule=Bank module setup FreeLegalTextOnChequeReceipts=Free text on cheque receipts ##### Multicompany ##### -MultiCompanySetup=Multi-company module setup \ No newline at end of file +MultiCompanySetup=Multi-company module setup +##### Suppliers ##### +SuppliersSetup=Supplier module setup \ No newline at end of file diff --git a/htdocs/langs/en_US/ftp.lang b/htdocs/langs/en_US/ftp.lang new file mode 100644 index 00000000000..9896abf5585 --- /dev/null +++ b/htdocs/langs/en_US/ftp.lang @@ -0,0 +1,12 @@ +# Dolibarr language file - en_US - ftp +CHARSET=UTF-8 +FTPClientSetup=FTP Client module setup +NewFTPClient=New FTP connection setup +FTPArea=FTP Area +FTPAreaDesc=This screen show you content of a FTP server view +SetupOfFTPClientModuleNotComplete=Setup of FTP client module seems to be not complete +FTPFeatureNotSupportedByYourPHP=Your PHP does not support FTP functions +FailedToConnectToFTPServer=Failed to connect to FTP server (server %s, port %s) +FailedToConnectToFTPServerWithCredentials=Failed to login to FTP server with defined login/password +FTPFailedToRemoveFile=Failed to remove file %s. +FTPFailedToRemoveDir=Failed to remove directory %s (Check permissions and that directory is empty). \ No newline at end of file diff --git a/htdocs/langs/fi_FI/admin.lang b/htdocs/langs/fi_FI/admin.lang index 428c57bf1d3..687c90d9204 100644 --- a/htdocs/langs/fi_FI/admin.lang +++ b/htdocs/langs/fi_FI/admin.lang @@ -863,7 +863,7 @@ BarcodeDescISBN=Viivakoodi tyypin ISBN BarcodeDescC39=Viivakoodi tyypin C39 BarcodeDescC128=Viivakoodi tyypin C128 WithdrawalsSetup=Purku-moduulin asetukset -ExternalRSSSetup=Ulkopuolinen RSS tuonnin setup +ExternalRSSSetup=Ulkopuolinen RSS tuonnin setup NewRSS=Uusi RSS Feed MailingSetup=Sähköpostituksen moduulin asetukset MailingEMailFrom=Sender EMail (From) sähköpostiviestit lähetetään sähköpostitse moduuli diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index f3a1c81f732..e9dabca381e 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -356,7 +356,7 @@ Module2400Desc = Gestion des actions (évènements et taches) et de l'agenda Module2500Name = Gestion Electronique de Document Module2500Desc = Permet de stocker et administrer une base de documents Module2600Name = WebServices -Module2600Desc = Permet les web services de serveur Dolibarr +Module2600Desc = Active le serveur de Web Services de Dolibarr Module2700Name = Gravatar Module2700Desc = Utilise le service en ligne Gravatar (www.gravatar.com) pour affichage les photos d'utilisateurs/membres (qui se trouve avec leurs e-mails). Besoin d'un accès Internet Module5000Name = Multi-société @@ -364,7 +364,7 @@ Module5000Desc = Permet de gérer plusieurs sociétés Module10000Name = PayBox Module10000Desc = Module d'offrir en ligne une page de paiement par carte de crédit avec PayBox Module13452Name = SpeedFinder -Module13452Desc = Moteur de recherche en AJAX pour trouver un nom à partir d'une partie d'un numéro de téléphone dans 2 secondes +Module13452Desc = Moteur de recherche en AJAX pour trouver un nom à partir d'une partie d'un numéro de téléphone en 2 secondes Module50100Name = Caisse Module50100Desc = Caisse enregistreuse Permission11 = Consulter les factures @@ -1103,4 +1103,6 @@ EndPointIs=Les clients SOAP doivent envoyer leur requetes vers l'endpoint Doliba BankSetupModule=Configuration du module Banque FreeLegalTextOnChequeReceipts=Mention complémentaire sur les bordereaux de remises de chèques ##### Multicompany ##### -MultiCompanySetup=Configuration du module Multi-société \ No newline at end of file +MultiCompanySetup=Configuration du module Multi-société +##### Suppliers ##### +SuppliersSetup=Configuration du module Fournisseurs \ No newline at end of file diff --git a/htdocs/langs/fr_FR/ftp.lang b/htdocs/langs/fr_FR/ftp.lang new file mode 100644 index 00000000000..b446a4bf615 --- /dev/null +++ b/htdocs/langs/fr_FR/ftp.lang @@ -0,0 +1,12 @@ +# Dolibarr language file - fr_FR - ftp +CHARSET=UTF-8 +FTPClientSetup=Configuration du module FTP Client +NewFTPClient=Nouvelle connexion FTP cliente +FTPArea=Espace FTP +FTPAreaDesc=Cet écran vous présente une vue de serveur FTP +SetupOfFTPClientModuleNotComplete=La configuration du module FTP Client semble incomplète +FTPFeatureNotSupportedByYourPHP=Votre PHP ne supporte pas les fonctions FTP +FailedToConnectToFTPServer=Echec de connexion au serveur FTP (serveur: %s, port %s) +FailedToConnectToFTPServerWithCredentials=Echec de login avec le login/mot de passe FTP configuré +FTPFailedToRemoveFile=Echec suppression fichier %s. +FTPFailedToRemoveDir=Echec suppression répertoire %s (Vérifiez les permissions et que le répertoire est vide). \ No newline at end of file diff --git a/htdocs/langs/it_IT/admin.lang b/htdocs/langs/it_IT/admin.lang index f5ef98490e2..3d2a0dca6b6 100644 --- a/htdocs/langs/it_IT/admin.lang +++ b/htdocs/langs/it_IT/admin.lang @@ -861,7 +861,7 @@ BarcodeDescC128 =Codice a barre di tipo C128 ##### Prelevements ##### WithdrawalsSetup =Ritiro del modulo di impostazione ##### ExternalRSS ##### -ExternalRSSSetup =Impostazioni importazioni esterne RSS +ExternalRSSSetup =Impostazioni importazioni esterne RSS NewRSS =Nuovo feed RSS ##### Mailing ##### MailingSetup =Impostazioni modulo E-mail diff --git a/htdocs/langs/nb_NO/admin.lang b/htdocs/langs/nb_NO/admin.lang index bbbb5d22b6a..9fbe00e031e 100644 --- a/htdocs/langs/nb_NO/admin.lang +++ b/htdocs/langs/nb_NO/admin.lang @@ -884,7 +884,7 @@ BarcodeDescC128=Barcode of type C128 ##### Prelevements ##### WithdrawalsSetup=Withdrawal module setup ##### ExternalRSS ##### -ExternalRSSSetup=External RSS imports setup +ExternalRSSSetup=External RSS imports setup NewRSS=New RSS Feed ##### Mailing ##### MailingSetup=EMailing module setup diff --git a/htdocs/langs/nl_BE/admin.lang b/htdocs/langs/nl_BE/admin.lang index c2fc5c250e6..3ccabeef51a 100644 --- a/htdocs/langs/nl_BE/admin.lang +++ b/htdocs/langs/nl_BE/admin.lang @@ -860,7 +860,7 @@ BarcodeDescISBN=Barcode van het type ISBN BarcodeDescC39=Barcode van het type C39 BarcodeDescC128=Barcode van het type C128 WithdrawalsSetup=Intrekking module setup -ExternalRSSSetup=Externe RSS-invoer setup +ExternalRSSSetup=Externe RSS-invoer setup NewRSS=Nieuwe RSS Feed MailingSetup=Per e-mail module setup MailingEMailFrom=Sender e-mail (Uit) voor e-mails verstuurd via e-mail module diff --git a/htdocs/langs/nl_NL/admin.lang b/htdocs/langs/nl_NL/admin.lang index e4fe583a1c9..310be06fab0 100644 --- a/htdocs/langs/nl_NL/admin.lang +++ b/htdocs/langs/nl_NL/admin.lang @@ -869,7 +869,7 @@ BarcodeDescISBN=Barcode van het type ISBN BarcodeDescC39=Barcode van het type C39 BarcodeDescC128=Barcode van het type C128 WithdrawalsSetup=Intrekking module setup -ExternalRSSSetup=Externe RSS-invoer setup +ExternalRSSSetup=Externe RSS-invoer setup NewRSS=Nieuwe RSS Feed MailingSetup=Per e-mail module setup MailingEMailFrom=Sender e-mail (Uit) voor e-mails verstuurd via e-mail module diff --git a/htdocs/langs/pl_PL/admin.lang b/htdocs/langs/pl_PL/admin.lang index 00d88e83b56..198496e977e 100644 --- a/htdocs/langs/pl_PL/admin.lang +++ b/htdocs/langs/pl_PL/admin.lang @@ -869,7 +869,7 @@ BarcodeDescISBN=Kod kreskowy typu ISBN BarcodeDescC39=Kod kreskowy typu C39 BarcodeDescC128=Kod kreskowy typu C128 WithdrawalsSetup=Wycofanie konfiguracji modułu -ExternalRSSSetup=Zewnętrzne RSS przywóz konfiguracji +ExternalRSSSetup=Zewnętrzne RSS przywóz konfiguracji NewRSS=Nowy kanał RSS MailingSetup=Moduł konfiguracji e-maila MailingEMailFrom=Nadawca wiadomości e-mail (Z) na e-maile wysyłane przez e-maila modułu diff --git a/htdocs/langs/ro_RO/admin.lang b/htdocs/langs/ro_RO/admin.lang index c60e63e0aad..289165768f2 100644 --- a/htdocs/langs/ro_RO/admin.lang +++ b/htdocs/langs/ro_RO/admin.lang @@ -868,7 +868,7 @@ BarcodeDescISBN=Coduri de bare de tip ISBN BarcodeDescC39=Coduri de bare de tip C39 BarcodeDescC128=Coduri de bare de tip C128 WithdrawalsSetup=Retragere de modul de configurare -ExternalRSSSetup=Extern RSS importurile setup +ExternalRSSSetup=Extern RSS importurile setup NewRSS=New RSS Feed MailingSetup=Să trimiteţi un email la modul de instalare MailingEMailFrom=Expeditorul e-mail (la) pentru e-mail-uri trimise prin email-uri de module diff --git a/htdocs/langs/ru_RU/admin.lang b/htdocs/langs/ru_RU/admin.lang index 4d91e4d0932..cb746730a32 100644 --- a/htdocs/langs/ru_RU/admin.lang +++ b/htdocs/langs/ru_RU/admin.lang @@ -867,7 +867,7 @@ BarcodeDescISBN=Штрих-код типа ISBN BarcodeDescC39=Штрих-код типа C39 BarcodeDescC128=Штрих-код типа C128 WithdrawalsSetup=Снятие модуля настройки -ExternalRSSSetup=Внешние RSS импорт установки +ExternalRSSSetup=Внешние RSS импорт установки NewRSS=Новые RSS Feed MailingSetup=Отправка модуля настройки MailingEMailFrom=Отправитель EMail (С) по электронной почте было отправлено по электронной почте: модуль diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 9a3b692683e..ee24b4f4112 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -983,7 +983,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='') function img_object($alt, $object) { global $conf,$langs; - return ''.$alt.''; + return ''.dol_escape_htmltag($alt).''; } /** @@ -998,8 +998,8 @@ function img_picto($alt, $picto, $options='', $pictoisfullpath=0) { global $conf; if (! eregi('(\.png|\.gif)$',$picto)) $picto.='.png'; - if ($pictoisfullpath) return ''.$alt.''; - return ''.$alt.''; + if ($pictoisfullpath) return ''.dol_escape_htmltag($alt).''; + return ''.dol_escape_htmltag($alt).''; } /** @@ -1014,8 +1014,8 @@ function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0) { global $conf; if (! eregi('(\.png|\.gif)$',$picto)) $picto.='.png'; - if ($pictoisfullpath) return ''.$alt.''; - return ''.$alt.''; + if ($pictoisfullpath) return ''.dol_escape_htmltag($alt).''; + return ''.dol_escape_htmltag($alt).''; } /** diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php index f244d0432b7..2c4f13463b3 100644 --- a/htdocs/translate.class.php +++ b/htdocs/translate.class.php @@ -342,7 +342,7 @@ class Translate { */ function list_domainloaded() { - $ret=''; + $ret='Loaded from '.join(',',$this->dir).': '; foreach($this->tab_loaded as $key=>$val) { if ($ret) $ret.=',';