@@ -92,10 +92,18 @@ |
||
92 | 92 | global $langs; |
93 | 93 | $langs->load("admin"); |
94 | 94 | |
95 | - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); |
|
96 | - if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); |
|
97 | - if ($this->version == 'dolibarr') return DOL_VERSION; |
|
98 | - if ($this->version) return $this->version; |
|
95 | + if ($this->version == 'development') { |
|
96 | + return $langs->trans("VersionDevelopment"); |
|
97 | + } |
|
98 | + if ($this->version == 'experimental') { |
|
99 | + return $langs->trans("VersionExperimental"); |
|
100 | + } |
|
101 | + if ($this->version == 'dolibarr') { |
|
102 | + return DOL_VERSION; |
|
103 | + } |
|
104 | + if ($this->version) { |
|
105 | + return $this->version; |
|
106 | + } |
|
99 | 107 | return $langs->trans("NotAvailable"); |
100 | 108 | } |
101 | 109 | } |
@@ -374,7 +374,7 @@ |
||
374 | 374 | echo <<<EOF |
375 | 375 | <script type="text/javascript"> |
376 | 376 | (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})(); |
377 | -EOF; |
|
377 | +eof; |
|
378 | 378 | |
379 | 379 | if ($errorNumber && $errorNumber != 201) { |
380 | 380 | $fileUrl = ""; |
@@ -44,10 +44,12 @@ discard block |
||
44 | 44 | { |
45 | 45 | global $Config; |
46 | 46 | |
47 | - if ($sCommand == "QuickUpload") |
|
48 | - return $Config['QuickUploadPath'][$resourceType]; |
|
49 | - else return $Config['FileTypesPath'][$resourceType]; |
|
50 | -} |
|
47 | + if ($sCommand == "QuickUpload") { |
|
48 | + return $Config['QuickUploadPath'][$resourceType]; |
|
49 | + } else { |
|
50 | + return $Config['FileTypesPath'][$resourceType]; |
|
51 | + } |
|
52 | + } |
|
51 | 53 | |
52 | 54 | /** |
53 | 55 | * GetResourceTypeDirectory |
@@ -61,14 +63,16 @@ discard block |
||
61 | 63 | global $Config; |
62 | 64 | if ($sCommand == "QuickUpload") |
63 | 65 | { |
64 | - if (strlen($Config['QuickUploadAbsolutePath'][$resourceType]) > 0) |
|
65 | - return $Config['QuickUploadAbsolutePath'][$resourceType]; |
|
66 | + if (strlen($Config['QuickUploadAbsolutePath'][$resourceType]) > 0) { |
|
67 | + return $Config['QuickUploadAbsolutePath'][$resourceType]; |
|
68 | + } |
|
66 | 69 | |
67 | 70 | // Map the "UserFiles" path to a local directory. |
68 | 71 | return Server_MapPath($Config['QuickUploadPath'][$resourceType]); |
69 | 72 | } else { |
70 | - if (strlen($Config['FileTypesAbsolutePath'][$resourceType]) > 0) |
|
71 | - return $Config['FileTypesAbsolutePath'][$resourceType]; |
|
73 | + if (strlen($Config['FileTypesAbsolutePath'][$resourceType]) > 0) { |
|
74 | + return $Config['FileTypesAbsolutePath'][$resourceType]; |
|
75 | + } |
|
72 | 76 | |
73 | 77 | // Map the "UserFiles" path to a local directory. |
74 | 78 | return Server_MapPath($Config['FileTypesPath'][$resourceType]); |
@@ -113,8 +117,9 @@ discard block |
||
113 | 117 | |
114 | 118 | // Ensure that the directory exists. |
115 | 119 | $sErrorMsg = CreateServerFolder($sResourceTypePath); |
116 | - if ($sErrorMsg != '') |
|
117 | - SendError(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})"); |
|
120 | + if ($sErrorMsg != '') { |
|
121 | + SendError(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})"); |
|
122 | + } |
|
118 | 123 | |
119 | 124 | // Return the resource type directory combined with the required path. |
120 | 125 | return CombinePaths($sResourceTypePath, $folderPath); |
@@ -159,8 +164,9 @@ discard block |
||
159 | 164 | } |
160 | 165 | |
161 | 166 | $sErrorMsg = CreateServerFolder($sParent, $folderPath); |
162 | - if ($sErrorMsg != '') |
|
163 | - return $sErrorMsg; |
|
167 | + if ($sErrorMsg != '') { |
|
168 | + return $sErrorMsg; |
|
169 | + } |
|
164 | 170 | } |
165 | 171 | |
166 | 172 | if (!file_exists($folderPath)) |
@@ -197,8 +203,10 @@ discard block |
||
197 | 203 | ini_restore('error_reporting'); |
198 | 204 | |
199 | 205 | return $sErrorMsg; |
200 | - } else return ''; |
|
201 | -} |
|
206 | + } else { |
|
207 | + return ''; |
|
208 | + } |
|
209 | + } |
|
202 | 210 | |
203 | 211 | /** |
204 | 212 | * Get Root Path |
@@ -223,8 +231,9 @@ discard block |
||
223 | 231 | |
224 | 232 | // This can check only that this script isn't run from a virtual dir |
225 | 233 | // But it avoids the problems that arise if it isn't checked |
226 | - if ($position === false || $position <> strlen($sRealPath) - strlen($sSelfPath)) |
|
227 | - SendError(1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".'); |
|
234 | + if ($position === false || $position <> strlen($sRealPath) - strlen($sSelfPath)) { |
|
235 | + SendError(1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".'); |
|
236 | + } |
|
228 | 237 | |
229 | 238 | return substr($sRealPath, 0, $position); |
230 | 239 | } |
@@ -261,11 +270,13 @@ discard block |
||
261 | 270 | $arAllowed = $Config['AllowedExtensions'][$resourceType]; |
262 | 271 | $arDenied = $Config['DeniedExtensions'][$resourceType]; |
263 | 272 | |
264 | - if (count($arAllowed) > 0 && !in_array($sExtension, $arAllowed)) |
|
265 | - return false; |
|
273 | + if (count($arAllowed) > 0 && !in_array($sExtension, $arAllowed)) { |
|
274 | + return false; |
|
275 | + } |
|
266 | 276 | |
267 | - if (count($arDenied) > 0 && in_array($sExtension, $arDenied)) |
|
268 | - return false; |
|
277 | + if (count($arDenied) > 0 && in_array($sExtension, $arDenied)) { |
|
278 | + return false; |
|
279 | + } |
|
269 | 280 | |
270 | 281 | return true; |
271 | 282 | } |
@@ -279,8 +290,9 @@ discard block |
||
279 | 290 | function IsAllowedType($resourceType) |
280 | 291 | { |
281 | 292 | global $Config; |
282 | - if (!in_array($resourceType, $Config['ConfigAllowedTypes'])) |
|
283 | - return false; |
|
293 | + if (!in_array($resourceType, $Config['ConfigAllowedTypes'])) { |
|
294 | + return false; |
|
295 | + } |
|
284 | 296 | |
285 | 297 | return true; |
286 | 298 | } |
@@ -295,8 +307,9 @@ discard block |
||
295 | 307 | { |
296 | 308 | global $Config; |
297 | 309 | |
298 | - if (!in_array($sCommand, $Config['ConfigAllowedCommands'])) |
|
299 | - return false; |
|
310 | + if (!in_array($sCommand, $Config['ConfigAllowedCommands'])) { |
|
311 | + return false; |
|
312 | + } |
|
300 | 313 | |
301 | 314 | return true; |
302 | 315 | } |
@@ -314,10 +327,12 @@ discard block |
||
314 | 327 | $sCurrentFolder = isset($_GET['CurrentFolder']) ? GETPOST('CurrentFolder', '', 1) : '/'; |
315 | 328 | |
316 | 329 | // Check the current folder syntax (must begin and start with a slash). |
317 | - if (!preg_match('|/$|', $sCurrentFolder)) |
|
318 | - $sCurrentFolder .= '/'; |
|
319 | - if (strpos($sCurrentFolder, '/') !== 0) |
|
320 | - $sCurrentFolder = '/'.$sCurrentFolder; |
|
330 | + if (!preg_match('|/$|', $sCurrentFolder)) { |
|
331 | + $sCurrentFolder .= '/'; |
|
332 | + } |
|
333 | + if (strpos($sCurrentFolder, '/') !== 0) { |
|
334 | + $sCurrentFolder = '/'.$sCurrentFolder; |
|
335 | + } |
|
321 | 336 | |
322 | 337 | // Ensure the folder path has no double-slashes |
323 | 338 | while (strpos($sCurrentFolder, '//') !== false) { |
@@ -325,11 +340,13 @@ discard block |
||
325 | 340 | } |
326 | 341 | |
327 | 342 | // Check for invalid folder paths (..) |
328 | - if (strpos($sCurrentFolder, '..') || strpos($sCurrentFolder, "\\")) |
|
329 | - SendError(102, ''); |
|
343 | + if (strpos($sCurrentFolder, '..') || strpos($sCurrentFolder, "\\")) { |
|
344 | + SendError(102, ''); |
|
345 | + } |
|
330 | 346 | |
331 | - if (preg_match(",(/\.)|[[:cntrl:]]|(//)|(\\\\)|([\:\*\?\"\<\>\|]),", $sCurrentFolder)) |
|
332 | - SendError(102, ''); |
|
347 | + if (preg_match(",(/\.)|[[:cntrl:]]|(//)|(\\\\)|([\:\*\?\"\<\>\|]),", $sCurrentFolder)) { |
|
348 | + SendError(102, ''); |
|
349 | + } |
|
333 | 350 | |
334 | 351 | return $sCurrentFolder; |
335 | 352 | } |
@@ -363,8 +380,9 @@ discard block |
||
363 | 380 | $sNewFileName = stripslashes($sNewFileName); |
364 | 381 | |
365 | 382 | // Replace dots in the name with underscores (only one dot can be there... security issue). |
366 | - if ($Config['ForceSingleExtension']) |
|
367 | - $sNewFileName = preg_replace('/\\.(?![^.]*$)/', '_', $sNewFileName); |
|
383 | + if ($Config['ForceSingleExtension']) { |
|
384 | + $sNewFileName = preg_replace('/\\.(?![^.]*$)/', '_', $sNewFileName); |
|
385 | + } |
|
368 | 386 | |
369 | 387 | // Remove \ / | : ? * " < > |
370 | 388 | $sNewFileName = preg_replace('/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFileName); |
@@ -28,8 +28,9 @@ |
||
28 | 28 | // Load translation files required by the page |
29 | 29 | $langs->loadLangs(array('banks', 'categories')); |
30 | 30 | |
31 | -if (!$user->rights->banque->lire) |
|
31 | +if (!$user->rights->banque->lire) { |
|
32 | 32 | accessforbidden(); |
33 | +} |
|
33 | 34 | |
34 | 35 | |
35 | 36 | /** |
@@ -28,7 +28,9 @@ |
||
28 | 28 | require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"; |
29 | 29 | |
30 | 30 | // Security check |
31 | -if (!$user->rights->opensurvey->write) accessforbidden(); |
|
31 | +if (!$user->rights->opensurvey->write) { |
|
32 | + accessforbidden(); |
|
33 | +} |
|
32 | 34 | |
33 | 35 | |
34 | 36 |
@@ -92,10 +92,18 @@ |
||
92 | 92 | global $langs; |
93 | 93 | $langs->load("admin"); |
94 | 94 | |
95 | - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); |
|
96 | - if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); |
|
97 | - if ($this->version == 'dolibarr') return DOL_VERSION; |
|
98 | - if ($this->version) return $this->version; |
|
95 | + if ($this->version == 'development') { |
|
96 | + return $langs->trans("VersionDevelopment"); |
|
97 | + } |
|
98 | + if ($this->version == 'experimental') { |
|
99 | + return $langs->trans("VersionExperimental"); |
|
100 | + } |
|
101 | + if ($this->version == 'dolibarr') { |
|
102 | + return DOL_VERSION; |
|
103 | + } |
|
104 | + if ($this->version) { |
|
105 | + return $this->version; |
|
106 | + } |
|
99 | 107 | return $langs->trans("NotAvailable"); |
100 | 108 | } |
101 | 109 | } |
@@ -29,14 +29,14 @@ |
||
29 | 29 | $idcontact = GETPOST('idc'); |
30 | 30 | |
31 | 31 | if (!empty($idcontact)) { |
32 | - $contact = new Contact($db); |
|
33 | - $contact->fetch($idcontact); |
|
34 | - DataPolicy::sendMailDataPolicyContact($contact); |
|
32 | + $contact = new Contact($db); |
|
33 | + $contact->fetch($idcontact); |
|
34 | + DataPolicy::sendMailDataPolicyContact($contact); |
|
35 | 35 | } else { |
36 | 36 | |
37 | - $contacts = new DataPolicy($db); |
|
38 | - $contacts->getAllContactNotInformed(); |
|
39 | - $contacts->getAllCompaniesNotInformed(); |
|
40 | - $contacts->getAllAdherentsNotInformed(); |
|
41 | - echo $langs->trans('AllAgreementSend'); |
|
37 | + $contacts = new DataPolicy($db); |
|
38 | + $contacts->getAllContactNotInformed(); |
|
39 | + $contacts->getAllCompaniesNotInformed(); |
|
40 | + $contacts->getAllAdherentsNotInformed(); |
|
41 | + echo $langs->trans('AllAgreementSend'); |
|
42 | 42 | } |
@@ -143,10 +143,16 @@ |
||
143 | 143 | global $langs; |
144 | 144 | $langs->load("admin"); |
145 | 145 | |
146 | - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); |
|
147 | - elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental"); |
|
148 | - elseif ($this->version == 'dolibarr') return DOL_VERSION; |
|
149 | - elseif ($this->version) return $this->version; |
|
150 | - else return $langs->trans("NotAvailable"); |
|
146 | + if ($this->version == 'development') { |
|
147 | + return $langs->trans("VersionDevelopment"); |
|
148 | + } elseif ($this->version == 'experimental') { |
|
149 | + return $langs->trans("VersionExperimental"); |
|
150 | + } elseif ($this->version == 'dolibarr') { |
|
151 | + return DOL_VERSION; |
|
152 | + } elseif ($this->version) { |
|
153 | + return $this->version; |
|
154 | + } else { |
|
155 | + return $langs->trans("NotAvailable"); |
|
156 | + } |
|
151 | 157 | } |
152 | 158 | } |
@@ -145,10 +145,15 @@ |
||
145 | 145 | global $langs; |
146 | 146 | $langs->load("admin"); |
147 | 147 | |
148 | - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); |
|
149 | - elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental"); |
|
150 | - elseif ($this->version == 'dolibarr') return DOL_VERSION; |
|
151 | - elseif ($this->version) return $this->version; |
|
148 | + if ($this->version == 'development') { |
|
149 | + return $langs->trans("VersionDevelopment"); |
|
150 | + } elseif ($this->version == 'experimental') { |
|
151 | + return $langs->trans("VersionExperimental"); |
|
152 | + } elseif ($this->version == 'dolibarr') { |
|
153 | + return DOL_VERSION; |
|
154 | + } elseif ($this->version) { |
|
155 | + return $this->version; |
|
156 | + } |
|
152 | 157 | return $langs->trans("NotAvailable"); |
153 | 158 | } |
154 | 159 | } |
@@ -145,10 +145,15 @@ |
||
145 | 145 | global $langs; |
146 | 146 | $langs->load("admin"); |
147 | 147 | |
148 | - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); |
|
149 | - elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental"); |
|
150 | - elseif ($this->version == 'dolibarr') return DOL_VERSION; |
|
151 | - elseif ($this->version) return $this->version; |
|
148 | + if ($this->version == 'development') { |
|
149 | + return $langs->trans("VersionDevelopment"); |
|
150 | + } elseif ($this->version == 'experimental') { |
|
151 | + return $langs->trans("VersionExperimental"); |
|
152 | + } elseif ($this->version == 'dolibarr') { |
|
153 | + return DOL_VERSION; |
|
154 | + } elseif ($this->version) { |
|
155 | + return $this->version; |
|
156 | + } |
|
152 | 157 | return $langs->trans("NotAvailable"); |
153 | 158 | } |
154 | 159 | } |