Passed
Branch develop (66e4de)
by Laurent
33:03
created
htdocs/admin/order_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@  discard block
 block discarded – undo
31 31
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
32 32
 
33 33
 
34
-if (!$user->admin)
34
+if (!$user->admin) {
35 35
 	accessforbidden();
36
+}
36 37
 
37 38
 // Load translation files required by the page
38 39
 $langs->loadLangs(array('admin', 'other', 'orders'));
@@ -43,13 +44,17 @@  discard block
 block discarded – undo
43 44
 // List of supported format
44 45
 $tmptype2label = ExtraFields::$type2label;
45 46
 $type2label = array('');
46
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
47
+foreach ($tmptype2label as $key => $val) {
48
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
49
+}
47 50
 
48 51
 $action = GETPOST('action', 'aZ09');
49 52
 $attrname = GETPOST('attrname', 'alpha');
50 53
 $elementtype = 'commande'; //Must be the $table_element of the class that manage extrafield
51 54
 
52
-if (!$user->admin) accessforbidden();
55
+if (!$user->admin) {
56
+	accessforbidden();
57
+}
53 58
 
54 59
 
55 60
 /*
Please login to merge, or discard this patch.
htdocs/admin/security_other.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@  discard block
 block discarded – undo
31 31
 // Load translation files required by the page
32 32
 $langs->loadLangs(array("users", "admin", "other"));
33 33
 
34
-if (!$user->admin)
34
+if (!$user->admin) {
35 35
 	accessforbidden();
36
+}
36 37
 
37 38
 $action = GETPOST('action', 'aZ09');
38 39
 
@@ -66,8 +67,10 @@  discard block
 block discarded – undo
66 67
 {
67 68
 	$res1 = dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", GETPOST("MAIN_APPLICATION_TITLE", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
68 69
 	$res2 = dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", GETPOST("MAIN_SESSION_TIMEOUT", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
69
-	if ($res1 && $res2) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
70
-}
70
+	if ($res1 && $res2) {
71
+		setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
72
+	}
73
+	}
71 74
 
72 75
 
73 76
 
@@ -158,7 +161,9 @@  discard block
 block discarded – undo
158 161
 
159 162
 
160 163
 $sessiontimeout = ini_get("session.gc_maxlifetime");
161
-if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout;
164
+if (empty($conf->global->MAIN_SESSION_TIMEOUT)) {
165
+	$conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout;
166
+}
162 167
 print '<tr class="oddeven">';
163 168
 print '<td>'.$langs->trans("SessionTimeOut").'</td><td class="right">';
164 169
 if (ini_get("session.gc_probability") == 0) {
@@ -173,7 +178,9 @@  discard block
 block discarded – undo
173 178
 print '</tr>';
174 179
 
175 180
 
176
-if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE = "";
181
+if (empty($conf->global->MAIN_APPLICATION_TITLE)) {
182
+	$conf->global->MAIN_APPLICATION_TITLE = "";
183
+}
177 184
 print '<tr class="oddeven">';
178 185
 print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td class="right">';
179 186
 print '</td>';
Please login to merge, or discard this patch.
htdocs/admin/security_file.php 1 patch
Braces   +16 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@  discard block
 block discarded – undo
31 31
 // Load translation files required by the page
32 32
 $langs->loadLangs(array('users', 'admin', 'other'));
33 33
 
34
-if (!$user->admin)
34
+if (!$user->admin) {
35 35
 	accessforbidden();
36
+}
36 37
 
37 38
 $action = GETPOST('action', 'aZ09');
38 39
 
@@ -61,8 +62,10 @@  discard block
 block discarded – undo
61 62
 	$res4 = dolibarr_set_const($db, "MAIN_UMASK", GETPOST('MAIN_UMASK', 'alpha'), 'chaine', 0, '', $conf->entity);
62 63
 	$res5 = dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", trim($antivircommand), 'chaine', 0, '', $conf->entity);
63 64
 	$res6 = dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", trim($antivirparam), 'chaine', 0, '', $conf->entity);
64
-	if ($res3 && $res4 && $res5 && $res6) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
65
-}
65
+	if ($res3 && $res4 && $res5 && $res6) {
66
+		setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
67
+	}
68
+	}
66 69
 
67 70
 
68 71
 
@@ -72,8 +75,11 @@  discard block
 block discarded – undo
72 75
 	$langs->load("other");
73 76
 	$file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
74 77
 	$ret = dol_delete_file($file);
75
-	if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs');
76
-	else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile', 'alpha')), null, 'errors');
78
+	if ($ret) {
79
+		setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs');
80
+	} else {
81
+		setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile', 'alpha')), null, 'errors');
82
+	}
77 83
 	Header('Location: '.$_SERVER["PHP_SELF"]);
78 84
 	exit;
79 85
 }
@@ -116,8 +122,11 @@  discard block
 block discarded – undo
116 122
 print '<tr class="oddeven">';
117 123
 print '<td colspan="2">'.$langs->trans("MaxSizeForUploadedFiles").'.';
118 124
 $max = @ini_get('upload_max_filesize');
119
-if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit", $max * 1024, $langs->trans("Kb")).'.';
120
-else print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.';
125
+if ($max) {
126
+	print ' '.$langs->trans("MustBeLowerThanPHPLimit", $max * 1024, $langs->trans("Kb")).'.';
127
+} else {
128
+	print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.';
129
+}
121 130
 print '</td>';
122 131
 print '<td class="nowrap">';
123 132
 print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb");
Please login to merge, or discard this patch.
htdocs/admin/holiday_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@  discard block
 block discarded – undo
30 30
 require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
31 31
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
32 32
 
33
-if (!$user->admin)
33
+if (!$user->admin) {
34 34
 	accessforbidden();
35
+}
35 36
 
36 37
 // Load translation files required by the page
37 38
 $langs->loadLangs(array('admin', 'errors', 'holiday', 'other'));
@@ -42,13 +43,17 @@  discard block
 block discarded – undo
42 43
 // List of supported format
43 44
 $tmptype2label = ExtraFields::$type2label;
44 45
 $type2label = array('');
45
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
46
+foreach ($tmptype2label as $key => $val) {
47
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
48
+}
46 49
 
47 50
 $action = GETPOST('action', 'aZ09');
48 51
 $attrname = GETPOST('attrname', 'alpha');
49 52
 $elementtype = 'holiday'; //Must be the $table_element of the class that manage extrafield
50 53
 
51
-if (!$user->admin) accessforbidden();
54
+if (!$user->admin) {
55
+	accessforbidden();
56
+}
52 57
 
53 58
 
54 59
 /*
Please login to merge, or discard this patch.
htdocs/admin/expedition_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@  discard block
 block discarded – undo
32 32
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
33 33
 
34 34
 
35
-if (!$user->admin)
35
+if (!$user->admin) {
36 36
 	accessforbidden();
37
+}
37 38
 
38 39
 // Load translation files required by the page
39 40
 $langs->loadLangs(array('admin', 'other', 'sendings', 'deliveries'));
@@ -45,13 +46,17 @@  discard block
 block discarded – undo
45 46
 // List of supported format
46 47
 $tmptype2label = ExtraFields::$type2label;
47 48
 $type2label = array('');
48
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
49
+foreach ($tmptype2label as $key => $val) {
50
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
51
+}
49 52
 
50 53
 $action = GETPOST('action', 'aZ09');
51 54
 $attrname = GETPOST('attrname', 'alpha');
52 55
 $elementtype = 'expedition'; //Must be the $table_element of the class that manage extrafield
53 56
 
54
-if (!$user->admin) accessforbidden();
57
+if (!$user->admin) {
58
+	accessforbidden();
59
+}
55 60
 
56 61
 
57 62
 /*
Please login to merge, or discard this patch.
htdocs/admin/supplierorderdet_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@  discard block
 block discarded – undo
32 32
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
33 33
 
34 34
 
35
-if (!$user->admin)
35
+if (!$user->admin) {
36 36
 	accessforbidden();
37
+}
37 38
 
38 39
 // Load translation files required by the page
39 40
 $langs->loadLangs(array('admin', 'other', 'orders'));
@@ -44,13 +45,17 @@  discard block
 block discarded – undo
44 45
 // List of supported format
45 46
 $tmptype2label = ExtraFields::$type2label;
46 47
 $type2label = array('');
47
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
48
+foreach ($tmptype2label as $key => $val) {
49
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
50
+}
48 51
 
49 52
 $action = GETPOST('action', 'aZ09');
50 53
 $attrname = GETPOST('attrname', 'alpha');
51 54
 $elementtype = 'commande_fournisseurdet'; //Must be the $table_element of the class that manage extrafield
52 55
 
53
-if (!$user->admin) accessforbidden();
56
+if (!$user->admin) {
57
+	accessforbidden();
58
+}
54 59
 
55 60
 
56 61
 /*
Please login to merge, or discard this patch.
htdocs/admin/supplierorder_extrafields.php 1 patch
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@  discard block
 block discarded – undo
31 31
 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
32 32
 
33 33
 
34
-if (!$user->admin)
34
+if (!$user->admin) {
35 35
 	accessforbidden();
36
+}
36 37
 
37 38
 	// Load translation files required by the page
38 39
 $langs->loadLangs(array('admin', 'other', 'orders'));
@@ -43,13 +44,17 @@  discard block
 block discarded – undo
43 44
 // List of supported format
44 45
 $tmptype2label = ExtraFields::$type2label;
45 46
 $type2label = array('');
46
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
47
+foreach ($tmptype2label as $key => $val) {
48
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
49
+}
47 50
 
48 51
 $action = GETPOST('action', 'aZ09');
49 52
 $attrname = GETPOST('attrname', 'alpha');
50 53
 $elementtype = 'commande_fournisseur'; //Must be the $table_element of the class that manage extrafield
51 54
 
52
-if (!$user->admin) accessforbidden();
55
+if (!$user->admin) {
56
+	accessforbidden();
57
+}
53 58
 
54 59
 
55 60
 /*
Please login to merge, or discard this patch.
htdocs/admin/mrp_extrafields.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,13 +39,17 @@
 block discarded – undo
39 39
 // List of supported format
40 40
 $tmptype2label = ExtraFields::$type2label;
41 41
 $type2label = array('');
42
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
42
+foreach ($tmptype2label as $key => $val) {
43
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
44
+}
43 45
 
44 46
 $action = GETPOST('action', 'aZ09');
45 47
 $attrname = GETPOST('attrname', 'alpha');
46 48
 $elementtype = 'mrp_mo';
47 49
 
48
-if (!$user->admin) accessforbidden();
50
+if (!$user->admin) {
51
+	accessforbidden();
52
+}
49 53
 
50 54
 
51 55
 /*
Please login to merge, or discard this patch.
htdocs/admin/bom_extrafields.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,13 +39,17 @@
 block discarded – undo
39 39
 // List of supported format
40 40
 $tmptype2label = ExtraFields::$type2label;
41 41
 $type2label = array('');
42
-foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
42
+foreach ($tmptype2label as $key => $val) {
43
+	$type2label[$key] = $langs->transnoentitiesnoconv($val);
44
+}
43 45
 
44 46
 $action = GETPOST('action', 'aZ09');
45 47
 $attrname = GETPOST('attrname', 'alpha');
46 48
 $elementtype = 'bom_bom';
47 49
 
48
-if (!$user->admin) accessforbidden();
50
+if (!$user->admin) {
51
+	accessforbidden();
52
+}
49 53
 
50 54
 
51 55
 /*
Please login to merge, or discard this patch.