@@ -22,8 +22,8 @@ |
||
22 | 22 | * \brief Page to import database |
23 | 23 | */ |
24 | 24 | |
25 | -if (! defined('CSRFCHECK_WITH_TOKEN')) { |
|
26 | - define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
25 | +if (!defined('CSRFCHECK_WITH_TOKEN')) { |
|
26 | + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | require '../../main.inc.php'; |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * \brief Page with information on database tables. Add also some maintenance action to convert tables. |
25 | 25 | */ |
26 | 26 | |
27 | -if (! defined('CSRFCHECK_WITH_TOKEN')) { |
|
28 | - define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
27 | +if (!defined('CSRFCHECK_WITH_TOKEN')) { |
|
28 | + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | require '../../main.inc.php'; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $obj = $db->fetch_object($resql); |
117 | 117 | print '<tr class="oddeven">'; |
118 | 118 | |
119 | - print '<td>'.($i+1).'</td>'; |
|
119 | + print '<td>'.($i + 1).'</td>'; |
|
120 | 120 | print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a>'; |
121 | 121 | $tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name); |
122 | 122 | if (dol_is_file(DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql')) { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | while ($i < $num) { |
185 | 185 | $row = $db->fetch_row($resql); |
186 | 186 | print '<tr class="oddeven">'; |
187 | - print '<td>'.($i+1).'</td>'; |
|
187 | + print '<td>'.($i + 1).'</td>'; |
|
188 | 188 | print '<td>'.$row[0].'</td>'; |
189 | 189 | print '<td class="right">'.$row[1].'</td>'; |
190 | 190 | print '<td class="right">'.$row[2].'</td>'; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | } |
224 | 224 | |
225 | 225 | print '<tr class="oddeven">'; |
226 | - print '<td>'.($i+1).'</td>'; |
|
226 | + print '<td>'.($i + 1).'</td>'; |
|
227 | 227 | print '<td>'.$row[0].'</td>'; |
228 | 228 | print '<td>'.$count.'</td>'; |
229 | 229 | print '</tr>'; |
@@ -251,7 +251,7 @@ |
||
251 | 251 | $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; |
252 | 252 | } |
253 | 253 | if (preg_match('/_dtend$/', $key)) { |
254 | - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; |
|
254 | + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; |
|
255 | 255 | } |
256 | 256 | } |
257 | 257 | } |
@@ -275,7 +275,7 @@ |
||
275 | 275 | } else { |
276 | 276 | $title = $langs->trans("BrowseBlockedLog"); |
277 | 277 | } |
278 | -$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable"; |
|
278 | +$help_url = "EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable"; |
|
279 | 279 | |
280 | 280 | llxHeader('', $title, $help_url); |
281 | 281 |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $block_static->loadTrackedEvents(); |
81 | 81 | |
82 | 82 | $title = $langs->trans("BlockedLogSetup"); |
83 | -$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable"; |
|
83 | +$help_url = "EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable"; |
|
84 | 84 | |
85 | 85 | llxHeader('', $title, $help_url); |
86 | 86 |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | // Default sort order (if not yet defined by previous GETPOST) |
126 | 126 | if (!$sortfield) { |
127 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
127 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
128 | 128 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
129 | 129 | } |
130 | 130 | if (!$sortorder) { |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; |
293 | 293 | } |
294 | 294 | if (preg_match('/_dtend$/', $key)) { |
295 | - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; |
|
295 | + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; |
|
296 | 296 | } |
297 | 297 | } |
298 | 298 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
73 | 73 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
74 | 74 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
75 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
75 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
76 | 76 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
77 | 77 | $search_date_valid_startday = GETPOST('search_date_valid_startday', 'int'); |
78 | 78 | $search_date_valid_startmonth = GETPOST('search_date_valid_startmonth', 'int'); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $search_date_valid_endday = GETPOST('search_date_valid_endday', 'int'); |
81 | 81 | $search_date_valid_endmonth = GETPOST('search_date_valid_endmonth', 'int'); |
82 | 82 | $search_date_valid_endyear = GETPOST('search_date_valid_endyear', 'int'); |
83 | -$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver |
|
83 | +$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver |
|
84 | 84 | $search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear); |
85 | 85 | $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); |
86 | 86 | $search_montant_ht = GETPOST('search_montant_ht', 'alpha'); |
@@ -196,7 +196,7 @@ |
||
196 | 196 | if ($csrfattack) { |
197 | 197 | //print 'NOCSRFCHECK='.defined('NOCSRFCHECK').' REQUEST_METHOD='.$_SERVER['REQUEST_METHOD'].' HTTP_HOST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER']; |
198 | 198 | // Note: We can't use dol_escape_htmltag here to escape output because lib functions.lib.ph is not yet loaded. |
199 | - dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (Bad referer).", LOG_WARNING); |
|
199 | + dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (Bad referer).", LOG_WARNING); |
|
200 | 200 | print "Access refused by CSRF protection in main.inc.php. Referer of form (".htmlentities($_SERVER['HTTP_REFERER'], ENT_COMPAT, 'UTF-8').") is outside the server that serve this page (with method = ".htmlentities($_SERVER['REQUEST_METHOD'], ENT_COMPAT, 'UTF-8').").\n"; |
201 | 201 | print "If you access your server behind a proxy using url rewriting, you might check that all HTTP headers are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file to remove this security check).\n"; |
202 | 202 | die; |
@@ -97,7 +97,7 @@ |
||
97 | 97 | if ($user->socid) { |
98 | 98 | $sql .= " AND s.rowid = ".((int) $user->socid); |
99 | 99 | } |
100 | - if (! empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) { |
|
100 | + if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) { |
|
101 | 101 | $sql .= " ORDER BY c.date_contrat DESC, c.ref DESC "; |
102 | 102 | } else { |
103 | 103 | $sql .= " ORDER BY c.tms DESC, c.ref DESC "; |