diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 1d890ab580f..76d915aee32 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -83,10 +83,10 @@ if ($action == 'dolibarr2ldap') * View */ -llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); - $form = new Form($db); +llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); + $head = member_prepare_head($object); dol_fiche_head($head, 'ldap', $langs->trans("Member"), 0, 'user'); @@ -98,12 +98,12 @@ dol_banner_tab($object, 'rowid', $linkback); print '
'; print '
'; -print ''; +print '
'; // Login -print ''; +print ''; -// Password not crypted +// If there is a link to password not crypted, we show value in database here so we can compare because it is shown nowhere else if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) { print ''; @@ -111,18 +111,11 @@ if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) print "\n"; } -// Password crypted -if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) -{ - print ''; - print ''; - print "\n"; -} +$adht = new AdherentType($db); +$adht->fetch($object->typeid); // Type -print '\n"; - -$langs->load("admin"); +print '\n"; // LDAP DN print '\n"; diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index ce2918cb86a..5f5ab38da61 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -80,7 +80,7 @@ if ($id) print '
'; print '
'; - print '
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("LDAPFieldPasswordNotCrypted").'
'.$langs->trans("LDAPFieldPasswordCrypted").''.$object->pass_crypted.'
'.$langs->trans("Type").''.$object->type."
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
LDAP '.$langs->trans("LDAPMemberDn").''.$conf->global->LDAP_MEMBER_DN."
'; + print '
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index ab8206c66b8..7663fe6fba3 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -478,7 +478,7 @@ if ($rowid > 0) print '
'; print '
'; - print '
'; + print '
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 4251ba45ab9..019388aeaab 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -822,7 +822,7 @@ if ($rowid > 0) $value = $_POST["options_" . $key]; } } else { - $value = $adht->array_options["options_" . $key]; + $value = $object->array_options["options_" . $key]; } print '"; diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index efffd5059c6..3a5060e856e 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -419,7 +419,11 @@ class DoliDBMssql extends DoliDB } //print ""; - if (! in_array($query, array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); + if (! in_array($query, array('BEGIN','COMMIT','ROLLBACK'))) + { + $SYSLOG_SQL_LIMIT = 10000; // limit log to 10kb per line to limit DOS attacks + dol_syslog('sql='.substr($query, 0, $SYSLOG_SQL_LIMIT), LOG_DEBUG); + } if (! $this->database_name) { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 98f2e5c5a1b..1470fb16f0c 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -247,7 +247,7 @@ class DoliDBMysqli extends DoliDB * Execute a SQL request and return the resultset * * @param string $query SQL query string - * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollbock to savepoint if error (this allow to have some request with errors inside global transactions). + * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollback to savepoint if error (this allow to have some request with errors inside global transactions). * Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints. * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return bool|mysqli_result Resultset of answer @@ -258,7 +258,11 @@ class DoliDBMysqli extends DoliDB $query = trim($query); - if (! in_array($query, array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); + if (! in_array($query, array('BEGIN','COMMIT','ROLLBACK'))) + { + $SYSLOG_SQL_LIMIT = 10000; // limit log to 10kb per line to limit DOS attacks + dol_syslog('sql='.substr($query, 0, $SYSLOG_SQL_LIMIT), LOG_DEBUG); + } if (empty($query)) return false; // Return false = error if empty request if (! $this->database_name) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 2777f2d0365..b577ff29bf5 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -522,7 +522,11 @@ class DoliDBPgsql extends DoliDB @pg_query($this->db, 'SAVEPOINT mysavepoint'); } - if (! in_array($query, array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); + if (! in_array($query, array('BEGIN','COMMIT','ROLLBACK'))) + { + $SYSLOG_SQL_LIMIT = 10000; // limit log to 10kb per line to limit DOS attacks + dol_syslog('sql='.substr($query, 0, $SYSLOG_SQL_LIMIT), LOG_DEBUG); + } $ret = @pg_query($this->db, $query); diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 360b72f80d9..24bb679f17b 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -453,7 +453,11 @@ class DoliDBSqlite3 extends DoliDB } //print "After convertSQLFromMysql:\n".$query."
\n"; - if (! in_array($query, array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); + if (! in_array($query, array('BEGIN','COMMIT','ROLLBACK'))) + { + $SYSLOG_SQL_LIMIT = 10000; // limit log to 10kb per line to limit DOS attacks + dol_syslog('sql='.substr($query, 0, $SYSLOG_SQL_LIMIT), LOG_DEBUG); + } if (empty($query)) return false; // Return false = error if empty request // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 30267a57ad5..5540feadd14 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -922,11 +922,15 @@ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0) * @param string $stringtoescape String to escape * @param int $keepb 1=Preserve b tags (otherwise, remove them) * @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value). Set to 1 when escaping for a
'.$label.''; print $extrafields->showInputField($key, $value); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index f68864fcc3d..ee90a0638fb 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors","admin","main","companies","resource","holiday","accountancy","hrm","orders","contracts","projects","propal","bills","interventions")); @@ -1782,7 +1782,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); - if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); + $formaccounting = new FormAccounting($db); $withentity=''; @@ -1890,6 +1890,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') elseif (in_array($fieldlist[$field], array('libelle_facture'))) { print ''; $transfound=0; + $transkey=''; // Special case for labels if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index b54a2e21b57..290e29c3f2b 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -55,7 +55,7 @@ function bomAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'bom'); return $head; } diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index eb263bdffae..b9a92f85d5e 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -188,10 +188,12 @@ class Categorie extends CommonObject * @var string Color */ public $color; + /** - * @var ??? + * @var int Id of thirdparty when CATEGORY_ASSIGNED_TO_A_CUSTOMER is set */ public $socid; + /** * @var string Category type * diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 1514a2188ff..edcb08c515b 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -80,12 +80,12 @@ if ($action == 'dolibarr2ldap') * View */ +$form = new Form($db); + $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); -$form = new Form($db); - $head = contact_prepare_head($object); dol_fiche_head($head, 'ldap', $title, -1, 'contact'); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index f474b1b05f8..d54d2dd02ff 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -39,7 +39,7 @@ // Protection if (empty($objectclass) || empty($uploaddir)) { - dol_print_error(null, 'include of actions_massactions.inc.php is done but var $massaction or $objectclass or $uploaddir was not defined'); + dol_print_error(null, 'include of actions_massactions.inc.php is done but var $objectclass or $uploaddir was not defined'); exit; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d271f90720c..9411e8bc824 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1381,7 +1381,7 @@ class FormFile if (! empty($conf->dol_use_jmobile)) $useajax=0; if (empty($conf->use_javascript_ajax)) $useajax=0; if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0; - print ''.img_delete().''; + print ''.img_delete().''; } print "