@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | 2 | $websitekey = basename(__DIR__); |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; |
|
| 4 | 4 | } // Load env if not already loaded |
| 5 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/website.lib.php'; |
|
| 6 | -require_once DOL_DOCUMENT_ROOT . '/core/website.inc.php'; |
|
| 5 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
|
| 6 | +require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
|
| 7 | 7 | ob_start(); |
| 8 | 8 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
| 9 | 9 | header('Content-type: application/manifest+json'); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // File generated to link to the master file - DO NOT MODIFY - It is just an include |
| 4 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
|
| 5 | - if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 4 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
|
| 5 | + if (!defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 6 | 6 | require_once '/var/www/html/dolibarr_dev/htdocs/master.inc.php'; |
| 7 | 7 | } |
@@ -2,6 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | // File generated to link to the master file - DO NOT MODIFY - It is just an include |
| 4 | 4 | if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
| 5 | - if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 5 | + if (! defined('USEEXTERNALSERVER')) { |
|
| 6 | + define('USEEXTERNALSERVER', 1); |
|
| 7 | + } |
|
| 6 | 8 | require_once '/var/www/html/dolibarr_dev/htdocs/master.inc.php'; |
| 7 | 9 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
| 9 | 9 | require_once './master.inc.php'; |
| 10 | 10 | } // Load master if not already loaded |
| 11 | -include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; |
|
| 11 | +include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
|
| 12 | 12 | |
| 13 | 13 | $encoding = ''; |
| 14 | 14 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | // If we have a hash public (hashp), we guess the original_file. |
| 30 | 30 | if (!empty($hashp)) { |
| 31 | - include_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; |
|
| 31 | + include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
|
| 32 | 32 | $ecmfile = new EcmFiles($db); |
| 33 | 33 | $result = $ecmfile->fetch(0, '', '', '', $hashp); |
| 34 | 34 | if ($result > 0) { |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | if ($modulepart) { // Not required, so often not defined, for link using public hashp parameter. |
| 43 | 43 | if ($moduleparttocheck == $modulepart) { |
| 44 | 44 | // We remove first level of directory |
| 45 | - $original_file = (($tmp[1] ? $tmp[1] . '/' : '') . $ecmfile->filename); // this is relative to module dir |
|
| 45 | + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir |
|
| 46 | 46 | //var_dump($original_file); exit; |
| 47 | 47 | } else { |
| 48 | 48 | print 'Bad link. File is from another module part.'; |
| 49 | 49 | } |
| 50 | 50 | } else { |
| 51 | 51 | $modulepart = $moduleparttocheck; |
| 52 | - $original_file = (($tmp[1] ? $tmp[1] . '/' : '') . $ecmfile->filename); // this is relative to module dir |
|
| 52 | + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | print "ErrorFileNotFoundWithSharedLink"; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | header('Pragma: cache'); // This is to avoid having Pragma: no-cache |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | -$refname = basename(dirname($original_file) . "/"); |
|
| 91 | +$refname = basename(dirname($original_file)."/"); |
|
| 92 | 92 | |
| 93 | 93 | // Get RSS news |
| 94 | 94 | if ($rss) { |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | $filename = $original_file; |
| 99 | 99 | $dir_temp = $conf->website->dir_temp; |
| 100 | 100 | |
| 101 | - include_once DOL_DOCUMENT_ROOT . '/website/class/website.class.php'; |
|
| 102 | - include_once DOL_DOCUMENT_ROOT . '/website/class/websitepage.class.php'; |
|
| 101 | + include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; |
|
| 102 | + include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; |
|
| 103 | 103 | $website = new Website($db); |
| 104 | 104 | $websitepage = new WebsitePage($db); |
| 105 | 105 | |
@@ -115,26 +115,26 @@ discard block |
||
| 115 | 115 | $eventarray = array(); |
| 116 | 116 | if (is_array($arrayofblogs)) { |
| 117 | 117 | foreach ($arrayofblogs as $blog) { |
| 118 | - $blog->fullpageurl = $website->virtualhost . '/' . $blog->pageurl . '.php'; |
|
| 118 | + $blog->fullpageurl = $website->virtualhost.'/'.$blog->pageurl.'.php'; |
|
| 119 | 119 | $eventarray[] = $blog; |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/xcal.lib.php"; |
|
| 124 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/date.lib.php"; |
|
| 125 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php"; |
|
| 123 | + require_once DOL_DOCUMENT_ROOT."/core/lib/xcal.lib.php"; |
|
| 124 | + require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; |
|
| 125 | + require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; |
|
| 126 | 126 | |
| 127 | - dol_syslog("build_exportfile Build export file format=" . $format . ", type=" . $type . ", cachedelay=" . $cachedelay . ", filename=" . $filename . ", filters size=" . count($filters), LOG_DEBUG); |
|
| 127 | + dol_syslog("build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG); |
|
| 128 | 128 | |
| 129 | 129 | // Clean parameters |
| 130 | 130 | if (!$filename) { |
| 131 | 131 | $extension = 'rss'; |
| 132 | - $filename = $format . '.' . $extension; |
|
| 132 | + $filename = $format.'.'.$extension; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // Create dir and define output file (definitive and temporary) |
| 136 | 136 | $result = dol_mkdir($dir_temp); |
| 137 | - $outputfile = $dir_temp . '/' . $filename; |
|
| 137 | + $outputfile = $dir_temp.'/'.$filename; |
|
| 138 | 138 | |
| 139 | 139 | $result = 0; |
| 140 | 140 | |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | if ($cachedelay) { |
| 144 | 144 | $nowgmt = dol_now(); |
| 145 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 145 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 146 | 146 | if (dol_filemtime($outputfile) > ($nowgmt - $cachedelay)) { |
| 147 | - dol_syslog("build_exportfile file " . $outputfile . " is not older than now - cachedelay (" . $nowgmt . " - " . $cachedelay . "). Build is canceled"); |
|
| 147 | + dol_syslog("build_exportfile file ".$outputfile." is not older than now - cachedelay (".$nowgmt." - ".$cachedelay."). Build is canceled"); |
|
| 148 | 148 | $buildfile = false; |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -160,20 +160,20 @@ discard block |
||
| 160 | 160 | dolChmod($outputfiletmp); |
| 161 | 161 | |
| 162 | 162 | // Write file |
| 163 | - $result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost . '/wrapper.php?rss=1' . ($l ? '&l=' . $l : ''), $l); |
|
| 163 | + $result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l); |
|
| 164 | 164 | |
| 165 | 165 | if ($result >= 0) { |
| 166 | 166 | if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) { |
| 167 | 167 | $result = 1; |
| 168 | 168 | } else { |
| 169 | - $error = 'Failed to rename ' . $outputfiletmp . ' into ' . $outputfile; |
|
| 170 | - dol_syslog("build_exportfile " . $error, LOG_ERR); |
|
| 169 | + $error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile; |
|
| 170 | + dol_syslog("build_exportfile ".$error, LOG_ERR); |
|
| 171 | 171 | dol_delete_file($outputfiletmp, 0, 1); |
| 172 | 172 | print $error; |
| 173 | 173 | exit(-1); |
| 174 | 174 | } |
| 175 | 175 | } else { |
| 176 | - dol_syslog("build_exportfile build_xxxfile function fails to for format=" . $format . " outputfiletmp=" . $outputfile, LOG_ERR); |
|
| 176 | + dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR); |
|
| 177 | 177 | dol_delete_file($outputfiletmp, 0, 1); |
| 178 | 178 | $langs->load("errors"); |
| 179 | 179 | print $langs->trans("ErrorFailToCreateFile", $outputfile); |
@@ -195,26 +195,26 @@ discard block |
||
| 195 | 195 | $outputencoding = 'UTF-8'; |
| 196 | 196 | |
| 197 | 197 | if ($contenttype) { |
| 198 | - header('Content-Type: ' . $contenttype . ($outputencoding ? '; charset=' . $outputencoding : '')); |
|
| 198 | + header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : '')); |
|
| 199 | 199 | } |
| 200 | 200 | if ($attachment) { |
| 201 | - header('Content-Disposition: attachment; filename="' . $filename . '"'); |
|
| 201 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | // Ajout directives pour resoudre bug IE |
| 205 | 205 | //header('Cache-Control: Public, must-revalidate'); |
| 206 | 206 | //header('Pragma: public'); |
| 207 | 207 | if ($cachedelay) { |
| 208 | - header('Cache-Control: max-age=' . $cachedelay . ', private, must-revalidate'); |
|
| 208 | + header('Cache-Control: max-age='.$cachedelay.', private, must-revalidate'); |
|
| 209 | 209 | } else { |
| 210 | 210 | header('Cache-Control: private, must-revalidate'); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | // Clean parameters |
| 214 | - $outputfile = $dir_temp . '/' . $filename; |
|
| 214 | + $outputfile = $dir_temp.'/'.$filename; |
|
| 215 | 215 | $result = readfile($outputfile); |
| 216 | 216 | if (!$result) { |
| 217 | - print 'File ' . $outputfile . ' was empty.'; |
|
| 217 | + print 'File '.$outputfile.' was empty.'; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); |
@@ -222,10 +222,10 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | } elseif ($modulepart == "mycompany" && preg_match('/^\/?logos\//', $original_file)) { |
| 224 | 224 | // Get logos |
| 225 | - readfile(dol_osencode($conf->mycompany->dir_output . "/" . $original_file)); |
|
| 225 | + readfile(dol_osencode($conf->mycompany->dir_output."/".$original_file)); |
|
| 226 | 226 | } else { |
| 227 | 227 | // Find the subdirectory name as the reference |
| 228 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 228 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 229 | 229 | $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, null, $refname); |
| 230 | 230 | $accessallowed = empty($check_access['accessallowed']) ? '' : $check_access['accessallowed']; |
| 231 | 231 | $sqlprotectagainstexternals = empty($check_access['sqlprotectagainstexternals']) ? '' : $check_access['sqlprotectagainstexternals']; |
@@ -252,24 +252,24 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | // This test if file exists should be useless. We keep it to find bug more easily |
| 254 | 254 | if (!file_exists($fullpath_original_file_osencoded)) { |
| 255 | - print "ErrorFileDoesNotExists: " . dol_escape_htmltag($original_file); |
|
| 255 | + print "ErrorFileDoesNotExists: ".dol_escape_htmltag($original_file); |
|
| 256 | 256 | exit; |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | // Permissions are ok and file found, so we return it |
| 260 | 260 | //top_httphead($type); |
| 261 | - header('Content-Type: ' . $type); |
|
| 261 | + header('Content-Type: '.$type); |
|
| 262 | 262 | header('Content-Description: File Transfer'); |
| 263 | 263 | if ($encoding) { |
| 264 | - header('Content-Encoding: ' . $encoding); |
|
| 264 | + header('Content-Encoding: '.$encoding); |
|
| 265 | 265 | } |
| 266 | 266 | // Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open) |
| 267 | 267 | if ($attachment) { |
| 268 | - header('Content-Disposition: attachment; filename="' . $filename . '"'); |
|
| 268 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
| 269 | 269 | } else { |
| 270 | - header('Content-Disposition: inline; filename="' . $filename . '"'); |
|
| 270 | + header('Content-Disposition: inline; filename="'.$filename.'"'); |
|
| 271 | 271 | } |
| 272 | - header('Content-Length: ' . dol_filesize($fullpath_original_file)); |
|
| 272 | + header('Content-Length: '.dol_filesize($fullpath_original_file)); |
|
| 273 | 273 | |
| 274 | 274 | readfile($fullpath_original_file_osencoded); |
| 275 | 275 | } |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | 2 | $websitekey = basename(__DIR__); |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; |
|
| 4 | 4 | } // Load env if not already loaded |
| 5 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/website.lib.php'; |
|
| 6 | -require_once DOL_DOCUMENT_ROOT . '/core/website.inc.php'; |
|
| 5 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
|
| 6 | +require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
|
| 7 | 7 | ob_start(); |
| 8 | -if (! headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */ |
|
| 8 | +if (!headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */ |
|
| 9 | 9 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
| 10 | 10 | header('Content-type: text/css'); |
| 11 | 11 | } |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | 2 | $websitekey = basename(__DIR__); |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; |
|
| 4 | 4 | } // Load env if not already loaded |
| 5 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/website.lib.php'; |
|
| 6 | -require_once DOL_DOCUMENT_ROOT . '/core/website.inc.php'; |
|
| 5 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
|
| 6 | +require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
|
| 7 | 7 | ob_start(); |
| 8 | 8 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
| 9 | 9 | header('Content-type: application/javascript'); |
@@ -37,14 +37,14 @@ discard block |
||
| 37 | 37 | private static function getDataDir(string $dir): string |
| 38 | 38 | { |
| 39 | 39 | $dir = trim($dir, ' /'); |
| 40 | - $fullDir = realpath(BASE_PATH . '/../dolibarr_htdocs/install/' . $dir); |
|
| 40 | + $fullDir = realpath(BASE_PATH.'/../dolibarr_htdocs/install/'.$dir); |
|
| 41 | 41 | if (!file_exists(BASE_PATH)) { |
| 42 | - $fullDir = realpath(BASE_PATH . '/Install/' . $dir); |
|
| 42 | + $fullDir = realpath(BASE_PATH.'/Install/'.$dir); |
|
| 43 | 43 | } |
| 44 | 44 | if ($fullDir === false) { |
| 45 | - $fullDir = '/Install/' . $dir; |
|
| 45 | + $fullDir = '/Install/'.$dir; |
|
| 46 | 46 | } |
| 47 | - return $fullDir . '/'; |
|
| 47 | + return $fullDir.'/'; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | private function syslog($message, $level = LOG_DEBUG) |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $dolibarr_main_url_root = $_SERVER["SCRIPT_URI"]; |
| 98 | 98 | } elseif (isset($_SERVER["SERVER_URL"]) && isset($_SERVER["DOCUMENT_URI"])) { |
| 99 | 99 | // If defined (Ie: Apache with Caudium) |
| 100 | - $dolibarr_main_url_root = $_SERVER["SERVER_URL"] . $_SERVER["DOCUMENT_URI"]; |
|
| 100 | + $dolibarr_main_url_root = $_SERVER["SERVER_URL"].$_SERVER["DOCUMENT_URI"]; |
|
| 101 | 101 | } else { |
| 102 | 102 | // If SCRIPT_URI, SERVER_URL, DOCUMENT_URI not defined (Ie: Apache 2.0.44 for Windows) |
| 103 | 103 | $proto = ((!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') || (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443)) ? 'https' : 'http'; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } else { |
| 109 | 109 | $serverport = 'localhost'; |
| 110 | 110 | } |
| 111 | - $dolibarr_main_url_root = $proto . "://" . $serverport . $_SERVER["SCRIPT_NAME"]; |
|
| 111 | + $dolibarr_main_url_root = $proto."://".$serverport.$_SERVER["SCRIPT_NAME"]; |
|
| 112 | 112 | } |
| 113 | 113 | // Clean proposed URL |
| 114 | 114 | // We assume /install to be under /htdocs, so we get the parent path of the current URL |
@@ -154,9 +154,9 @@ discard block |
||
| 154 | 154 | $fp = @fopen("$mainfile", "w"); |
| 155 | 155 | if ($fp) { |
| 156 | 156 | clearstatcache(); |
| 157 | - fwrite($fp, '<?php' . "\n"); |
|
| 157 | + fwrite($fp, '<?php'."\n"); |
|
| 158 | 158 | fwrite($fp, "// Wrapper to include main into htdocs\n"); |
| 159 | - fwrite($fp, "include_once '" . $main_dir . "/main.inc.php';\n"); |
|
| 159 | + fwrite($fp, "include_once '".$main_dir."/main.inc.php';\n"); |
|
| 160 | 160 | fclose($fp); |
| 161 | 161 | } |
| 162 | 162 | } |
@@ -175,9 +175,9 @@ discard block |
||
| 175 | 175 | $fp = @fopen("$masterfile", "w"); |
| 176 | 176 | if ($fp) { |
| 177 | 177 | clearstatcache(); |
| 178 | - fwrite($fp, '<?php' . "\n"); |
|
| 178 | + fwrite($fp, '<?php'."\n"); |
|
| 179 | 179 | fwrite($fp, "// Wrapper to include master into htdocs\n"); |
| 180 | - fwrite($fp, "include_once '" . $main_dir . "/master.inc.php';\n"); |
|
| 180 | + fwrite($fp, "include_once '".$main_dir."/master.inc.php';\n"); |
|
| 181 | 181 | fclose($fp); |
| 182 | 182 | } |
| 183 | 183 | } |
@@ -232,9 +232,9 @@ discard block |
||
| 232 | 232 | if (@is_writable('/tmp')) { |
| 233 | 233 | define('SYSLOG_FILE', '/tmp/dolibarr_install.log'); |
| 234 | 234 | } elseif (!empty($_ENV["TMP"]) && @is_writable($_ENV["TMP"])) { |
| 235 | - define('SYSLOG_FILE', $_ENV["TMP"] . '/dolibarr_install.log'); |
|
| 235 | + define('SYSLOG_FILE', $_ENV["TMP"].'/dolibarr_install.log'); |
|
| 236 | 236 | } elseif (!empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"])) { |
| 237 | - define('SYSLOG_FILE', $_ENV["TEMP"] . '/dolibarr_install.log'); |
|
| 237 | + define('SYSLOG_FILE', $_ENV["TEMP"].'/dolibarr_install.log'); |
|
| 238 | 238 | } elseif (@is_writable('../../../../') && @file_exists('../../../../startdoliwamp.bat')) { |
| 239 | 239 | define('SYSLOG_FILE', '../../../../dolibarr_install.log'); // For DoliWamp |
| 240 | 240 | } elseif (@is_writable('../../')) { |
@@ -292,53 +292,53 @@ discard block |
||
| 292 | 292 | if ($fp) { |
| 293 | 293 | clearstatcache(); |
| 294 | 294 | |
| 295 | - fwrite($fp, '<?php' . "\n"); |
|
| 296 | - fwrite($fp, '//' . "\n"); |
|
| 297 | - fwrite($fp, '// File generated by Dolibarr installer ' . DOL_VERSION . ' on ' . Functions::dol_print_date(Functions::dol_now(), '') . "\n"); |
|
| 298 | - fwrite($fp, '//' . "\n"); |
|
| 299 | - fwrite($fp, '// Take a look at conf.php.example file for an example of ' . $conffile . ' file' . "\n"); |
|
| 300 | - fwrite($fp, '// and explanations for all possibles parameters.' . "\n"); |
|
| 301 | - fwrite($fp, '//' . "\n"); |
|
| 295 | + fwrite($fp, '<?php'."\n"); |
|
| 296 | + fwrite($fp, '//'."\n"); |
|
| 297 | + fwrite($fp, '// File generated by Dolibarr installer '.DOL_VERSION.' on '.Functions::dol_print_date(Functions::dol_now(), '')."\n"); |
|
| 298 | + fwrite($fp, '//'."\n"); |
|
| 299 | + fwrite($fp, '// Take a look at conf.php.example file for an example of '.$conffile.' file'."\n"); |
|
| 300 | + fwrite($fp, '// and explanations for all possibles parameters.'."\n"); |
|
| 301 | + fwrite($fp, '//'."\n"); |
|
| 302 | 302 | |
| 303 | - fwrite($fp, '$dolibarr_main_url_root=\'' . Functions::dol_escape_php(trim($this->main_url), 1) . '\';'); |
|
| 303 | + fwrite($fp, '$dolibarr_main_url_root=\''.Functions::dol_escape_php(trim($this->main_url), 1).'\';'); |
|
| 304 | 304 | fwrite($fp, "\n"); |
| 305 | 305 | |
| 306 | - fwrite($fp, '$dolibarr_main_document_root="' . Functions::dol_escape_php(Functions::dol_sanitizePathName(trim($this->main_dir))) . '";'); |
|
| 306 | + fwrite($fp, '$dolibarr_main_document_root="'.Functions::dol_escape_php(Functions::dol_sanitizePathName(trim($this->main_dir))).'";'); |
|
| 307 | 307 | fwrite($fp, "\n"); |
| 308 | 308 | |
| 309 | - fwrite($fp, $this->main_use_alt_dir . '$dolibarr_main_url_root_alt=\'' . Functions::dol_escape_php(trim("/" . $this->main_alt_dir_name), 1) . '\';'); |
|
| 309 | + fwrite($fp, $this->main_use_alt_dir.'$dolibarr_main_url_root_alt=\''.Functions::dol_escape_php(trim("/".$this->main_alt_dir_name), 1).'\';'); |
|
| 310 | 310 | fwrite($fp, "\n"); |
| 311 | 311 | |
| 312 | - fwrite($fp, $this->main_use_alt_dir . '$dolibarr_main_document_root_alt="' . Functions::dol_escape_php(Functions::dol_sanitizePathName(trim($this->main_dir . "/" . $this->main_alt_dir_name))) . '";'); |
|
| 312 | + fwrite($fp, $this->main_use_alt_dir.'$dolibarr_main_document_root_alt="'.Functions::dol_escape_php(Functions::dol_sanitizePathName(trim($this->main_dir."/".$this->main_alt_dir_name))).'";'); |
|
| 313 | 313 | fwrite($fp, "\n"); |
| 314 | 314 | |
| 315 | - fwrite($fp, '$dolibarr_main_data_root="' . Functions::dol_escape_php(Functions::dol_sanitizePathName(trim($this->main_data_dir))) . '";'); |
|
| 315 | + fwrite($fp, '$dolibarr_main_data_root="'.Functions::dol_escape_php(Functions::dol_sanitizePathName(trim($this->main_data_dir))).'";'); |
|
| 316 | 316 | fwrite($fp, "\n"); |
| 317 | 317 | |
| 318 | - fwrite($fp, '$dolibarr_main_db_host=\'' . Functions::dol_escape_php(trim($this->db_host), 1) . '\';'); |
|
| 318 | + fwrite($fp, '$dolibarr_main_db_host=\''.Functions::dol_escape_php(trim($this->db_host), 1).'\';'); |
|
| 319 | 319 | fwrite($fp, "\n"); |
| 320 | 320 | |
| 321 | - fwrite($fp, '$dolibarr_main_db_port=\'' . ((int) $this->db_port) . '\';'); |
|
| 321 | + fwrite($fp, '$dolibarr_main_db_port=\''.((int) $this->db_port).'\';'); |
|
| 322 | 322 | fwrite($fp, "\n"); |
| 323 | 323 | |
| 324 | - fwrite($fp, '$dolibarr_main_db_name=\'' . Functions::dol_escape_php(trim($this->db_name), 1) . '\';'); |
|
| 324 | + fwrite($fp, '$dolibarr_main_db_name=\''.Functions::dol_escape_php(trim($this->db_name), 1).'\';'); |
|
| 325 | 325 | fwrite($fp, "\n"); |
| 326 | 326 | |
| 327 | - fwrite($fp, '$dolibarr_main_db_prefix=\'' . Functions::dol_escape_php(trim($this->db_prefix), 1) . '\';'); |
|
| 327 | + fwrite($fp, '$dolibarr_main_db_prefix=\''.Functions::dol_escape_php(trim($this->db_prefix), 1).'\';'); |
|
| 328 | 328 | fwrite($fp, "\n"); |
| 329 | 329 | |
| 330 | - fwrite($fp, '$dolibarr_main_db_user=\'' . Functions::dol_escape_php(trim($this->db_user), 1) . '\';'); |
|
| 330 | + fwrite($fp, '$dolibarr_main_db_user=\''.Functions::dol_escape_php(trim($this->db_user), 1).'\';'); |
|
| 331 | 331 | fwrite($fp, "\n"); |
| 332 | - fwrite($fp, '$dolibarr_main_db_pass=\'' . Functions::dol_escape_php(trim($this->db_pass), 1) . '\';'); |
|
| 332 | + fwrite($fp, '$dolibarr_main_db_pass=\''.Functions::dol_escape_php(trim($this->db_pass), 1).'\';'); |
|
| 333 | 333 | fwrite($fp, "\n"); |
| 334 | 334 | |
| 335 | - fwrite($fp, '$dolibarr_main_db_type=\'' . Functions::dol_escape_php(trim($this->db_type), 1) . '\';'); |
|
| 335 | + fwrite($fp, '$dolibarr_main_db_type=\''.Functions::dol_escape_php(trim($this->db_type), 1).'\';'); |
|
| 336 | 336 | fwrite($fp, "\n"); |
| 337 | 337 | |
| 338 | - fwrite($fp, '$dolibarr_main_db_character_set=\'' . Functions::dol_escape_php(trim($this->db_character_set), 1) . '\';'); |
|
| 338 | + fwrite($fp, '$dolibarr_main_db_character_set=\''.Functions::dol_escape_php(trim($this->db_character_set), 1).'\';'); |
|
| 339 | 339 | fwrite($fp, "\n"); |
| 340 | 340 | |
| 341 | - fwrite($fp, '$dolibarr_main_db_collation=\'' . Functions::dol_escape_php(trim($this->db_collation), 1) . '\';'); |
|
| 341 | + fwrite($fp, '$dolibarr_main_db_collation=\''.Functions::dol_escape_php(trim($this->db_collation), 1).'\';'); |
|
| 342 | 342 | fwrite($fp, "\n"); |
| 343 | 343 | |
| 344 | 344 | // Authentication |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | fwrite($fp, '$dolibarr_main_prod=\'0\';'); |
| 358 | 358 | fwrite($fp, "\n"); |
| 359 | 359 | |
| 360 | - fwrite($fp, '$dolibarr_main_force_https=\'' . Functions::dol_escape_php($this->main_force_https, 1) . '\';'); |
|
| 360 | + fwrite($fp, '$dolibarr_main_force_https=\''.Functions::dol_escape_php($this->main_force_https, 1).'\';'); |
|
| 361 | 361 | fwrite($fp, "\n"); |
| 362 | 362 | |
| 363 | 363 | fwrite($fp, '$dolibarr_main_restrict_os_commands=\'mariadb-dump, mariadb, mysqldump, mysql, pg_dump, pgrestore, clamdscan, clamscan.exe\';'); |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | fwrite($fp, '$dolibarr_nocsrfcheck=\'0\';'); |
| 367 | 367 | fwrite($fp, "\n"); |
| 368 | 368 | |
| 369 | - fwrite($fp, '$dolibarr_main_instance_unique_id=\'' . Functions::dol_escape_php($key, 1) . '\';'); |
|
| 369 | + fwrite($fp, '$dolibarr_main_instance_unique_id=\''.Functions::dol_escape_php($key, 1).'\';'); |
|
| 370 | 370 | fwrite($fp, "\n"); |
| 371 | 371 | |
| 372 | 372 | fwrite($fp, '$dolibarr_mailing_limit_sendbyweb=\'0\';'); |
@@ -380,67 +380,67 @@ discard block |
||
| 380 | 380 | fwrite($fp, '//'); |
| 381 | 381 | $force_dolibarr_lib_FPDF_PATH = ''; |
| 382 | 382 | } |
| 383 | - fwrite($fp, '$dolibarr_lib_FPDF_PATH="' . Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_FPDF_PATH)) . '";'); |
|
| 383 | + fwrite($fp, '$dolibarr_lib_FPDF_PATH="'.Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_FPDF_PATH)).'";'); |
|
| 384 | 384 | fwrite($fp, "\n"); |
| 385 | 385 | if (empty($force_dolibarr_lib_TCPDF_PATH)) { |
| 386 | 386 | fwrite($fp, '//'); |
| 387 | 387 | $force_dolibarr_lib_TCPDF_PATH = ''; |
| 388 | 388 | } |
| 389 | - fwrite($fp, '$dolibarr_lib_TCPDF_PATH="' . Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_TCPDF_PATH)) . '";'); |
|
| 389 | + fwrite($fp, '$dolibarr_lib_TCPDF_PATH="'.Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_TCPDF_PATH)).'";'); |
|
| 390 | 390 | fwrite($fp, "\n"); |
| 391 | 391 | if (empty($force_dolibarr_lib_FPDI_PATH)) { |
| 392 | 392 | fwrite($fp, '//'); |
| 393 | 393 | $force_dolibarr_lib_FPDI_PATH = ''; |
| 394 | 394 | } |
| 395 | - fwrite($fp, '$dolibarr_lib_FPDI_PATH="' . Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_FPDI_PATH)) . '";'); |
|
| 395 | + fwrite($fp, '$dolibarr_lib_FPDI_PATH="'.Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_FPDI_PATH)).'";'); |
|
| 396 | 396 | fwrite($fp, "\n"); |
| 397 | 397 | if (empty($force_dolibarr_lib_TCPDI_PATH)) { |
| 398 | 398 | fwrite($fp, '//'); |
| 399 | 399 | $force_dolibarr_lib_TCPDI_PATH = ''; |
| 400 | 400 | } |
| 401 | - fwrite($fp, '$dolibarr_lib_TCPDI_PATH="' . Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_TCPDI_PATH)) . '";'); |
|
| 401 | + fwrite($fp, '$dolibarr_lib_TCPDI_PATH="'.Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_TCPDI_PATH)).'";'); |
|
| 402 | 402 | fwrite($fp, "\n"); |
| 403 | 403 | if (empty($force_dolibarr_lib_GEOIP_PATH)) { |
| 404 | 404 | fwrite($fp, '//'); |
| 405 | 405 | $force_dolibarr_lib_GEOIP_PATH = ''; |
| 406 | 406 | } |
| 407 | - fwrite($fp, '$dolibarr_lib_GEOIP_PATH="' . Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_GEOIP_PATH)) . '";'); |
|
| 407 | + fwrite($fp, '$dolibarr_lib_GEOIP_PATH="'.Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_GEOIP_PATH)).'";'); |
|
| 408 | 408 | fwrite($fp, "\n"); |
| 409 | 409 | if (empty($force_dolibarr_lib_NUSOAP_PATH)) { |
| 410 | 410 | fwrite($fp, '//'); |
| 411 | 411 | $force_dolibarr_lib_NUSOAP_PATH = ''; |
| 412 | 412 | } |
| 413 | - fwrite($fp, '$dolibarr_lib_NUSOAP_PATH="' . Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_NUSOAP_PATH)) . '";'); |
|
| 413 | + fwrite($fp, '$dolibarr_lib_NUSOAP_PATH="'.Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_NUSOAP_PATH)).'";'); |
|
| 414 | 414 | fwrite($fp, "\n"); |
| 415 | 415 | if (empty($force_dolibarr_lib_ODTPHP_PATH)) { |
| 416 | 416 | fwrite($fp, '//'); |
| 417 | 417 | $force_dolibarr_lib_ODTPHP_PATH = ''; |
| 418 | 418 | } |
| 419 | - fwrite($fp, '$dolibarr_lib_ODTPHP_PATH="' . Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_ODTPHP_PATH)) . '";'); |
|
| 419 | + fwrite($fp, '$dolibarr_lib_ODTPHP_PATH="'.Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_ODTPHP_PATH)).'";'); |
|
| 420 | 420 | fwrite($fp, "\n"); |
| 421 | 421 | if (empty($force_dolibarr_lib_ODTPHP_PATHTOPCLZIP)) { |
| 422 | 422 | fwrite($fp, '//'); |
| 423 | 423 | $force_dolibarr_lib_ODTPHP_PATHTOPCLZIP = ''; |
| 424 | 424 | } |
| 425 | - fwrite($fp, '$dolibarr_lib_ODTPHP_PATHTOPCLZIP="' . Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_ODTPHP_PATHTOPCLZIP)) . '";'); |
|
| 425 | + fwrite($fp, '$dolibarr_lib_ODTPHP_PATHTOPCLZIP="'.Functions::dol_escape_php(Functions::dol_sanitizePathName($force_dolibarr_lib_ODTPHP_PATHTOPCLZIP)).'";'); |
|
| 426 | 426 | fwrite($fp, "\n"); |
| 427 | 427 | if (empty($force_dolibarr_js_CKEDITOR)) { |
| 428 | 428 | fwrite($fp, '//'); |
| 429 | 429 | $force_dolibarr_js_CKEDITOR = ''; |
| 430 | 430 | } |
| 431 | - fwrite($fp, '$dolibarr_js_CKEDITOR=\'' . Functions::dol_escape_php($force_dolibarr_js_CKEDITOR, 1) . '\';'); |
|
| 431 | + fwrite($fp, '$dolibarr_js_CKEDITOR=\''.Functions::dol_escape_php($force_dolibarr_js_CKEDITOR, 1).'\';'); |
|
| 432 | 432 | fwrite($fp, "\n"); |
| 433 | 433 | if (empty($force_dolibarr_js_JQUERY)) { |
| 434 | 434 | fwrite($fp, '//'); |
| 435 | 435 | $force_dolibarr_js_JQUERY = ''; |
| 436 | 436 | } |
| 437 | - fwrite($fp, '$dolibarr_js_JQUERY=\'' . Functions::dol_escape_php($force_dolibarr_js_JQUERY, 1) . '\';'); |
|
| 437 | + fwrite($fp, '$dolibarr_js_JQUERY=\''.Functions::dol_escape_php($force_dolibarr_js_JQUERY, 1).'\';'); |
|
| 438 | 438 | fwrite($fp, "\n"); |
| 439 | 439 | if (empty($force_dolibarr_js_JQUERY_UI)) { |
| 440 | 440 | fwrite($fp, '//'); |
| 441 | 441 | $force_dolibarr_js_JQUERY_UI = ''; |
| 442 | 442 | } |
| 443 | - fwrite($fp, '$dolibarr_js_JQUERY_UI=\'' . Functions::dol_escape_php($force_dolibarr_js_JQUERY_UI, 1) . '\';'); |
|
| 443 | + fwrite($fp, '$dolibarr_js_JQUERY_UI=\''.Functions::dol_escape_php($force_dolibarr_js_JQUERY_UI, 1).'\';'); |
|
| 444 | 444 | fwrite($fp, "\n"); |
| 445 | 445 | |
| 446 | 446 | // Write params to overwrites default font path |
@@ -449,17 +449,17 @@ discard block |
||
| 449 | 449 | fwrite($fp, '//'); |
| 450 | 450 | $force_dolibarr_font_DOL_DEFAULT_TTF = ''; |
| 451 | 451 | } |
| 452 | - fwrite($fp, '$dolibarr_font_DOL_DEFAULT_TTF=\'' . Functions::dol_escape_php($force_dolibarr_font_DOL_DEFAULT_TTF, 1) . '\';'); |
|
| 452 | + fwrite($fp, '$dolibarr_font_DOL_DEFAULT_TTF=\''.Functions::dol_escape_php($force_dolibarr_font_DOL_DEFAULT_TTF, 1).'\';'); |
|
| 453 | 453 | fwrite($fp, "\n"); |
| 454 | 454 | if (empty($force_dolibarr_font_DOL_DEFAULT_TTF_BOLD)) { |
| 455 | 455 | fwrite($fp, '//'); |
| 456 | 456 | $force_dolibarr_font_DOL_DEFAULT_TTF_BOLD = ''; |
| 457 | 457 | } |
| 458 | - fwrite($fp, '$dolibarr_font_DOL_DEFAULT_TTF_BOLD=\'' . Functions::dol_escape_php($force_dolibarr_font_DOL_DEFAULT_TTF_BOLD, 1) . '\';'); |
|
| 458 | + fwrite($fp, '$dolibarr_font_DOL_DEFAULT_TTF_BOLD=\''.Functions::dol_escape_php($force_dolibarr_font_DOL_DEFAULT_TTF_BOLD, 1).'\';'); |
|
| 459 | 459 | fwrite($fp, "\n"); |
| 460 | 460 | |
| 461 | 461 | // Other |
| 462 | - fwrite($fp, '$dolibarr_main_distrib=\'' . Functions::dol_escape_php(trim($this->dolibarr_main_distrib), 1) . '\';'); |
|
| 462 | + fwrite($fp, '$dolibarr_main_distrib=\''.Functions::dol_escape_php(trim($this->dolibarr_main_distrib), 1).'\';'); |
|
| 463 | 463 | fwrite($fp, "\n"); |
| 464 | 464 | |
| 465 | 465 | fclose($fp); |
@@ -510,11 +510,11 @@ discard block |
||
| 510 | 510 | $result['text'] = $this->lang->trans("ErrorPHPVersionTooLow", Admin::versiontostring($arrayphpminversionwarning)); |
| 511 | 511 | } else { |
| 512 | 512 | $result['icon'] = 'ok'; |
| 513 | - $result['text'] = $this->lang->trans("PHPVersion") . " " . Admin::versiontostring(Admin::versionphparray()); |
|
| 513 | + $result['text'] = $this->lang->trans("PHPVersion")." ".Admin::versiontostring(Admin::versionphparray()); |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (empty($force_install_nophpinfo)) { |
| 517 | - $result['text'] .= ' (<a href="phpinfo.php" target="_blank" rel="noopener noreferrer">' . $this->lang->trans("MoreInformation") . '</a>)'; |
|
| 517 | + $result['text'] .= ' (<a href="phpinfo.php" target="_blank" rel="noopener noreferrer">'.$this->lang->trans("MoreInformation").'</a>)'; |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | return $result; |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | $result['ok'] = true; |
| 541 | 541 | if (empty($_GET) || empty($_POST)) { // We must keep $_GET and $_POST here |
| 542 | 542 | $result['icon'] = 'warning'; |
| 543 | - $result['text'] = $this->lang->trans("PHPSupportPOSTGETKo") . ' (<a href="' . Functions::dol_escape_htmltag($_SERVER["PHP_SELF"]) . '?testget=ok">' . $this->lang->trans("Recheck") . '</a>)'; |
|
| 543 | + $result['text'] = $this->lang->trans("PHPSupportPOSTGETKo").' (<a href="'.Functions::dol_escape_htmltag($_SERVER["PHP_SELF"]).'?testget=ok">'.$this->lang->trans("Recheck").'</a>)'; |
|
| 544 | 544 | } else { |
| 545 | 545 | $result['icon'] = 'ok'; |
| 546 | 546 | $result['text'] = $this->lang->trans("PHPSupportPOSTGETOk"); |
@@ -751,22 +751,22 @@ discard block |
||
| 751 | 751 | |
| 752 | 752 | clearstatcache(); |
| 753 | 753 | if (is_readable($conffile) && filesize($conffile) > 8) { |
| 754 | - $this->syslog("check: conf file '" . $conffile . "' already defined"); |
|
| 754 | + $this->syslog("check: conf file '".$conffile."' already defined"); |
|
| 755 | 755 | return false; |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | // If not, we create it |
| 759 | - $this->syslog("check: we try to create conf file '" . $conffile . "'"); |
|
| 759 | + $this->syslog("check: we try to create conf file '".$conffile."'"); |
|
| 760 | 760 | |
| 761 | 761 | // First we try by copying example |
| 762 | - if (@copy($conffile . ".example", $conffile)) { |
|
| 762 | + if (@copy($conffile.".example", $conffile)) { |
|
| 763 | 763 | // Success |
| 764 | - $this->syslog("check: successfully copied file " . $conffile . ".example into " . $conffile); |
|
| 764 | + $this->syslog("check: successfully copied file ".$conffile.".example into ".$conffile); |
|
| 765 | 765 | return false; |
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | // If failed, we try to create an empty file |
| 769 | - $this->syslog("check: failed to copy file " . $conffile . ".example into " . $conffile . ". We try to create it.", LOG_WARNING); |
|
| 769 | + $this->syslog("check: failed to copy file ".$conffile.".example into ".$conffile.". We try to create it.", LOG_WARNING); |
|
| 770 | 770 | |
| 771 | 771 | $fp = @fopen($conffile, "w"); |
| 772 | 772 | if ($fp) { |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | return false; |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | - $this->syslog("check: failed to create a new file " . $conffile . " into current dir " . getcwd() . ". Please check permissions.", LOG_ERR); |
|
| 779 | + $this->syslog("check: failed to create a new file ".$conffile." into current dir ".getcwd().". Please check permissions.", LOG_ERR); |
|
| 780 | 780 | $result = []; |
| 781 | 781 | $result['ok'] = false; |
| 782 | 782 | $result['icon'] = 'error'; |
@@ -808,8 +808,8 @@ discard block |
||
| 808 | 808 | |
| 809 | 809 | private function getMigrationScript() |
| 810 | 810 | { |
| 811 | - $dir = static::getDataDir('mysql/migration'); // We use mysql migration scripts whatever is database driver |
|
| 812 | - $this->dolibarr_install_syslog("Scan sql files for migration files in " . $dir); |
|
| 811 | + $dir = static::getDataDir('mysql/migration'); // We use mysql migration scripts whatever is database driver |
|
| 812 | + $this->dolibarr_install_syslog("Scan sql files for migration files in ".$dir); |
|
| 813 | 813 | |
| 814 | 814 | // Get files list of migration file x.y.z-a.b.c.sql into /install/mysql/migration |
| 815 | 815 | $migrationscript = []; |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | // If password is encoded, we decode it |
| 850 | 850 | // TODO: Pending |
| 851 | 851 | if (preg_match('/crypted:/i', $this->config->main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { |
| 852 | - require_once $this->dolibarr_main_document_root . '/core/lib/security.lib.php'; |
|
| 852 | + require_once $this->dolibarr_main_document_root.'/core/lib/security.lib.php'; |
|
| 853 | 853 | if (preg_match('/crypted:/i', $this->config->main_db_pass)) { |
| 854 | 854 | $dolibarr_main_db_encrypted_pass = preg_replace('/crypted:/i', '', $this->config->main_db_pass); // We need to set this as it is used to know the password was initially encrypted |
| 855 | 855 | $this->config->main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass); |
@@ -909,8 +909,8 @@ discard block |
||
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | $button = $this->allowInstall |
| 912 | - ? '<input class="button" type="submit" name="action" value="' . $this->lang->trans("Start") . '">' |
|
| 913 | - : ($foundrecommandedchoice ? '<span class="warning">' : '') . $this->lang->trans("InstallNotAllowed") . ($foundrecommandedchoice ? '</span>' : ''); |
|
| 912 | + ? '<input class="button" type="submit" name="action" value="'.$this->lang->trans("Start").'">' |
|
| 913 | + : ($foundrecommandedchoice ? '<span class="warning">' : '').$this->lang->trans("InstallNotAllowed").($foundrecommandedchoice ? '</span>' : ''); |
|
| 914 | 914 | |
| 915 | 915 | // Show line of first install choice |
| 916 | 916 | $choice = [ |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | ]; |
| 923 | 923 | |
| 924 | 924 | if (!isset($this->config->main_db_host) || empty($this->config->main_db_host)) { |
| 925 | - $choice['long'] .= '<br><div class="center"><div class="ok suggestedchoice">' . $this->lang->trans("InstallChoiceSuggested") . '</div></div>'; |
|
| 925 | + $choice['long'] .= '<br><div class="center"><div class="ok suggestedchoice">'.$this->lang->trans("InstallChoiceSuggested").'</div></div>'; |
|
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | $positionkey = ($foundrecommandedchoice ? 999 : 0); |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | $newversionto = preg_replace('/(\.[0-9]+)$/i', '.*', $versionto); |
| 965 | 965 | $newversionfrombis = ''; |
| 966 | 966 | if (Admin::versioncompare($dolibarrversiontoarray, $versionarray) < -2) { // From x.y.z -> x.y.z+1 |
| 967 | - $newversionfrombis = ' ' . $this->lang->trans("or") . ' ' . $versionto; |
|
| 967 | + $newversionfrombis = ' '.$this->lang->trans("or").' '.$versionto; |
|
| 968 | 968 | } |
| 969 | 969 | |
| 970 | 970 | if ($ok) { |
@@ -993,23 +993,23 @@ discard block |
||
| 993 | 993 | $foundrecommandedchoice = 2; |
| 994 | 994 | } |
| 995 | 995 | if ($disabled) { |
| 996 | - $button = '<span class="opacitymedium">' . $this->lang->trans("NotYetAvailable") . '</span>'; |
|
| 996 | + $button = '<span class="opacitymedium">'.$this->lang->trans("NotYetAvailable").'</span>'; |
|
| 997 | 997 | } else { |
| 998 | 998 | // TODO: Pending fix how to pass the version in an action |
| 999 | - $button = '<a class="button runupgrade" href="upgrade.php?action=upgrade' . ($count < count($migrationscript) ? '_' . $versionto : '') . '&selectlang=' . $this->selectLang . '&versionfrom=' . $versionfrom . '&versionto=' . $versionto . '">' . $this->lang->trans("Start") . '</a>'; |
|
| 999 | + $button = '<a class="button runupgrade" href="upgrade.php?action=upgrade'.($count < count($migrationscript) ? '_'.$versionto : '').'&selectlang='.$this->selectLang.'&versionfrom='.$versionfrom.'&versionto='.$versionto.'">'.$this->lang->trans("Start").'</a>'; |
|
| 1000 | 1000 | } |
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | 1003 | $choice = [ |
| 1004 | 1004 | 'selected' => $recommended_choice, |
| 1005 | - 'short' => $this->lang->trans("Upgrade") . '<br>' . $newversionfrom . $newversionfrombis . ' -> ' . $newversionto, |
|
| 1005 | + 'short' => $this->lang->trans("Upgrade").'<br>'.$newversionfrom.$newversionfrombis.' -> '.$newversionto, |
|
| 1006 | 1006 | 'long' => $this->lang->trans("UpgradeDesc"), |
| 1007 | 1007 | 'active' => $this->allowInstall, |
| 1008 | 1008 | 'button' => $button, |
| 1009 | 1009 | ]; |
| 1010 | 1010 | |
| 1011 | 1011 | if ($recommended_choice) { |
| 1012 | - $choice['long'] .= '<br><div class="center"><div class="ok suggestedchoice">' . $this->lang->trans("InstallChoiceSuggested") . '</div>'; |
|
| 1012 | + $choice['long'] .= '<br><div class="center"><div class="ok suggestedchoice">'.$this->lang->trans("InstallChoiceSuggested").'</div>'; |
|
| 1013 | 1013 | if ($count < count($migarray)) { |
| 1014 | 1014 | $choice['long'] .= $this->lang->trans('MigrateIsDoneStepByStep', DOL_VERSION); |
| 1015 | 1015 | } |
@@ -1046,21 +1046,21 @@ discard block |
||
| 1046 | 1046 | private function getDbTypes() |
| 1047 | 1047 | { |
| 1048 | 1048 | $options = []; |
| 1049 | - $dir = realpath(BASE_PATH . '/../Core/DB/Engines'); |
|
| 1049 | + $dir = realpath(BASE_PATH.'/../Core/DB/Engines'); |
|
| 1050 | 1050 | $handle = opendir($dir); |
| 1051 | 1051 | if (is_resource($handle)) { |
| 1052 | 1052 | while (($file = readdir($handle)) !== false) { |
| 1053 | - if (is_readable($dir . "/" . $file) && substr($file, -10) === 'Engine.php') { |
|
| 1053 | + if (is_readable($dir."/".$file) && substr($file, -10) === 'Engine.php') { |
|
| 1054 | 1054 | $shortName = substr($file, 0, -10); |
| 1055 | 1055 | $className = substr($file, 0, -4); |
| 1056 | 1056 | if ($className === 'Sqlite3Engine') { |
| 1057 | 1057 | continue; // We hide sqlite3 because support can't be complete until sqlite does not manage foreign key creation after table creation (ALTER TABLE child ADD CONSTRAINT not supported) |
| 1058 | 1058 | } |
| 1059 | 1059 | |
| 1060 | - $class = 'Alxarafe\\DB\\Engines\\' . $className; |
|
| 1060 | + $class = 'Alxarafe\\DB\\Engines\\'.$className; |
|
| 1061 | 1061 | |
| 1062 | 1062 | // Version min of database |
| 1063 | - $note = '(' . $class::LABEL . ' >= ' . $class::VERSIONMIN . ')'; |
|
| 1063 | + $note = '('.$class::LABEL.' >= '.$class::VERSIONMIN.')'; |
|
| 1064 | 1064 | |
| 1065 | 1065 | if ($file == 'MySqliEngine.php') { |
| 1066 | 1066 | $oldname = 'mysqli'; |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | |
| 1074 | 1074 | $comment = ''; |
| 1075 | 1075 | if (!function_exists($testfunction)) { |
| 1076 | - $comment = ' - ' . $this->lang->trans("FunctionNotAvailableInThisPHP"); |
|
| 1076 | + $comment = ' - '.$this->lang->trans("FunctionNotAvailableInThisPHP"); |
|
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | $options[] = [ |
@@ -1176,7 +1176,7 @@ discard block |
||
| 1176 | 1176 | if (!file_exists($conffile)) { |
| 1177 | 1177 | $text = $this->lang->trans('YouMustCreateWithPermission', $conffile); |
| 1178 | 1178 | $text .= '<br><br>'; |
| 1179 | - $text .= '<span class="opacitymedium">' . $this->lang->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'] . '?testget=ok') . '</span>'; |
|
| 1179 | + $text .= '<span class="opacitymedium">'.$this->lang->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').'</span>'; |
|
| 1180 | 1180 | |
| 1181 | 1181 | $this->checks[] = [ |
| 1182 | 1182 | 'icon' => 'error', |
@@ -1334,7 +1334,7 @@ discard block |
||
| 1334 | 1334 | // Dolibarr pages directory |
| 1335 | 1335 | $this->main_dir = Functions::GETPOST('main_dir') ? Functions::GETPOST('main_dir') : (empty($argv[3]) ? '' : $argv[3]); |
| 1336 | 1336 | // Directory for generated documents (invoices, orders, ecm, etc...) |
| 1337 | - $this->main_data_dir = Functions::GETPOST('main_data_dir') ? Functions::GETPOST('main_data_dir') : (empty($argv[4]) ? ($this->main_dir . '/documents') : $argv[4]); |
|
| 1337 | + $this->main_data_dir = Functions::GETPOST('main_data_dir') ? Functions::GETPOST('main_data_dir') : (empty($argv[4]) ? ($this->main_dir.'/documents') : $argv[4]); |
|
| 1338 | 1338 | // Dolibarr root URL |
| 1339 | 1339 | $this->main_url = Functions::GETPOST('main_url') ? Functions::GETPOST('main_url') : (empty($argv[5]) ? '' : $argv[5]); |
| 1340 | 1340 | // Database login information |
@@ -1507,7 +1507,7 @@ discard block |
||
| 1507 | 1507 | $this->main_url = substr($this->main_url, 0, Functions::dol_strlen($this->main_url) - 1); |
| 1508 | 1508 | } |
| 1509 | 1509 | |
| 1510 | - $enginesDir = realpath(BASE_PATH . '/../Core/DB/Engines') . '/'; |
|
| 1510 | + $enginesDir = realpath(BASE_PATH.'/../Core/DB/Engines').'/'; |
|
| 1511 | 1511 | if (!Files::dol_is_dir($enginesDir)) { |
| 1512 | 1512 | $errors[] = $this->lang->trans("ErrorBadValueForParameter", $this->main_dir, $this->lang->transnoentitiesnoconv("WebPagesDirectory")); |
| 1513 | 1513 | } |
@@ -1520,19 +1520,19 @@ discard block |
||
| 1520 | 1520 | // If we require database or user creation we need to connect as root, so we need root login credentials |
| 1521 | 1521 | if (!empty($this->db_create_database) && !$userroot) { |
| 1522 | 1522 | print ' |
| 1523 | - <div class="error">' . $this->lang->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect", $this->db_name) . '</div> |
|
| 1523 | + <div class="error">' . $this->lang->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect", $this->db_name).'</div> |
|
| 1524 | 1524 | '; |
| 1525 | 1525 | print '<br>'; |
| 1526 | - print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong") . '<br><br>'; |
|
| 1526 | + print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>'; |
|
| 1527 | 1527 | print $this->lang->trans("ErrorGoBackAndCorrectParameters"); |
| 1528 | 1528 | $error++; |
| 1529 | 1529 | } |
| 1530 | 1530 | if (!empty($this->db_create_user) && !$userroot) { |
| 1531 | 1531 | print ' |
| 1532 | - <div class="error">' . $this->lang->trans("YouAskLoginCreationSoDolibarrNeedToConnect", $this->db_user) . '</div> |
|
| 1532 | + <div class="error">' . $this->lang->trans("YouAskLoginCreationSoDolibarrNeedToConnect", $this->db_user).'</div> |
|
| 1533 | 1533 | '; |
| 1534 | 1534 | print '<br>'; |
| 1535 | - print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong") . '<br><br>'; |
|
| 1535 | + print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>'; |
|
| 1536 | 1536 | print $this->lang->trans("ErrorGoBackAndCorrectParameters"); |
| 1537 | 1537 | $error++; |
| 1538 | 1538 | } |
@@ -1552,16 +1552,16 @@ discard block |
||
| 1552 | 1552 | |
| 1553 | 1553 | $db = Functions::getDoliDBInstance($this->db_type, $this->db_host, $userroot, $passroot, $databasefortest, (int) $this->db_port); |
| 1554 | 1554 | |
| 1555 | - Functions::dol_syslog("databasefortest=" . $databasefortest . " connected=" . DB::$connected . " database_selected=" . $db->database_selected, LOG_DEBUG); |
|
| 1555 | + Functions::dol_syslog("databasefortest=".$databasefortest." connected=".DB::$connected." database_selected=".$db->database_selected, LOG_DEBUG); |
|
| 1556 | 1556 | //print "databasefortest=".$databasefortest." connected=".DB::$connected." database_selected=".$db->database_selected; |
| 1557 | 1557 | |
| 1558 | 1558 | if (empty($this->db_create_database) && DB::$connected && !$db->database_selected) { |
| 1559 | 1559 | print ' |
| 1560 | - <div class="error">' . $this->lang->trans("ErrorConnectedButDatabaseNotFound", $this->db_name) . '</div> |
|
| 1560 | + <div class="error">' . $this->lang->trans("ErrorConnectedButDatabaseNotFound", $this->db_name).'</div> |
|
| 1561 | 1561 | '; |
| 1562 | 1562 | print '<br>'; |
| 1563 | 1563 | if (!DB::$connected) { |
| 1564 | - print $this->lang->trans("IfDatabaseNotExistsGoBackAndUncheckCreate") . '<br><br>'; |
|
| 1564 | + print $this->lang->trans("IfDatabaseNotExistsGoBackAndUncheckCreate").'<br><br>'; |
|
| 1565 | 1565 | } |
| 1566 | 1566 | print $this->lang->trans("ErrorGoBackAndCorrectParameters"); |
| 1567 | 1567 | $error++; |
@@ -1569,15 +1569,15 @@ discard block |
||
| 1569 | 1569 | // Note: you may experience error here with message "No such file or directory" when mysql was installed for the first time but not yet launched. |
| 1570 | 1570 | if ($db->error == "No such file or directory") { |
| 1571 | 1571 | print ' |
| 1572 | - <div class="error">' . $this->lang->trans("ErrorToConnectToMysqlCheckInstance") . '</div> |
|
| 1572 | + <div class="error">' . $this->lang->trans("ErrorToConnectToMysqlCheckInstance").'</div> |
|
| 1573 | 1573 | '; |
| 1574 | 1574 | } else { |
| 1575 | 1575 | print ' |
| 1576 | - <div class="error">' . $db->error . '</div> |
|
| 1576 | + <div class="error">' . $db->error.'</div> |
|
| 1577 | 1577 | '; |
| 1578 | 1578 | } |
| 1579 | 1579 | if (!DB::$connected) { |
| 1580 | - print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong") . '<br><br>'; |
|
| 1580 | + print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>'; |
|
| 1581 | 1581 | } |
| 1582 | 1582 | //print '<a href="#" onClick="javascript: history.back();">'; |
| 1583 | 1583 | print $this->lang->trans("ErrorGoBackAndCorrectParameters"); |
@@ -1592,10 +1592,10 @@ discard block |
||
| 1592 | 1592 | |
| 1593 | 1593 | if ($db->error) { |
| 1594 | 1594 | print ' |
| 1595 | - <div class="error">' . $db->error . '</div> |
|
| 1595 | + <div class="error">' . $db->error.'</div> |
|
| 1596 | 1596 | '; |
| 1597 | 1597 | if (!DB::$connected) { |
| 1598 | - print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong") . '<br><br>'; |
|
| 1598 | + print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>'; |
|
| 1599 | 1599 | } |
| 1600 | 1600 | //print '<a href="#" onClick="javascript: history.back();">'; |
| 1601 | 1601 | print $this->lang->trans("ErrorGoBackAndCorrectParameters"); |
@@ -1608,7 +1608,7 @@ discard block |
||
| 1608 | 1608 | print $db->lasterror(); |
| 1609 | 1609 | } |
| 1610 | 1610 | if (isset($db) && !DB::$connected) { |
| 1611 | - print '<br>' . $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong") . '<br><br>'; |
|
| 1611 | + print '<br>'.$this->lang->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>'; |
|
| 1612 | 1612 | } |
| 1613 | 1613 | print $this->lang->trans("ErrorGoBackAndCorrectParameters"); |
| 1614 | 1614 | $error++; |
@@ -1618,8 +1618,8 @@ discard block |
||
| 1618 | 1618 | if (!empty($this->db_create_database)) { |
| 1619 | 1619 | $result = $db->select_db($this->db_name); |
| 1620 | 1620 | if ($result) { |
| 1621 | - print '<div class="error">' . $this->lang->trans("ErrorDatabaseAlreadyExists", $this->db_name) . '</div>'; |
|
| 1622 | - print $this->lang->trans("IfDatabaseExistsGoBackAndCheckCreate") . '<br><br>'; |
|
| 1621 | + print '<div class="error">'.$this->lang->trans("ErrorDatabaseAlreadyExists", $this->db_name).'</div>'; |
|
| 1622 | + print $this->lang->trans("IfDatabaseExistsGoBackAndCheckCreate").'<br><br>'; |
|
| 1623 | 1623 | print $this->lang->trans("ErrorGoBackAndCorrectParameters"); |
| 1624 | 1624 | $error++; |
| 1625 | 1625 | } |
@@ -1650,11 +1650,11 @@ discard block |
||
| 1650 | 1650 | $defaultDBSortingCollation = 'utf8_unicode_ci'; |
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | - print '<input type="hidden" name="dolibarr_main_db_character_set" value="' . $defaultCharacterSet . '">'; |
|
| 1654 | - print '<input type="hidden" name="dolibarr_main_db_collation" value="' . $defaultDBSortingCollation . '">'; |
|
| 1653 | + print '<input type="hidden" name="dolibarr_main_db_character_set" value="'.$defaultCharacterSet.'">'; |
|
| 1654 | + print '<input type="hidden" name="dolibarr_main_db_collation" value="'.$defaultDBSortingCollation.'">'; |
|
| 1655 | 1655 | $this->db_character_set = $defaultCharacterSet; |
| 1656 | 1656 | $this->db_collation = $defaultDBSortingCollation; |
| 1657 | - $this->dolibarr_install_syslog("step1: db_character_set=" . $this->db_character_set . " db_collation=" . $this->db_collation); |
|
| 1657 | + $this->dolibarr_install_syslog("step1: db_character_set=".$this->db_character_set." db_collation=".$this->db_collation); |
|
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | 1660 | // Create config file |
@@ -1663,24 +1663,24 @@ discard block |
||
| 1663 | 1663 | if (is_array($_POST)) { |
| 1664 | 1664 | foreach ($_POST as $key => $value) { |
| 1665 | 1665 | if (!preg_match('/^db_pass/i', $key)) { |
| 1666 | - $this->dolibarr_install_syslog("step1: choice for " . $key . " = " . $value); |
|
| 1666 | + $this->dolibarr_install_syslog("step1: choice for ".$key." = ".$value); |
|
| 1667 | 1667 | } |
| 1668 | 1668 | } |
| 1669 | 1669 | } |
| 1670 | 1670 | |
| 1671 | 1671 | // Show title of step |
| 1672 | - print '<h3><img class="valignmiddle inline-block paddingright" src="Resources/img/gear.svg" width="20" alt="Configuration"> ' . $this->lang->trans("ConfigurationFile") . '</h3>'; |
|
| 1672 | + print '<h3><img class="valignmiddle inline-block paddingright" src="Resources/img/gear.svg" width="20" alt="Configuration"> '.$this->lang->trans("ConfigurationFile").'</h3>'; |
|
| 1673 | 1673 | print '<table cellspacing="0" width="100%" cellpadding="1" border="0">'; |
| 1674 | 1674 | |
| 1675 | 1675 | // Check parameter main_dir |
| 1676 | 1676 | if (!$error) { |
| 1677 | 1677 | if (!is_dir($this->main_dir)) { |
| 1678 | - $this->dolibarr_install_syslog("step1: directory '" . $this->main_dir . "' is unavailable or can't be accessed"); |
|
| 1678 | + $this->dolibarr_install_syslog("step1: directory '".$this->main_dir."' is unavailable or can't be accessed"); |
|
| 1679 | 1679 | |
| 1680 | 1680 | print "<tr><td>"; |
| 1681 | - print $this->lang->trans("ErrorDirDoesNotExists", $this->main_dir) . '<br>'; |
|
| 1682 | - print $this->lang->trans("ErrorWrongValueForParameter", $this->lang->transnoentitiesnoconv("WebPagesDirectory")) . '<br>'; |
|
| 1683 | - print $this->lang->trans("ErrorGoBackAndCorrectParameters") . '<br><br>'; |
|
| 1681 | + print $this->lang->trans("ErrorDirDoesNotExists", $this->main_dir).'<br>'; |
|
| 1682 | + print $this->lang->trans("ErrorWrongValueForParameter", $this->lang->transnoentitiesnoconv("WebPagesDirectory")).'<br>'; |
|
| 1683 | + print $this->lang->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; |
|
| 1684 | 1684 | print '</td><td>'; |
| 1685 | 1685 | print $this->lang->trans("Error"); |
| 1686 | 1686 | print "</td></tr>"; |
@@ -1689,7 +1689,7 @@ discard block |
||
| 1689 | 1689 | } |
| 1690 | 1690 | |
| 1691 | 1691 | if (!$error) { |
| 1692 | - $this->dolibarr_install_syslog("step1: directory '" . $this->main_dir . "' exists"); |
|
| 1692 | + $this->dolibarr_install_syslog("step1: directory '".$this->main_dir."' exists"); |
|
| 1693 | 1693 | } |
| 1694 | 1694 | |
| 1695 | 1695 | |
@@ -1701,22 +1701,22 @@ discard block |
||
| 1701 | 1701 | } |
| 1702 | 1702 | |
| 1703 | 1703 | if (!is_dir($this->main_data_dir)) { |
| 1704 | - print "<tr><td>" . $this->lang->trans("ErrorDirDoesNotExists", $this->main_data_dir); |
|
| 1705 | - print ' ' . $this->lang->trans("YouMustCreateItAndAllowServerToWrite"); |
|
| 1704 | + print "<tr><td>".$this->lang->trans("ErrorDirDoesNotExists", $this->main_data_dir); |
|
| 1705 | + print ' '.$this->lang->trans("YouMustCreateItAndAllowServerToWrite"); |
|
| 1706 | 1706 | print '</td><td>'; |
| 1707 | - print '<span class="error">' . $this->lang->trans("Error") . '</span>'; |
|
| 1707 | + print '<span class="error">'.$this->lang->trans("Error").'</span>'; |
|
| 1708 | 1708 | print "</td></tr>"; |
| 1709 | - print '<tr><td colspan="2"><br>' . $this->lang->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'] . '?testget=ok') . '</td></tr>'; |
|
| 1709 | + print '<tr><td colspan="2"><br>'.$this->lang->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').'</td></tr>'; |
|
| 1710 | 1710 | $error++; |
| 1711 | 1711 | } else { |
| 1712 | 1712 | // Create .htaccess file in document directory |
| 1713 | - $pathhtaccess = $this->main_data_dir . '/.htaccess'; |
|
| 1713 | + $pathhtaccess = $this->main_data_dir.'/.htaccess'; |
|
| 1714 | 1714 | if (!file_exists($pathhtaccess)) { |
| 1715 | - $this->dolibarr_install_syslog("step1: .htaccess file did not exist, we created it in '" . $this->main_data_dir . "'"); |
|
| 1715 | + $this->dolibarr_install_syslog("step1: .htaccess file did not exist, we created it in '".$this->main_data_dir."'"); |
|
| 1716 | 1716 | $handlehtaccess = @fopen($pathhtaccess, 'w'); |
| 1717 | 1717 | if ($handlehtaccess) { |
| 1718 | - fwrite($handlehtaccess, 'Order allow,deny' . "\n"); |
|
| 1719 | - fwrite($handlehtaccess, 'Deny from all' . "\n"); |
|
| 1718 | + fwrite($handlehtaccess, 'Order allow,deny'."\n"); |
|
| 1719 | + fwrite($handlehtaccess, 'Deny from all'."\n"); |
|
| 1720 | 1720 | |
| 1721 | 1721 | fclose($handlehtaccess); |
| 1722 | 1722 | $this->dolibarr_install_syslog("step1: .htaccess file created"); |
@@ -1725,45 +1725,45 @@ discard block |
||
| 1725 | 1725 | |
| 1726 | 1726 | // Documents are stored above the web pages root to prevent being downloaded without authentication |
| 1727 | 1727 | $dir = []; |
| 1728 | - $dir[] = $this->main_data_dir . "/mycompany"; |
|
| 1729 | - $dir[] = $this->main_data_dir . "/medias"; |
|
| 1730 | - $dir[] = $this->main_data_dir . "/users"; |
|
| 1731 | - $dir[] = $this->main_data_dir . "/facture"; |
|
| 1732 | - $dir[] = $this->main_data_dir . "/propale"; |
|
| 1733 | - $dir[] = $this->main_data_dir . "/ficheinter"; |
|
| 1734 | - $dir[] = $this->main_data_dir . "/produit"; |
|
| 1735 | - $dir[] = $this->main_data_dir . "/doctemplates"; |
|
| 1728 | + $dir[] = $this->main_data_dir."/mycompany"; |
|
| 1729 | + $dir[] = $this->main_data_dir."/medias"; |
|
| 1730 | + $dir[] = $this->main_data_dir."/users"; |
|
| 1731 | + $dir[] = $this->main_data_dir."/facture"; |
|
| 1732 | + $dir[] = $this->main_data_dir."/propale"; |
|
| 1733 | + $dir[] = $this->main_data_dir."/ficheinter"; |
|
| 1734 | + $dir[] = $this->main_data_dir."/produit"; |
|
| 1735 | + $dir[] = $this->main_data_dir."/doctemplates"; |
|
| 1736 | 1736 | |
| 1737 | 1737 | // Loop on each directory of dir [] to create them if they do not exist |
| 1738 | 1738 | $num = count($dir); |
| 1739 | 1739 | for ($i = 0; $i < $num; $i++) { |
| 1740 | 1740 | if (is_dir($dir[$i])) { |
| 1741 | - $this->dolibarr_install_syslog("step1: directory '" . $dir[$i] . "' exists"); |
|
| 1741 | + $this->dolibarr_install_syslog("step1: directory '".$dir[$i]."' exists"); |
|
| 1742 | 1742 | } else { |
| 1743 | 1743 | if (Functions::dol_mkdir($dir[$i]) < 0) { |
| 1744 | 1744 | $this->errors[] = $this->lang->trans('ErrorFailToCreateDir', $dir[$i]); |
| 1745 | 1745 | } else { |
| 1746 | - $this->dolibarr_install_syslog("step1: directory '" . $dir[$i] . "' created"); |
|
| 1746 | + $this->dolibarr_install_syslog("step1: directory '".$dir[$i]."' created"); |
|
| 1747 | 1747 | } |
| 1748 | 1748 | } |
| 1749 | 1749 | } |
| 1750 | 1750 | |
| 1751 | 1751 | // Copy directory medias |
| 1752 | - $srcroot = $this->main_dir . '/install/medias'; |
|
| 1753 | - $destroot = $this->main_data_dir . '/medias'; |
|
| 1752 | + $srcroot = $this->main_dir.'/install/medias'; |
|
| 1753 | + $destroot = $this->main_data_dir.'/medias'; |
|
| 1754 | 1754 | Files::dolCopyDir($srcroot, $destroot, 0, 0); |
| 1755 | 1755 | |
| 1756 | 1756 | if ($error) { |
| 1757 | - print "<tr><td>" . $this->lang->trans("ErrorDirDoesNotExists", $this->main_data_dir); |
|
| 1758 | - print ' ' . $this->lang->trans("YouMustCreateItAndAllowServerToWrite"); |
|
| 1757 | + print "<tr><td>".$this->lang->trans("ErrorDirDoesNotExists", $this->main_data_dir); |
|
| 1758 | + print ' '.$this->lang->trans("YouMustCreateItAndAllowServerToWrite"); |
|
| 1759 | 1759 | print '</td><td>'; |
| 1760 | - print '<span class="error">' . $this->lang->trans("Error") . '</span>'; |
|
| 1760 | + print '<span class="error">'.$this->lang->trans("Error").'</span>'; |
|
| 1761 | 1761 | print "</td></tr>"; |
| 1762 | - print '<tr><td colspan="2"><br>' . $this->lang->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'] . '?testget=ok') . '</td></tr>'; |
|
| 1762 | + print '<tr><td colspan="2"><br>'.$this->lang->trans("CorrectProblemAndReloadPage", $_SERVER['PHP_SELF'].'?testget=ok').'</td></tr>'; |
|
| 1763 | 1763 | } else { |
| 1764 | 1764 | //ODT templates |
| 1765 | - $srcroot = $this->main_dir . '/Install/DocTemplates'; |
|
| 1766 | - $destroot = $this->main_data_dir . '/doctemplates'; |
|
| 1765 | + $srcroot = $this->main_dir.'/Install/DocTemplates'; |
|
| 1766 | + $destroot = $this->main_data_dir.'/doctemplates'; |
|
| 1767 | 1767 | $docs = [ |
| 1768 | 1768 | 'contracts' => 'contract', |
| 1769 | 1769 | 'invoices' => 'invoice', |
@@ -1779,9 +1779,9 @@ discard block |
||
| 1779 | 1779 | 'users' => 'user', |
| 1780 | 1780 | ]; |
| 1781 | 1781 | foreach ($docs as $cursordir => $cursorfile) { |
| 1782 | - $src = $srcroot . '/' . $cursordir . '/template_' . $cursorfile . '.odt'; |
|
| 1783 | - $dirodt = $destroot . '/' . $cursordir; |
|
| 1784 | - $dest = $dirodt . '/template_' . $cursorfile . '.odt'; |
|
| 1782 | + $src = $srcroot.'/'.$cursordir.'/template_'.$cursorfile.'.odt'; |
|
| 1783 | + $dirodt = $destroot.'/'.$cursordir; |
|
| 1784 | + $dest = $dirodt.'/template_'.$cursorfile.'.odt'; |
|
| 1785 | 1785 | |
| 1786 | 1786 | Functions::dol_mkdir($dirodt); |
| 1787 | 1787 | $result = Files::dol_copy($src, $dest, 0, 0); |
@@ -1803,7 +1803,7 @@ discard block |
||
| 1803 | 1803 | // We must ignore errors as an existing old file may already exist and not be replaceable or |
| 1804 | 1804 | // the installer (like for ubuntu) may not have permission to create another file than conf.php. |
| 1805 | 1805 | // Also no other process must be able to read file or we expose the new file, so content with password. |
| 1806 | - @Files::dol_copy($conffile, $conffile . '.old', '0400'); |
|
| 1806 | + @Files::dol_copy($conffile, $conffile.'.old', '0400'); |
|
| 1807 | 1807 | } |
| 1808 | 1808 | |
| 1809 | 1809 | $configFileError = $this->write_conf_file($conffile); |
@@ -1813,7 +1813,7 @@ discard block |
||
| 1813 | 1813 | |
| 1814 | 1814 | print "<tr><td>"; |
| 1815 | 1815 | print $this->lang->trans("SaveConfigurationFile"); |
| 1816 | - print ' <strong>' . $conffile . '</strong>'; |
|
| 1816 | + print ' <strong>'.$conffile.'</strong>'; |
|
| 1817 | 1817 | print "</td><td>"; |
| 1818 | 1818 | print '<img src="Resources/img/ok.png" alt="Ok">'; |
| 1819 | 1819 | print "</td></tr>"; |
@@ -1834,7 +1834,7 @@ discard block |
||
| 1834 | 1834 | |
| 1835 | 1835 | // Create database user if requested |
| 1836 | 1836 | if (isset($this->db_create_user) && ($this->db_create_user == "1" || $this->db_create_user == "on")) { |
| 1837 | - $this->dolibarr_install_syslog("step1: create database user: " . $this->config->main_db_user); |
|
| 1837 | + $this->dolibarr_install_syslog("step1: create database user: ".$this->config->main_db_user); |
|
| 1838 | 1838 | |
| 1839 | 1839 | //print $this->db_host." , ".$this->db_name." , ".$this->db_user." , ".$this->db_port; |
| 1840 | 1840 | $databasefortest = $this->db_name; |
@@ -1851,7 +1851,7 @@ discard block |
||
| 1851 | 1851 | $db = Functions::getDoliDBInstance($this->db_type, $this->db_host, $userroot, $passroot, $databasefortest, (int) $this->db_port); |
| 1852 | 1852 | |
| 1853 | 1853 | if ($db->error) { |
| 1854 | - print '<div class="error">' . $db->error . '</div>'; |
|
| 1854 | + print '<div class="error">'.$db->error.'</div>'; |
|
| 1855 | 1855 | $error++; |
| 1856 | 1856 | } |
| 1857 | 1857 | |
@@ -1862,10 +1862,10 @@ discard block |
||
| 1862 | 1862 | if (empty($dolibarr_main_db_pass)) { |
| 1863 | 1863 | $this->dolibarr_install_syslog("step1: failed to create user, password is empty", LOG_ERR); |
| 1864 | 1864 | print '<tr><td>'; |
| 1865 | - print $this->lang->trans("UserCreation") . ' : '; |
|
| 1865 | + print $this->lang->trans("UserCreation").' : '; |
|
| 1866 | 1866 | print $dolibarr_main_db_user; |
| 1867 | 1867 | print '</td>'; |
| 1868 | - print '<td>' . $this->lang->trans("Error") . ": A password for database user is mandatory.</td></tr>"; |
|
| 1868 | + print '<td>'.$this->lang->trans("Error").": A password for database user is mandatory.</td></tr>"; |
|
| 1869 | 1869 | } else { |
| 1870 | 1870 | // Create user |
| 1871 | 1871 | $result = $db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); |
@@ -1879,7 +1879,7 @@ discard block |
||
| 1879 | 1879 | |
| 1880 | 1880 | if ($result > 0 && $resultbis > 0) { |
| 1881 | 1881 | print '<tr><td>'; |
| 1882 | - print $this->lang->trans("UserCreation") . ' : '; |
|
| 1882 | + print $this->lang->trans("UserCreation").' : '; |
|
| 1883 | 1883 | print $dolibarr_main_db_user; |
| 1884 | 1884 | print '</td>'; |
| 1885 | 1885 | print '<td><img src="Resources/img/ok.png" alt="Ok"></td></tr>'; |
@@ -1891,17 +1891,17 @@ discard block |
||
| 1891 | 1891 | ) { |
| 1892 | 1892 | $this->dolibarr_install_syslog("step1: user already exists"); |
| 1893 | 1893 | print '<tr><td>'; |
| 1894 | - print $this->lang->trans("UserCreation") . ' : '; |
|
| 1894 | + print $this->lang->trans("UserCreation").' : '; |
|
| 1895 | 1895 | print $dolibarr_main_db_user; |
| 1896 | 1896 | print '</td>'; |
| 1897 | - print '<td>' . $this->lang->trans("LoginAlreadyExists") . '</td></tr>'; |
|
| 1897 | + print '<td>'.$this->lang->trans("LoginAlreadyExists").'</td></tr>'; |
|
| 1898 | 1898 | } else { |
| 1899 | 1899 | $this->dolibarr_install_syslog("step1: failed to create user", LOG_ERR); |
| 1900 | 1900 | print '<tr><td>'; |
| 1901 | - print $this->lang->trans("UserCreation") . ' : '; |
|
| 1901 | + print $this->lang->trans("UserCreation").' : '; |
|
| 1902 | 1902 | print $dolibarr_main_db_user; |
| 1903 | 1903 | print '</td>'; |
| 1904 | - print '<td>' . $this->lang->trans("Error") . ': ' . $db->errno() . ' ' . $db->error() . ($db->error ? '. ' . $db->error : '') . "</td></tr>"; |
|
| 1904 | + print '<td>'.$this->lang->trans("Error").': '.$db->errno().' '.$db->error().($db->error ? '. '.$db->error : '')."</td></tr>"; |
|
| 1905 | 1905 | } |
| 1906 | 1906 | } |
| 1907 | 1907 | } |
@@ -1910,7 +1910,7 @@ discard block |
||
| 1910 | 1910 | $db->close(); |
| 1911 | 1911 | } else { |
| 1912 | 1912 | print '<tr><td>'; |
| 1913 | - print $this->lang->trans("UserCreation") . ' : '; |
|
| 1913 | + print $this->lang->trans("UserCreation").' : '; |
|
| 1914 | 1914 | print $dolibarr_main_db_user; |
| 1915 | 1915 | print '</td>'; |
| 1916 | 1916 | print '<td><img src="Resources/img/error.png" alt="Error"></td>'; |
@@ -1920,8 +1920,8 @@ discard block |
||
| 1920 | 1920 | print '<tr><td colspan="2"><br>'; |
| 1921 | 1921 | print $this->lang->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect", $dolibarr_main_db_user, $dolibarr_main_db_host, $userroot); |
| 1922 | 1922 | print '<br>'; |
| 1923 | - print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong") . '<br><br>'; |
|
| 1924 | - print $this->lang->trans("ErrorGoBackAndCorrectParameters") . '<br><br>'; |
|
| 1923 | + print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>'; |
|
| 1924 | + print $this->lang->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; |
|
| 1925 | 1925 | print '</td></tr>'; |
| 1926 | 1926 | |
| 1927 | 1927 | $error++; |
@@ -1931,14 +1931,14 @@ discard block |
||
| 1931 | 1931 | |
| 1932 | 1932 | // If database creation was asked, we create it |
| 1933 | 1933 | if (!$error && (isset($this->db_create_database) && ($this->db_create_database == "1" || $this->db_create_database == "on"))) { |
| 1934 | - $this->dolibarr_install_syslog("step1: create database: " . $dolibarr_main_db_name . " " . $dolibarr_main_db_character_set . " " . $dolibarr_main_db_collation . " " . $dolibarr_main_db_user); |
|
| 1934 | + $this->dolibarr_install_syslog("step1: create database: ".$dolibarr_main_db_name." ".$dolibarr_main_db_character_set." ".$dolibarr_main_db_collation." ".$dolibarr_main_db_user); |
|
| 1935 | 1935 | $newdb = Functions::getDoliDBInstance($this->db_type, $this->db_host, $userroot, $passroot, '', (int) $this->db_port); |
| 1936 | 1936 | //print 'eee'.$this->db_type." ".$this->db_host." ".$userroot." ".$passroot." ".$this->db_port." ".$newdb->connected." ".$newdb->forcecharset;exit; |
| 1937 | 1937 | |
| 1938 | 1938 | if ($newdb->connected()) { |
| 1939 | 1939 | if ($newdb->DDLCreateDb($dolibarr_main_db_name, $dolibarr_main_db_character_set, $dolibarr_main_db_collation, $dolibarr_main_db_user)) { |
| 1940 | 1940 | print '<tr><td>'; |
| 1941 | - print $this->lang->trans("DatabaseCreation") . " (" . $this->lang->trans("User") . " " . $userroot . ") : "; |
|
| 1941 | + print $this->lang->trans("DatabaseCreation")." (".$this->lang->trans("User")." ".$userroot.") : "; |
|
| 1942 | 1942 | print $dolibarr_main_db_name; |
| 1943 | 1943 | print '</td>'; |
| 1944 | 1944 | print '<td><img src="Resources/img/ok.png" alt="Ok"></td></tr>'; |
@@ -1946,7 +1946,7 @@ discard block |
||
| 1946 | 1946 | $newdb->select_db($dolibarr_main_db_name); |
| 1947 | 1947 | $check1 = $newdb->getDefaultCharacterSetDatabase(); |
| 1948 | 1948 | $check2 = $newdb->getDefaultCollationDatabase(); |
| 1949 | - $this->dolibarr_install_syslog('step1: new database is using charset=' . $check1 . ' collation=' . $check2); |
|
| 1949 | + $this->dolibarr_install_syslog('step1: new database is using charset='.$check1.' collation='.$check2); |
|
| 1950 | 1950 | |
| 1951 | 1951 | // If values differs, we save conf file again |
| 1952 | 1952 | //if ($check1 != $dolibarr_main_db_character_set) $this->dolibarr_install_syslog('step1: value for character_set is not the one asked for database creation', LOG_WARNING); |
@@ -1954,13 +1954,13 @@ discard block |
||
| 1954 | 1954 | } else { |
| 1955 | 1955 | // warning message |
| 1956 | 1956 | print '<tr><td colspan="2"><br>'; |
| 1957 | - print $this->lang->trans("ErrorFailedToCreateDatabase", $dolibarr_main_db_name) . '<br>'; |
|
| 1958 | - print $newdb->lasterror() . '<br>'; |
|
| 1957 | + print $this->lang->trans("ErrorFailedToCreateDatabase", $dolibarr_main_db_name).'<br>'; |
|
| 1958 | + print $newdb->lasterror().'<br>'; |
|
| 1959 | 1959 | print $this->lang->trans("IfDatabaseExistsGoBackAndCheckCreate"); |
| 1960 | 1960 | print '<br>'; |
| 1961 | 1961 | print '</td></tr>'; |
| 1962 | 1962 | |
| 1963 | - $this->dolibarr_install_syslog('step1: failed to create database ' . $dolibarr_main_db_name . ' ' . $newdb->lasterrno() . ' ' . $newdb->lasterror(), LOG_ERR); |
|
| 1963 | + $this->dolibarr_install_syslog('step1: failed to create database '.$dolibarr_main_db_name.' '.$newdb->lasterrno().' '.$newdb->lasterror(), LOG_ERR); |
|
| 1964 | 1964 | $error++; |
| 1965 | 1965 | } |
| 1966 | 1966 | |
@@ -1968,7 +1968,7 @@ discard block |
||
| 1968 | 1968 | DB::disconnect(); |
| 1969 | 1969 | } else { |
| 1970 | 1970 | print '<tr><td>'; |
| 1971 | - print $this->lang->trans("DatabaseCreation") . " (" . $this->lang->trans("User") . " " . $userroot . ") : "; |
|
| 1971 | + print $this->lang->trans("DatabaseCreation")." (".$this->lang->trans("User")." ".$userroot.") : "; |
|
| 1972 | 1972 | print $dolibarr_main_db_name; |
| 1973 | 1973 | print '</td>'; |
| 1974 | 1974 | print '<td><img src="Resources/img/error.png" alt="Error"></td>'; |
@@ -1978,8 +1978,8 @@ discard block |
||
| 1978 | 1978 | print '<tr><td colspan="2"><br>'; |
| 1979 | 1979 | print $this->lang->trans("YouAskDatabaseCreationSoDolibarrNeedToConnect", $dolibarr_main_db_user, $dolibarr_main_db_host, $userroot); |
| 1980 | 1980 | print '<br>'; |
| 1981 | - print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong") . '<br><br>'; |
|
| 1982 | - print $this->lang->trans("ErrorGoBackAndCorrectParameters") . '<br><br>'; |
|
| 1981 | + print $this->lang->trans("BecauseConnectionFailedParametersMayBeWrong").'<br><br>'; |
|
| 1982 | + print $this->lang->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; |
|
| 1983 | 1983 | print '</td></tr>'; |
| 1984 | 1984 | |
| 1985 | 1985 | $error++; |
@@ -1988,7 +1988,7 @@ discard block |
||
| 1988 | 1988 | |
| 1989 | 1989 | // We test access with dolibarr database user (not admin) |
| 1990 | 1990 | if (!$error) { |
| 1991 | - $this->dolibarr_install_syslog("step1: connection type=" . $this->db_type . " on host=" . $this->db_host . " port=" . $this->db_port . " user=" . $this->db_user . " name=" . $this->db_name); |
|
| 1991 | + $this->dolibarr_install_syslog("step1: connection type=".$this->db_type." on host=".$this->db_host." port=".$this->db_port." user=".$this->db_user." name=".$this->db_name); |
|
| 1992 | 1992 | //print "connection de type=".$this->db_type." sur host=".$this->db_host." port=".$this->db_port." user=".$this->db_user." name=".$this->db_name; |
| 1993 | 1993 | |
| 1994 | 1994 | DB::disconnect(); |
@@ -2002,9 +2002,9 @@ discard block |
||
| 2002 | 2002 | ); |
| 2003 | 2003 | |
| 2004 | 2004 | if (DB::$connected) { |
| 2005 | - $this->dolibarr_install_syslog("step1: connection to server by user " . $this->db_user . " ok"); |
|
| 2005 | + $this->dolibarr_install_syslog("step1: connection to server by user ".$this->db_user." ok"); |
|
| 2006 | 2006 | print "<tr><td>"; |
| 2007 | - print $this->lang->trans("ServerConnection") . " (" . $this->lang->trans("User") . " " . $this->db_user . ") : "; |
|
| 2007 | + print $this->lang->trans("ServerConnection")." (".$this->lang->trans("User")." ".$this->db_user.") : "; |
|
| 2008 | 2008 | print $this->db_host; |
| 2009 | 2009 | print "</td><td>"; |
| 2010 | 2010 | print '<img src="Resources/img/ok.png" alt="Ok">'; |
@@ -2012,9 +2012,9 @@ discard block |
||
| 2012 | 2012 | |
| 2013 | 2013 | // server access ok, basic access ok |
| 2014 | 2014 | if ($db->database_selected) { |
| 2015 | - $this->dolibarr_install_syslog("step1: connection to database " . $this->db_name . " by user " . $this->db_user . " ok"); |
|
| 2015 | + $this->dolibarr_install_syslog("step1: connection to database ".$this->db_name." by user ".$this->db_user." ok"); |
|
| 2016 | 2016 | print "<tr><td>"; |
| 2017 | - print $this->lang->trans("DatabaseConnection") . " (" . $this->lang->trans("User") . " " . $this->db_user . ") : "; |
|
| 2017 | + print $this->lang->trans("DatabaseConnection")." (".$this->lang->trans("User")." ".$this->db_user.") : "; |
|
| 2018 | 2018 | print $this->db_name; |
| 2019 | 2019 | print "</td><td>"; |
| 2020 | 2020 | print '<img src="Resources/img/ok.png" alt="Ok">'; |
@@ -2022,9 +2022,9 @@ discard block |
||
| 2022 | 2022 | |
| 2023 | 2023 | $error = 0; |
| 2024 | 2024 | } else { |
| 2025 | - $this->dolibarr_install_syslog("step1: connection to database " . $this->db_name . " by user " . $this->db_user . " failed", LOG_ERR); |
|
| 2025 | + $this->dolibarr_install_syslog("step1: connection to database ".$this->db_name." by user ".$this->db_user." failed", LOG_ERR); |
|
| 2026 | 2026 | print "<tr><td>"; |
| 2027 | - print $this->lang->trans("DatabaseConnection") . " (" . $this->lang->trans("User") . " " . $this->db_user . ") : "; |
|
| 2027 | + print $this->lang->trans("DatabaseConnection")." (".$this->lang->trans("User")." ".$this->db_user.") : "; |
|
| 2028 | 2028 | print $this->db_name; |
| 2029 | 2029 | print '</td><td>'; |
| 2030 | 2030 | print '<img src="Resources/img/error.png" alt="Error">'; |
@@ -2032,17 +2032,17 @@ discard block |
||
| 2032 | 2032 | |
| 2033 | 2033 | // warning message |
| 2034 | 2034 | print '<tr><td colspan="2"><br>'; |
| 2035 | - print $this->lang->trans('CheckThatDatabasenameIsCorrect', $this->config->main_db_name) . '<br>'; |
|
| 2036 | - print $this->lang->trans('IfAlreadyExistsCheckOption') . '<br>'; |
|
| 2037 | - print $this->lang->trans("ErrorGoBackAndCorrectParameters") . '<br><br>'; |
|
| 2035 | + print $this->lang->trans('CheckThatDatabasenameIsCorrect', $this->config->main_db_name).'<br>'; |
|
| 2036 | + print $this->lang->trans('IfAlreadyExistsCheckOption').'<br>'; |
|
| 2037 | + print $this->lang->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; |
|
| 2038 | 2038 | print '</td></tr>'; |
| 2039 | 2039 | |
| 2040 | 2040 | $error++; |
| 2041 | 2041 | } |
| 2042 | 2042 | } else { |
| 2043 | - $this->dolibarr_install_syslog("step1: connection to server by user " . $this->db_user . " failed", LOG_ERR); |
|
| 2043 | + $this->dolibarr_install_syslog("step1: connection to server by user ".$this->db_user." failed", LOG_ERR); |
|
| 2044 | 2044 | print "<tr><td>"; |
| 2045 | - print $this->lang->trans("ServerConnection") . " (" . $this->lang->trans("User") . " " . $this->db_user . ") : "; |
|
| 2045 | + print $this->lang->trans("ServerConnection")." (".$this->lang->trans("User")." ".$this->db_user.") : "; |
|
| 2046 | 2046 | print $this->db_host; |
| 2047 | 2047 | print '</td><td>'; |
| 2048 | 2048 | print '<img src="Resources/img/error.png" alt="Error">'; |
@@ -2051,8 +2051,8 @@ discard block |
||
| 2051 | 2051 | // warning message |
| 2052 | 2052 | print '<tr><td colspan="2"><br>'; |
| 2053 | 2053 | print $this->lang->trans("ErrorConnection", $this->db_host, $this->db_name, $this->db_user); |
| 2054 | - print $this->lang->trans('IfLoginDoesNotExistsCheckCreateUser') . '<br>'; |
|
| 2055 | - print $this->lang->trans("ErrorGoBackAndCorrectParameters") . '<br><br>'; |
|
| 2054 | + print $this->lang->trans('IfLoginDoesNotExistsCheckCreateUser').'<br>'; |
|
| 2055 | + print $this->lang->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; |
|
| 2056 | 2056 | print '</td></tr>'; |
| 2057 | 2057 | |
| 2058 | 2058 | $error++; |
@@ -2067,7 +2067,7 @@ discard block |
||
| 2067 | 2067 | if ($error && isset($argv[1])) { |
| 2068 | 2068 | $ret = 1; |
| 2069 | 2069 | } |
| 2070 | - $this->dolibarr_install_syslog("Exit " . $ret); |
|
| 2070 | + $this->dolibarr_install_syslog("Exit ".$ret); |
|
| 2071 | 2071 | |
| 2072 | 2072 | $this->dolibarr_install_syslog("--- step1: end"); |
| 2073 | 2073 | |
@@ -2096,9 +2096,9 @@ discard block |
||
| 2096 | 2096 | // Only works if you are not in safe_mode. / Ne fonctionne que si on est pas en safe_mode. |
| 2097 | 2097 | |
| 2098 | 2098 | $err = error_reporting(); |
| 2099 | - error_reporting(0); // Disable all errors |
|
| 2099 | + error_reporting(0); // Disable all errors |
|
| 2100 | 2100 | //error_reporting(E_ALL); |
| 2101 | - @set_time_limit(1800); // Need 1800 on some very slow OS like Windows 7/64 |
|
| 2101 | + @set_time_limit(1800); // Need 1800 on some very slow OS like Windows 7/64 |
|
| 2102 | 2102 | error_reporting($err); |
| 2103 | 2103 | |
| 2104 | 2104 | $action = Functions::GETPOST('action', 'aZ09') ? Functions::GETPOST('action', 'aZ09') : (empty($argv[1]) ? '' : $argv[1]); |
@@ -2164,19 +2164,19 @@ discard block |
||
| 2164 | 2164 | //$db = Functions::getDoliDBInstance($conf->main_db_type, $conf->main_db_host, $conf->main_db_user, $conf->main_db_pass, $conf->main_db_name, (int) $conf->main_db_port); |
| 2165 | 2165 | |
| 2166 | 2166 | if (DB::$connected) { |
| 2167 | - $this->connectionMessage = $this->lang->trans("ServerConnection") . ": " . $conf->main_db_host; |
|
| 2167 | + $this->connectionMessage = $this->lang->trans("ServerConnection").": ".$conf->main_db_host; |
|
| 2168 | 2168 | $this->connectionResult = '<img src="Resources/img/ok.png" alt="Ok">'; |
| 2169 | 2169 | $ok = 1; |
| 2170 | 2170 | } else { |
| 2171 | - $this->connectionMessage = 'Failed to connect to server: ' . $conf->main_db_host; |
|
| 2171 | + $this->connectionMessage = 'Failed to connect to server: '.$conf->main_db_host; |
|
| 2172 | 2172 | $this->connectionResult = '<img src="Resources/img/error.png" alt="Error">'; |
| 2173 | 2173 | } |
| 2174 | 2174 | |
| 2175 | 2175 | if ($ok) { |
| 2176 | 2176 | if ($db->database_selected) { |
| 2177 | - $this->dolibarr_install_syslog("step2: successful connection to database: " . $conf->main_db_name); |
|
| 2177 | + $this->dolibarr_install_syslog("step2: successful connection to database: ".$conf->main_db_name); |
|
| 2178 | 2178 | } else { |
| 2179 | - $this->dolibarr_install_syslog("step2: failed connection to database :" . $conf->main_db_name, LOG_ERR); |
|
| 2179 | + $this->dolibarr_install_syslog("step2: failed connection to database :".$conf->main_db_name, LOG_ERR); |
|
| 2180 | 2180 | $this->errors[] = [ |
| 2181 | 2181 | 'text' => 'Failed to select database '.$conf->main_db_name, |
| 2182 | 2182 | 'icon'=>'<img src="Resources/img/error.png" alt="Error">', |
@@ -2223,7 +2223,7 @@ discard block |
||
| 2223 | 2223 | |
| 2224 | 2224 | $ok = 0; |
| 2225 | 2225 | $handle = opendir($dir); |
| 2226 | - $this->dolibarr_install_syslog("step2: open tables directory " . $dir . " handle=" . $handle); |
|
| 2226 | + $this->dolibarr_install_syslog("step2: open tables directory ".$dir." handle=".$handle); |
|
| 2227 | 2227 | $tablefound = 0; |
| 2228 | 2228 | $tabledata = []; |
| 2229 | 2229 | if (is_resource($handle)) { |
@@ -2241,7 +2241,7 @@ discard block |
||
| 2241 | 2241 | foreach ($tabledata as $file) { |
| 2242 | 2242 | $name = substr($file, 0, Functions::dol_strlen($file) - 4); |
| 2243 | 2243 | $buffer = ''; |
| 2244 | - $fp = fopen($dir . $file, "r"); |
|
| 2244 | + $fp = fopen($dir.$file, "r"); |
|
| 2245 | 2245 | if ($fp) { |
| 2246 | 2246 | while (!feof($fp)) { |
| 2247 | 2247 | $buf = fgets($fp, 4096); |
@@ -2270,7 +2270,7 @@ discard block |
||
| 2270 | 2270 | //print "<tr><td>Creation of table $name/td>"; |
| 2271 | 2271 | $requestnb++; |
| 2272 | 2272 | |
| 2273 | - $this->dolibarr_install_syslog("step2: request: " . $buffer); |
|
| 2273 | + $this->dolibarr_install_syslog("step2: request: ".$buffer); |
|
| 2274 | 2274 | $resql = $db->query($buffer, 0, 'dml'); |
| 2275 | 2275 | if ($resql) { |
| 2276 | 2276 | // print "<td>OK request ==== $buffer</td></tr>"; |
@@ -2283,8 +2283,8 @@ discard block |
||
| 2283 | 2283 | //print "<td>already existing</td></tr>"; |
| 2284 | 2284 | } else { |
| 2285 | 2285 | $this->errors[] = [ |
| 2286 | - 'text' => $this->lang->trans("CreateTableAndPrimaryKey", $name) .'<br>'.$this->lang->trans("Request") . ' ' . $requestnb . ': ' . $buffer . ' <br>Executed query : ' . $db->lastquery, |
|
| 2287 | - 'icon'=>'<span class="error">' . $this->lang->trans("ErrorSQL") . " " . $db->errno() . " " . $db->error() . '</span>', |
|
| 2286 | + 'text' => $this->lang->trans("CreateTableAndPrimaryKey", $name).'<br>'.$this->lang->trans("Request").' '.$requestnb.': '.$buffer.' <br>Executed query : '.$db->lastquery, |
|
| 2287 | + 'icon'=>'<span class="error">'.$this->lang->trans("ErrorSQL")." ".$db->errno()." ".$db->error().'</span>', |
|
| 2288 | 2288 | ]; |
| 2289 | 2289 | $error++; |
| 2290 | 2290 | } |
@@ -2292,10 +2292,10 @@ discard block |
||
| 2292 | 2292 | } else { |
| 2293 | 2293 | $this->errors[] = [ |
| 2294 | 2294 | 'text' =>$this->lang->trans("CreateTableAndPrimaryKey", $name), |
| 2295 | - 'icon'=>'<span class="error">' . $this->lang->trans("Error") . ' Failed to open file ' . $dir . $file . '</span>', |
|
| 2295 | + 'icon'=>'<span class="error">'.$this->lang->trans("Error").' Failed to open file '.$dir.$file.'</span>', |
|
| 2296 | 2296 | ]; |
| 2297 | 2297 | $error++; |
| 2298 | - $this->dolibarr_install_syslog("step2: failed to open file " . $dir . $file, LOG_ERR); |
|
| 2298 | + $this->dolibarr_install_syslog("step2: failed to open file ".$dir.$file, LOG_ERR); |
|
| 2299 | 2299 | } |
| 2300 | 2300 | } |
| 2301 | 2301 | |
@@ -2312,7 +2312,7 @@ discard block |
||
| 2312 | 2312 | 'text' =>$this->lang->trans("ErrorFailedToFindSomeFiles", $dir), |
| 2313 | 2313 | 'icon'=>'<img src="Resources/img/error.png" alt="Error">', |
| 2314 | 2314 | ]; |
| 2315 | - $this->dolibarr_install_syslog("step2: failed to find files to create database in directory " . $dir, LOG_ERR); |
|
| 2315 | + $this->dolibarr_install_syslog("step2: failed to find files to create database in directory ".$dir, LOG_ERR); |
|
| 2316 | 2316 | } |
| 2317 | 2317 | } |
| 2318 | 2318 | |
@@ -2329,7 +2329,7 @@ discard block |
||
| 2329 | 2329 | |
| 2330 | 2330 | $okkeys = 0; |
| 2331 | 2331 | $handle = opendir($dir); |
| 2332 | - $this->dolibarr_install_syslog("step2: open keys directory " . $dir . " handle=" . $handle); |
|
| 2332 | + $this->dolibarr_install_syslog("step2: open keys directory ".$dir." handle=".$handle); |
|
| 2333 | 2333 | $tablefound = 0; |
| 2334 | 2334 | $tabledata = []; |
| 2335 | 2335 | if (is_resource($handle)) { |
@@ -2348,7 +2348,7 @@ discard block |
||
| 2348 | 2348 | $name = substr($file, 0, Functions::dol_strlen($file) - 4); |
| 2349 | 2349 | //print "<tr><td>Creation of table $name</td>"; |
| 2350 | 2350 | $buffer = ''; |
| 2351 | - $fp = fopen($dir . $file, "r"); |
|
| 2351 | + $fp = fopen($dir.$file, "r"); |
|
| 2352 | 2352 | if ($fp) { |
| 2353 | 2353 | while (!feof($fp)) { |
| 2354 | 2354 | $buf = fgets($fp, 4096); |
@@ -2403,7 +2403,7 @@ discard block |
||
| 2403 | 2403 | //print "<tr><td>Creation of keys and table index $name: '$buffer'</td>"; |
| 2404 | 2404 | $requestnb++; |
| 2405 | 2405 | |
| 2406 | - $this->dolibarr_install_syslog("step2: request: " . $buffer); |
|
| 2406 | + $this->dolibarr_install_syslog("step2: request: ".$buffer); |
|
| 2407 | 2407 | $resql = $db->query($buffer, 0, 'dml'); |
| 2408 | 2408 | if ($resql) { |
| 2409 | 2409 | //print "<td>OK request ==== $buffer</td></tr>"; |
@@ -2419,27 +2419,27 @@ discard block |
||
| 2419 | 2419 | //print "<td>Deja existante</td></tr>"; |
| 2420 | 2420 | $key_exists = 1; |
| 2421 | 2421 | } else { |
| 2422 | - print "<tr><td>" . $this->lang->trans("CreateOtherKeysForTable", $name); |
|
| 2423 | - print "<br>\n" . $this->lang->trans("Request") . ' ' . $requestnb . ' : ' . $db->lastqueryerror(); |
|
| 2422 | + print "<tr><td>".$this->lang->trans("CreateOtherKeysForTable", $name); |
|
| 2423 | + print "<br>\n".$this->lang->trans("Request").' '.$requestnb.' : '.$db->lastqueryerror(); |
|
| 2424 | 2424 | print "\n</td>"; |
| 2425 | - print '<td><span class="error">' . $this->lang->trans("ErrorSQL") . " " . $db->errno() . " " . $db->error() . '</span></td></tr>'; |
|
| 2425 | + print '<td><span class="error">'.$this->lang->trans("ErrorSQL")." ".$db->errno()." ".$db->error().'</span></td></tr>'; |
|
| 2426 | 2426 | $error++; |
| 2427 | 2427 | } |
| 2428 | 2428 | } |
| 2429 | 2429 | } |
| 2430 | 2430 | } |
| 2431 | 2431 | } else { |
| 2432 | - print "<tr><td>" . $this->lang->trans("CreateOtherKeysForTable", $name); |
|
| 2432 | + print "<tr><td>".$this->lang->trans("CreateOtherKeysForTable", $name); |
|
| 2433 | 2433 | print "</td>"; |
| 2434 | - print '<td><span class="error">' . $this->lang->trans("Error") . " Failed to open file " . $dir . $file . "</span></td></tr>"; |
|
| 2434 | + print '<td><span class="error">'.$this->lang->trans("Error")." Failed to open file ".$dir.$file."</span></td></tr>"; |
|
| 2435 | 2435 | $error++; |
| 2436 | - $this->dolibarr_install_syslog("step2: failed to open file " . $dir . $file, LOG_ERR); |
|
| 2436 | + $this->dolibarr_install_syslog("step2: failed to open file ".$dir.$file, LOG_ERR); |
|
| 2437 | 2437 | } |
| 2438 | 2438 | } |
| 2439 | 2439 | |
| 2440 | 2440 | if ($tablefound && $error == 0) { |
| 2441 | 2441 | print '<tr><td>'; |
| 2442 | - print $this->lang->trans("OtherKeysCreation") . '</td><td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>'; |
|
| 2442 | + print $this->lang->trans("OtherKeysCreation").'</td><td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>'; |
|
| 2443 | 2443 | $okkeys = 1; |
| 2444 | 2444 | } |
| 2445 | 2445 | } |
@@ -2465,15 +2465,15 @@ discard block |
||
| 2465 | 2465 | |
| 2466 | 2466 | // Creation of data |
| 2467 | 2467 | $file = "functions.sql"; |
| 2468 | - if (file_exists($dir . $file)) { |
|
| 2469 | - $fp = fopen($dir . $file, "r"); |
|
| 2470 | - $this->dolibarr_install_syslog("step2: open function file " . $dir . $file . " handle=" . $fp); |
|
| 2468 | + if (file_exists($dir.$file)) { |
|
| 2469 | + $fp = fopen($dir.$file, "r"); |
|
| 2470 | + $this->dolibarr_install_syslog("step2: open function file ".$dir.$file." handle=".$fp); |
|
| 2471 | 2471 | if ($fp) { |
| 2472 | 2472 | $buffer = ''; |
| 2473 | 2473 | while (!feof($fp)) { |
| 2474 | 2474 | $buf = fgets($fp, 4096); |
| 2475 | 2475 | if (substr($buf, 0, 2) != '--') { |
| 2476 | - $buffer .= $buf . "§"; |
|
| 2476 | + $buffer .= $buf."§"; |
|
| 2477 | 2477 | } |
| 2478 | 2478 | } |
| 2479 | 2479 | fclose($fp); |
@@ -2489,8 +2489,8 @@ discard block |
||
| 2489 | 2489 | if ($conf->main_db_prefix != 'llx_') { |
| 2490 | 2490 | $buffer = preg_replace('/llx_/i', $conf->main_db_prefix, $buffer); |
| 2491 | 2491 | } |
| 2492 | - $this->dolibarr_install_syslog("step2: request: " . $buffer); |
|
| 2493 | - print "<!-- Insert line : " . $buffer . "<br>-->\n"; |
|
| 2492 | + $this->dolibarr_install_syslog("step2: request: ".$buffer); |
|
| 2493 | + print "<!-- Insert line : ".$buffer."<br>-->\n"; |
|
| 2494 | 2494 | $resql = $db->query($buffer, 0, 'dml'); |
| 2495 | 2495 | if ($resql) { |
| 2496 | 2496 | $ok = 1; |
@@ -2504,17 +2504,17 @@ discard block |
||
| 2504 | 2504 | } else { |
| 2505 | 2505 | $ok = 0; |
| 2506 | 2506 | |
| 2507 | - print "<tr><td>" . $this->lang->trans("FunctionsCreation"); |
|
| 2508 | - print "<br>\n" . $this->lang->trans("Request") . ' ' . $requestnb . ' : ' . $buffer; |
|
| 2507 | + print "<tr><td>".$this->lang->trans("FunctionsCreation"); |
|
| 2508 | + print "<br>\n".$this->lang->trans("Request").' '.$requestnb.' : '.$buffer; |
|
| 2509 | 2509 | print "\n</td>"; |
| 2510 | - print '<td><span class="error">' . $this->lang->trans("ErrorSQL") . " " . $db->errno() . " " . $db->error() . '</span></td></tr>'; |
|
| 2510 | + print '<td><span class="error">'.$this->lang->trans("ErrorSQL")." ".$db->errno()." ".$db->error().'</span></td></tr>'; |
|
| 2511 | 2511 | $error++; |
| 2512 | 2512 | } |
| 2513 | 2513 | } |
| 2514 | 2514 | } |
| 2515 | 2515 | } |
| 2516 | 2516 | |
| 2517 | - print "<tr><td>" . $this->lang->trans("FunctionsCreation") . "</td>"; |
|
| 2517 | + print "<tr><td>".$this->lang->trans("FunctionsCreation")."</td>"; |
|
| 2518 | 2518 | if ($ok) { |
| 2519 | 2519 | print '<td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>'; |
| 2520 | 2520 | } else { |
@@ -2536,7 +2536,7 @@ discard block |
||
| 2536 | 2536 | |
| 2537 | 2537 | // Insert data |
| 2538 | 2538 | $handle = opendir($dir); |
| 2539 | - $this->dolibarr_install_syslog("step2: open directory data " . $dir . " handle=" . $handle); |
|
| 2539 | + $this->dolibarr_install_syslog("step2: open directory data ".$dir." handle=".$handle); |
|
| 2540 | 2540 | $tablefound = 0; |
| 2541 | 2541 | $tabledata = []; |
| 2542 | 2542 | if (is_resource($handle)) { |
@@ -2547,7 +2547,7 @@ discard block |
||
| 2547 | 2547 | } |
| 2548 | 2548 | |
| 2549 | 2549 | //print 'x'.$file.'-'.$createdata.'<br>'; |
| 2550 | - if (is_numeric($createdata) || preg_match('/' . preg_quote($createdata) . '/i', $file)) { |
|
| 2550 | + if (is_numeric($createdata) || preg_match('/'.preg_quote($createdata).'/i', $file)) { |
|
| 2551 | 2551 | $tablefound++; |
| 2552 | 2552 | $tabledata[] = $file; |
| 2553 | 2553 | } |
@@ -2560,8 +2560,8 @@ discard block |
||
| 2560 | 2560 | sort($tabledata); |
| 2561 | 2561 | foreach ($tabledata as $file) { |
| 2562 | 2562 | $name = substr($file, 0, Functions::dol_strlen($file) - 4); |
| 2563 | - $fp = fopen($dir . $file, "r"); |
|
| 2564 | - $this->dolibarr_install_syslog("step2: open data file " . $dir . $file . " handle=" . $fp); |
|
| 2563 | + $fp = fopen($dir.$file, "r"); |
|
| 2564 | + $this->dolibarr_install_syslog("step2: open data file ".$dir.$file." handle=".$fp); |
|
| 2565 | 2565 | if ($fp) { |
| 2566 | 2566 | $arrayofrequests = []; |
| 2567 | 2567 | $linefound = 0; |
@@ -2583,7 +2583,7 @@ discard block |
||
| 2583 | 2583 | if (empty($arrayofrequests[$linegroup])) { |
| 2584 | 2584 | $arrayofrequests[$linegroup] = $buffer; |
| 2585 | 2585 | } else { |
| 2586 | - $arrayofrequests[$linegroup] .= " " . $buffer; |
|
| 2586 | + $arrayofrequests[$linegroup] .= " ".$buffer; |
|
| 2587 | 2587 | } |
| 2588 | 2588 | |
| 2589 | 2589 | $linefound++; |
@@ -2591,7 +2591,7 @@ discard block |
||
| 2591 | 2591 | } |
| 2592 | 2592 | fclose($fp); |
| 2593 | 2593 | |
| 2594 | - $this->dolibarr_install_syslog("step2: found " . $linefound . " records, defined " . count($arrayofrequests) . " group(s)."); |
|
| 2594 | + $this->dolibarr_install_syslog("step2: found ".$linefound." records, defined ".count($arrayofrequests)." group(s)."); |
|
| 2595 | 2595 | |
| 2596 | 2596 | $okallfile = 1; |
| 2597 | 2597 | $db->begin(); |
@@ -2613,7 +2613,7 @@ discard block |
||
| 2613 | 2613 | } else { |
| 2614 | 2614 | $ok = 0; |
| 2615 | 2615 | $okallfile = 0; |
| 2616 | - print '<span class="error">' . $this->lang->trans("ErrorSQL") . " : " . $db->lasterrno() . " - " . $db->lastqueryerror() . " - " . $db->lasterror() . "</span><br>"; |
|
| 2616 | + print '<span class="error">'.$this->lang->trans("ErrorSQL")." : ".$db->lasterrno()." - ".$db->lastqueryerror()." - ".$db->lasterror()."</span><br>"; |
|
| 2617 | 2617 | } |
| 2618 | 2618 | } |
| 2619 | 2619 | } |
@@ -2626,7 +2626,7 @@ discard block |
||
| 2626 | 2626 | } |
| 2627 | 2627 | } |
| 2628 | 2628 | |
| 2629 | - print "<tr><td>" . $this->lang->trans("ReferenceDataLoading") . "</td>"; |
|
| 2629 | + print "<tr><td>".$this->lang->trans("ReferenceDataLoading")."</td>"; |
|
| 2630 | 2630 | if ($ok) { |
| 2631 | 2631 | print '<td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>'; |
| 2632 | 2632 | } else { |
@@ -2644,7 +2644,7 @@ discard block |
||
| 2644 | 2644 | if (!$ok && isset($argv[1])) { |
| 2645 | 2645 | $ret = 1; |
| 2646 | 2646 | } |
| 2647 | - $this->dolibarr_install_syslog("Exit " . $ret); |
|
| 2647 | + $this->dolibarr_install_syslog("Exit ".$ret); |
|
| 2648 | 2648 | |
| 2649 | 2649 | $this->dolibarr_install_syslog("- step2: end"); |
| 2650 | 2650 | |
@@ -2653,23 +2653,23 @@ discard block |
||
| 2653 | 2653 | |
| 2654 | 2654 | $this->conf->file->instance_unique_id = (empty($conf->main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $conf->main_instance_unique_id); // Unique id of instance |
| 2655 | 2655 | |
| 2656 | - $hash_unique_id = Security::dol_hash('dolibarr' . $this->conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 2656 | + $hash_unique_id = Security::dol_hash('dolibarr'.$this->conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 2657 | 2657 | |
| 2658 | - $out = '<input type="checkbox" name="dolibarrpingno" id="dolibarrpingno"' . ((Functions::getDolGlobalString('MAIN_FIRST_PING_OK_ID') == 'disabled') ? '' : ' value="checked"') . '> '; |
|
| 2659 | - $out .= '<label for="dolibarrpingno">' . $this->lang->trans("MakeAnonymousPing") . '</label>'; |
|
| 2658 | + $out = '<input type="checkbox" name="dolibarrpingno" id="dolibarrpingno"'.((Functions::getDolGlobalString('MAIN_FIRST_PING_OK_ID') == 'disabled') ? '' : ' value="checked"').'> '; |
|
| 2659 | + $out .= '<label for="dolibarrpingno">'.$this->lang->trans("MakeAnonymousPing").'</label>'; |
|
| 2660 | 2660 | |
| 2661 | 2661 | $out .= '<!-- Add js script to manage the uncheck of option to not send the ping -->'; |
| 2662 | 2662 | $out .= '<script type="text/javascript">'; |
| 2663 | 2663 | $out .= 'jQuery(document).ready(function(){'; |
| 2664 | - $out .= ' document.cookie = "DOLINSTALLNOPING_' . $hash_unique_id . '=0; path=/"' . "\n"; |
|
| 2664 | + $out .= ' document.cookie = "DOLINSTALLNOPING_'.$hash_unique_id.'=0; path=/"'."\n"; |
|
| 2665 | 2665 | $out .= ' jQuery("#dolibarrpingno").click(function() {'; |
| 2666 | 2666 | $out .= ' if (! $(this).is(\':checked\')) {'; |
| 2667 | 2667 | $out .= ' console.log("We uncheck anonymous ping");'; |
| 2668 | - $out .= ' document.cookie = "DOLINSTALLNOPING_' . $hash_unique_id . '=1; path=/"' . "\n"; |
|
| 2669 | - $out .= ' } else {' . "\n"; |
|
| 2668 | + $out .= ' document.cookie = "DOLINSTALLNOPING_'.$hash_unique_id.'=1; path=/"'."\n"; |
|
| 2669 | + $out .= ' } else {'."\n"; |
|
| 2670 | 2670 | $out .= ' console.log("We check anonymous ping");'; |
| 2671 | - $out .= ' document.cookie = "DOLINSTALLNOPING_' . $hash_unique_id . '=0; path=/"' . "\n"; |
|
| 2672 | - $out .= ' }' . "\n"; |
|
| 2671 | + $out .= ' document.cookie = "DOLINSTALLNOPING_'.$hash_unique_id.'=0; path=/"'."\n"; |
|
| 2672 | + $out .= ' }'."\n"; |
|
| 2673 | 2673 | $out .= ' });'; |
| 2674 | 2674 | $out .= '});'; |
| 2675 | 2675 | $out .= '</script>'; |
@@ -2717,7 +2717,7 @@ discard block |
||
| 2717 | 2717 | exit; |
| 2718 | 2718 | } |
| 2719 | 2719 | |
| 2720 | - print '<h3><img class="valignmiddle inline-block paddingright" src="../theme/common/octicons/build/svg/key.svg" width="20" alt="Database"> ' . $this->lang->trans("DolibarrAdminLogin") . '</h3>'; |
|
| 2720 | + print '<h3><img class="valignmiddle inline-block paddingright" src="../theme/common/octicons/build/svg/key.svg" width="20" alt="Database"> '.$this->lang->trans("DolibarrAdminLogin").'</h3>'; |
|
| 2721 | 2721 | |
| 2722 | 2722 | |
| 2723 | 2723 | //$db = getDoliDBInstance($this->db_type, $this->db_host, $this->db_user, $this->db_pass, $this->db_name, (int) $this->db_port); |
@@ -2726,12 +2726,12 @@ discard block |
||
| 2726 | 2726 | $this->login_value = (Functions::GETPOSTISSET(" login") |
| 2727 | 2727 | ? Functions::GETPOST("login", 'alpha') |
| 2728 | 2728 | : (isset($force_install_dolibarrlogin) ? |
| 2729 | - $force_install_dolibarrlogin : '')) . '"' . (@$force_install_noedit == 2 && |
|
| 2729 | + $force_install_dolibarrlogin : '')).'"'.(@$force_install_noedit == 2 && |
|
| 2730 | 2730 | $force_install_dolibarrlogin !== null ? ' disabled' : ''); |
| 2731 | 2731 | |
| 2732 | 2732 | if (isset($_GET["error"]) && $_GET["error"] == 1) { |
| 2733 | 2733 | print '<br>'; |
| 2734 | - print '<div class="error">' . $this->lang->trans("PasswordsMismatch") . '</div>'; |
|
| 2734 | + print '<div class="error">'.$this->lang->trans("PasswordsMismatch").'</div>'; |
|
| 2735 | 2735 | $error = 0; // We show button |
| 2736 | 2736 | } |
| 2737 | 2737 | |
@@ -2745,7 +2745,7 @@ discard block |
||
| 2745 | 2745 | |
| 2746 | 2746 | if (isset($_GET["error"]) && $_GET["error"] == 3) { |
| 2747 | 2747 | print '<br>'; |
| 2748 | - print '<div class="error">' . $this->lang->trans("PleaseTypeALogin") . '</div>'; |
|
| 2748 | + print '<div class="error">'.$this->lang->trans("PleaseTypeALogin").'</div>'; |
|
| 2749 | 2749 | $error = 0; // We show button |
| 2750 | 2750 | } |
| 2751 | 2751 | |
@@ -2753,7 +2753,7 @@ discard block |
||
| 2753 | 2753 | if ($error && isset($argv[1])) { |
| 2754 | 2754 | $ret = 1; |
| 2755 | 2755 | } |
| 2756 | - $this->dolibarr_install_syslog("Exit " . $ret); |
|
| 2756 | + $this->dolibarr_install_syslog("Exit ".$ret); |
|
| 2757 | 2757 | |
| 2758 | 2758 | $this->dolibarr_install_syslog("--- step4: end"); |
| 2759 | 2759 | |
@@ -2826,7 +2826,7 @@ discard block |
||
| 2826 | 2826 | } |
| 2827 | 2827 | */ |
| 2828 | 2828 | |
| 2829 | - $this->dolibarr_install_syslog("--- step5: entering step5.php page " . $versionfrom . " " . $versionto); |
|
| 2829 | + $this->dolibarr_install_syslog("--- step5: entering step5.php page ".$versionfrom." ".$versionto); |
|
| 2830 | 2830 | |
| 2831 | 2831 | $error = 0; |
| 2832 | 2832 | |
@@ -2875,7 +2875,7 @@ discard block |
||
| 2875 | 2875 | |
| 2876 | 2876 | // If password is encoded, we decode it |
| 2877 | 2877 | if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) { |
| 2878 | - require_once BASE_PATH . '/core/lib/security.lib.php'; |
|
| 2878 | + require_once BASE_PATH.'/core/lib/security.lib.php'; |
|
| 2879 | 2879 | if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) { |
| 2880 | 2880 | $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); |
| 2881 | 2881 | $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass); |
@@ -2909,11 +2909,11 @@ discard block |
||
| 2909 | 2909 | if ($action == "set") { |
| 2910 | 2910 | // Active module user |
| 2911 | 2911 | |
| 2912 | - $this->dolibarr_install_syslog('step5: load module user ' . BASE_PATH . 'Modules/UserModule.php', LOG_INFO); |
|
| 2912 | + $this->dolibarr_install_syslog('step5: load module user '.BASE_PATH.'Modules/UserModule.php', LOG_INFO); |
|
| 2913 | 2913 | $objMod = new UserModule($db); |
| 2914 | 2914 | $result = $objMod->init(); |
| 2915 | 2915 | if (!$result) { |
| 2916 | - print "ERROR: failed to init module file = " . BASE_PATH . 'Modules/UserModule.php'; |
|
| 2916 | + print "ERROR: failed to init module file = ".BASE_PATH.'Modules/UserModule.php'; |
|
| 2917 | 2917 | } |
| 2918 | 2918 | |
| 2919 | 2919 | if (DB::$connected) { |
@@ -2929,7 +2929,7 @@ discard block |
||
| 2929 | 2929 | |
| 2930 | 2930 | // Set default encryption to yes, generate a salt and set default encryption algorithm (but only if there is no user yet into database) |
| 2931 | 2931 | $sql = "SELECT u.rowid, u.pass, u.pass_crypted"; |
| 2932 | - $sql .= " FROM " . $config->main_db_prefix . "user as u"; |
|
| 2932 | + $sql .= " FROM ".$config->main_db_prefix."user as u"; |
|
| 2933 | 2933 | $resql = $db->query($sql); |
| 2934 | 2934 | if ($resql) { |
| 2935 | 2935 | $numrows = $db->num_rows($resql); |
@@ -2944,7 +2944,7 @@ discard block |
||
| 2944 | 2944 | } |
| 2945 | 2945 | } |
| 2946 | 2946 | |
| 2947 | - $this->dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = ' . Functions::getDolGlobalString('DATABASE_PWD_ENCRYPTED') . ' MAIN_SECURITY_HASH_ALGO = ' . Functions::getDolGlobalString('MAIN_SECURITY_HASH_ALGO'), LOG_INFO); |
|
| 2947 | + $this->dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = '.Functions::getDolGlobalString('DATABASE_PWD_ENCRYPTED').' MAIN_SECURITY_HASH_ALGO = '.Functions::getDolGlobalString('MAIN_SECURITY_HASH_ALGO'), LOG_INFO); |
|
| 2948 | 2948 | } |
| 2949 | 2949 | |
| 2950 | 2950 | // Create user used to create the admin user |
@@ -2961,24 +2961,24 @@ discard block |
||
| 2961 | 2961 | $newuser->admin = 1; |
| 2962 | 2962 | $newuser->entity = 0; |
| 2963 | 2963 | |
| 2964 | - $conf->global->USER_MAIL_REQUIRED = 0; // Force global option to be sure to create a new user with no email |
|
| 2965 | - $conf->global->USER_PASSWORD_GENERATED = ''; // To not use any rule for password validation |
|
| 2964 | + $conf->global->USER_MAIL_REQUIRED = 0; // Force global option to be sure to create a new user with no email |
|
| 2965 | + $conf->global->USER_PASSWORD_GENERATED = ''; // To not use any rule for password validation |
|
| 2966 | 2966 | |
| 2967 | 2967 | $result = $newuser->create($createuser, 1); |
| 2968 | 2968 | if ($result > 0) { |
| 2969 | - print $this->lang->trans("AdminLoginCreatedSuccessfuly", $login) . "<br>"; |
|
| 2969 | + print $this->lang->trans("AdminLoginCreatedSuccessfuly", $login)."<br>"; |
|
| 2970 | 2970 | $success = 1; |
| 2971 | 2971 | } else { |
| 2972 | 2972 | if ($result == -6) { //login or email already exists |
| 2973 | 2973 | $this->dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING); |
| 2974 | - print '<br><div class="warning">' . $newuser->error . "</div><br>"; |
|
| 2974 | + print '<br><div class="warning">'.$newuser->error."</div><br>"; |
|
| 2975 | 2975 | $success = 1; |
| 2976 | 2976 | } else { |
| 2977 | - $this->dolibarr_install_syslog('step5: FailedToCreateAdminLogin ' . $newuser->error, LOG_ERR); |
|
| 2978 | - Functions::setEventMessages($this->lang->trans("FailedToCreateAdminLogin") . ' ' . $newuser->error, null, 'errors'); |
|
| 2977 | + $this->dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR); |
|
| 2978 | + Functions::setEventMessages($this->lang->trans("FailedToCreateAdminLogin").' '.$newuser->error, null, 'errors'); |
|
| 2979 | 2979 | //header("Location: step4.php?error=3&selectlang=$setuplang".(isset($login) ? '&login='.$login : '')); |
| 2980 | - print '<br><div class="error">' . $this->lang->trans("FailedToCreateAdminLogin") . ': ' . $newuser->error . '</div><br><br>'; |
|
| 2981 | - print $this->lang->trans("ErrorGoBackAndCorrectParameters") . '<br><br>'; |
|
| 2980 | + print '<br><div class="error">'.$this->lang->trans("FailedToCreateAdminLogin").': '.$newuser->error.'</div><br><br>'; |
|
| 2981 | + print $this->lang->trans("ErrorGoBackAndCorrectParameters").'<br><br>'; |
|
| 2982 | 2982 | $success = 1; |
| 2983 | 2983 | } |
| 2984 | 2984 | } |
@@ -2986,8 +2986,8 @@ discard block |
||
| 2986 | 2986 | if ($success) { |
| 2987 | 2987 | // Insert MAIN_VERSION_FIRST_INSTALL in a dedicated transaction. So if it fails (when first install was already done), we can do other following requests. |
| 2988 | 2988 | $db->begin(); |
| 2989 | - $this->dolibarr_install_syslog('step5: set MAIN_VERSION_FIRST_INSTALL const to ' . $targetversion, LOG_DEBUG); |
|
| 2990 | - $resql = $db->query("INSERT INTO " . $config->main_db_prefix . "const(name, value, type, visible, note, entity) values(" . $db->encrypt('MAIN_VERSION_FIRST_INSTALL') . ", " . $db->encrypt($targetversion) . ", 'chaine', 0, 'Dolibarr version when first install', 0)"); |
|
| 2989 | + $this->dolibarr_install_syslog('step5: set MAIN_VERSION_FIRST_INSTALL const to '.$targetversion, LOG_DEBUG); |
|
| 2990 | + $resql = $db->query("INSERT INTO ".$config->main_db_prefix."const(name, value, type, visible, note, entity) values(".$db->encrypt('MAIN_VERSION_FIRST_INSTALL').", ".$db->encrypt($targetversion).", 'chaine', 0, 'Dolibarr version when first install', 0)"); |
|
| 2991 | 2991 | if ($resql) { |
| 2992 | 2992 | $conf->global->MAIN_VERSION_FIRST_INSTALL = $targetversion; |
| 2993 | 2993 | $db->commit(); |
@@ -2998,12 +2998,12 @@ discard block |
||
| 2998 | 2998 | |
| 2999 | 2999 | $db->begin(); |
| 3000 | 3000 | |
| 3001 | - $this->dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_INSTALL const to ' . $targetversion, LOG_DEBUG); |
|
| 3002 | - $resql = $db->query("DELETE FROM " . $config->main_db_prefix . "const WHERE " . $db->decrypt('name') . " = 'MAIN_VERSION_LAST_INSTALL'"); |
|
| 3001 | + $this->dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_INSTALL const to '.$targetversion, LOG_DEBUG); |
|
| 3002 | + $resql = $db->query("DELETE FROM ".$config->main_db_prefix."const WHERE ".$db->decrypt('name')." = 'MAIN_VERSION_LAST_INSTALL'"); |
|
| 3003 | 3003 | if (!$resql) { |
| 3004 | 3004 | Functions::dol_print_error($db, 'Error in setup program'); |
| 3005 | 3005 | } |
| 3006 | - $resql = $db->query("INSERT INTO " . $config->main_db_prefix . "const(name,value,type,visible,note,entity) values(" . $db->encrypt('MAIN_VERSION_LAST_INSTALL') . ", " . $db->encrypt($targetversion) . ", 'chaine', 0, 'Dolibarr version when last install', 0)"); |
|
| 3006 | + $resql = $db->query("INSERT INTO ".$config->main_db_prefix."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_LAST_INSTALL').", ".$db->encrypt($targetversion).", 'chaine', 0, 'Dolibarr version when last install', 0)"); |
|
| 3007 | 3007 | if (!$resql) { |
| 3008 | 3008 | Functions::dol_print_error($db, 'Error in setup program'); |
| 3009 | 3009 | } |
@@ -3011,7 +3011,7 @@ discard block |
||
| 3011 | 3011 | |
| 3012 | 3012 | if ($useforcedwizard) { |
| 3013 | 3013 | $this->dolibarr_install_syslog('step5: set MAIN_REMOVE_INSTALL_WARNING const to 1', LOG_DEBUG); |
| 3014 | - $resql = $db->query("DELETE FROM " . $config->main_db_prefix . "const WHERE " . $db->decrypt('name') . " = 'MAIN_REMOVE_INSTALL_WARNING'"); |
|
| 3014 | + $resql = $db->query("DELETE FROM ".$config->main_db_prefix."const WHERE ".$db->decrypt('name')." = 'MAIN_REMOVE_INSTALL_WARNING'"); |
|
| 3015 | 3015 | if (!$resql) { |
| 3016 | 3016 | Functions::dol_print_error($db, 'Error in setup program'); |
| 3017 | 3017 | } |
@@ -3040,27 +3040,27 @@ discard block |
||
| 3040 | 3040 | $modNameLoaded = []; |
| 3041 | 3041 | |
| 3042 | 3042 | // Search modules dirs |
| 3043 | - $modulesdir[] = BASE_PATH . '/core/modules/'; |
|
| 3043 | + $modulesdir[] = BASE_PATH.'/core/modules/'; |
|
| 3044 | 3044 | |
| 3045 | 3045 | foreach ($modulesdir as $dir) { |
| 3046 | 3046 | // Load modules attributes in arrays (name, numero, orders) from dir directory |
| 3047 | 3047 | //print $dir."\n<br>"; |
| 3048 | - Functions::dol_syslog("Scan directory " . $dir . " for module descriptor files (modXXX.class.php)"); |
|
| 3048 | + Functions::dol_syslog("Scan directory ".$dir." for module descriptor files (modXXX.class.php)"); |
|
| 3049 | 3049 | $handle = @opendir($dir); |
| 3050 | 3050 | if (is_resource($handle)) { |
| 3051 | 3051 | while (($file = readdir($handle)) !== false) { |
| 3052 | - if (is_readable($dir . $file) && substr($file, 0, 3) == 'mod' && substr($file, Functions::dol_strlen($file) - 10) == '.class.php') { |
|
| 3052 | + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, Functions::dol_strlen($file) - 10) == '.class.php') { |
|
| 3053 | 3053 | $modName = substr($file, 0, Functions::dol_strlen($file) - 10); |
| 3054 | 3054 | if ($modName) { |
| 3055 | 3055 | if (!empty($modNameLoaded[$modName])) { // In cache of already loaded modules ? |
| 3056 | - $mesg = "Error: Module " . $modName . " was found twice: Into " . $modNameLoaded[$modName] . " and " . $dir . ". You probably have an old file on your disk.<br>"; |
|
| 3056 | + $mesg = "Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>"; |
|
| 3057 | 3057 | Functions::setEventMessages($mesg, null, 'warnings'); |
| 3058 | 3058 | Functions::dol_syslog($mesg, LOG_ERR); |
| 3059 | 3059 | continue; |
| 3060 | 3060 | } |
| 3061 | 3061 | |
| 3062 | 3062 | try { |
| 3063 | - $res = include_once $dir . $file; // A class already exists in a different file will send a non catchable fatal error. |
|
| 3063 | + $res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error. |
|
| 3064 | 3064 | if (class_exists($modName)) { |
| 3065 | 3065 | $objMod = new $modName($db); |
| 3066 | 3066 | $modNameLoaded[$modName] = $dir; |
@@ -3069,7 +3069,7 @@ discard block |
||
| 3069 | 3069 | } |
| 3070 | 3070 | } |
| 3071 | 3071 | } catch (Exception $e) { |
| 3072 | - Functions::dol_syslog("Failed to load " . $dir . $file . " " . $e->getMessage(), LOG_ERR); |
|
| 3072 | + Functions::dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); |
|
| 3073 | 3073 | } |
| 3074 | 3074 | } |
| 3075 | 3075 | } |
@@ -3083,13 +3083,13 @@ discard block |
||
| 3083 | 3083 | $modtoactivatenew = preg_replace('/\.class\.php$/i', '', $modtoactivate); |
| 3084 | 3084 | //print $this->lang->trans("ActivateModule", $modtoactivatenew).'<br>'; |
| 3085 | 3085 | |
| 3086 | - $file = $modtoactivatenew . '.class.php'; |
|
| 3087 | - $this->dolibarr_install_syslog('step5: activate module file=' . $file); |
|
| 3088 | - $res = dol_include_once("/core/modules/" . $file); |
|
| 3086 | + $file = $modtoactivatenew.'.class.php'; |
|
| 3087 | + $this->dolibarr_install_syslog('step5: activate module file='.$file); |
|
| 3088 | + $res = dol_include_once("/core/modules/".$file); |
|
| 3089 | 3089 | |
| 3090 | 3090 | $res = activateModule($modtoactivatenew, 1); |
| 3091 | 3091 | if (!empty($res['errors'])) { |
| 3092 | - print 'ERROR: failed to activateModule() file=' . $file; |
|
| 3092 | + print 'ERROR: failed to activateModule() file='.$file; |
|
| 3093 | 3093 | } |
| 3094 | 3094 | } |
| 3095 | 3095 | //print '<br>'; |
@@ -3097,20 +3097,20 @@ discard block |
||
| 3097 | 3097 | |
| 3098 | 3098 | // Now delete the flag that say installation is not complete |
| 3099 | 3099 | $this->dolibarr_install_syslog('step5: remove MAIN_NOT_INSTALLED const'); |
| 3100 | - $resql = $db->query("DELETE FROM " . $config->main_db_prefix . "const WHERE " . $db->decrypt('name') . " = 'MAIN_NOT_INSTALLED'"); |
|
| 3100 | + $resql = $db->query("DELETE FROM ".$config->main_db_prefix."const WHERE ".$db->decrypt('name')." = 'MAIN_NOT_INSTALLED'"); |
|
| 3101 | 3101 | if (!$resql) { |
| 3102 | 3102 | Functions::dol_print_error($db, 'Error in setup program'); |
| 3103 | 3103 | } |
| 3104 | 3104 | |
| 3105 | 3105 | // May fail if parameter already defined |
| 3106 | 3106 | $this->dolibarr_install_syslog('step5: set the default language'); |
| 3107 | - $resql = $db->query("INSERT INTO " . $config->main_db_prefix . "const(name,value,type,visible,note,entity) VALUES (" . $db->encrypt('MAIN_LANG_DEFAULT') . ", " . $db->encrypt($setuplang) . ", 'chaine', 0, 'Default language', 1)"); |
|
| 3107 | + $resql = $db->query("INSERT INTO ".$config->main_db_prefix."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_LANG_DEFAULT').", ".$db->encrypt($setuplang).", 'chaine', 0, 'Default language', 1)"); |
|
| 3108 | 3108 | //if (! $resql) Functions::dol_print_error($db,'Error in setup program'); |
| 3109 | 3109 | |
| 3110 | 3110 | $db->commit(); |
| 3111 | 3111 | } |
| 3112 | 3112 | } else { |
| 3113 | - print $this->lang->trans("ErrorFailedToConnect") . "<br>"; |
|
| 3113 | + print $this->lang->trans("ErrorFailedToConnect")."<br>"; |
|
| 3114 | 3114 | } |
| 3115 | 3115 | } elseif (empty($action) || preg_match('/upgrade/i', $action)) { |
| 3116 | 3116 | // If upgrade |
@@ -3135,28 +3135,28 @@ discard block |
||
| 3135 | 3135 | } |
| 3136 | 3136 | |
| 3137 | 3137 | if ($tagdatabase) { |
| 3138 | - $this->dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_UPGRADE const to value ' . $targetversion); |
|
| 3139 | - $resql = $db->query("DELETE FROM " . $config->main_db_prefix . "const WHERE " . $db->decrypt('name') . " = 'MAIN_VERSION_LAST_UPGRADE'"); |
|
| 3138 | + $this->dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_UPGRADE const to value '.$targetversion); |
|
| 3139 | + $resql = $db->query("DELETE FROM ".$config->main_db_prefix."const WHERE ".$db->decrypt('name')." = 'MAIN_VERSION_LAST_UPGRADE'"); |
|
| 3140 | 3140 | if (!$resql) { |
| 3141 | 3141 | Functions::dol_print_error($db, 'Error in setup program'); |
| 3142 | 3142 | } |
| 3143 | - $resql = $db->query("INSERT INTO " . $config->main_db_prefix . "const(name, value, type, visible, note, entity) VALUES (" . $db->encrypt('MAIN_VERSION_LAST_UPGRADE') . ", " . $db->encrypt($targetversion) . ", 'chaine', 0, 'Dolibarr version for last upgrade', 0)"); |
|
| 3143 | + $resql = $db->query("INSERT INTO ".$config->main_db_prefix."const(name, value, type, visible, note, entity) VALUES (".$db->encrypt('MAIN_VERSION_LAST_UPGRADE').", ".$db->encrypt($targetversion).", 'chaine', 0, 'Dolibarr version for last upgrade', 0)"); |
|
| 3144 | 3144 | if (!$resql) { |
| 3145 | 3145 | Functions::dol_print_error($db, 'Error in setup program'); |
| 3146 | 3146 | } |
| 3147 | 3147 | $conf->global->MAIN_VERSION_LAST_UPGRADE = $targetversion; |
| 3148 | 3148 | } else { |
| 3149 | - $this->dolibarr_install_syslog('step5: we run an upgrade to version ' . $targetversion . ' but database was already upgraded to ' . Functions::getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') . '. We keep MAIN_VERSION_LAST_UPGRADE as it is.'); |
|
| 3149 | + $this->dolibarr_install_syslog('step5: we run an upgrade to version '.$targetversion.' but database was already upgraded to '.Functions::getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').'. We keep MAIN_VERSION_LAST_UPGRADE as it is.'); |
|
| 3150 | 3150 | |
| 3151 | 3151 | // Force the delete of the flag that say installation is not complete |
| 3152 | 3152 | $this->dolibarr_install_syslog('step5: remove MAIN_NOT_INSTALLED const after upgrade process (should not exists but this is a security)'); |
| 3153 | - $resql = $db->query("DELETE FROM " . $config->main_db_prefix . "const WHERE " . $db->decrypt('name') . " = 'MAIN_NOT_INSTALLED'"); |
|
| 3153 | + $resql = $db->query("DELETE FROM ".$config->main_db_prefix."const WHERE ".$db->decrypt('name')." = 'MAIN_NOT_INSTALLED'"); |
|
| 3154 | 3154 | if (!$resql) { |
| 3155 | 3155 | Functions::dol_print_error($db, 'Error in setup program'); |
| 3156 | 3156 | } |
| 3157 | 3157 | } |
| 3158 | 3158 | } else { |
| 3159 | - print $this->lang->trans("ErrorFailedToConnect") . "<br>"; |
|
| 3159 | + print $this->lang->trans("ErrorFailedToConnect")."<br>"; |
|
| 3160 | 3160 | } |
| 3161 | 3161 | } else { |
| 3162 | 3162 | Functions::dol_print_error(null, 'step5.php: unknown choice of action'); |
@@ -3173,7 +3173,7 @@ discard block |
||
| 3173 | 3173 | if ($success) { |
| 3174 | 3174 | if (!Functions::getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) { |
| 3175 | 3175 | // Install is finished (database is on same version than files) |
| 3176 | - print '<br>' . $this->lang->trans("SystemIsInstalled") . "<br>"; |
|
| 3176 | + print '<br>'.$this->lang->trans("SystemIsInstalled")."<br>"; |
|
| 3177 | 3177 | |
| 3178 | 3178 | // Create install.lock file |
| 3179 | 3179 | // No need for the moment to create it automatically, creation by web assistant means permissions are given |
@@ -3182,13 +3182,13 @@ discard block |
||
| 3182 | 3182 | if (!empty($force_install_lockinstall) || Functions::getDolGlobalString('MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE')) { |
| 3183 | 3183 | // Install is finished, we create the "install.lock" file, so install won't be possible anymore. |
| 3184 | 3184 | // TODO Upgrade will be still be possible if a file "upgrade.unlock" is present |
| 3185 | - $lockfile = DOL_DATA_ROOT . '/install.lock'; |
|
| 3185 | + $lockfile = DOL_DATA_ROOT.'/install.lock'; |
|
| 3186 | 3186 | $fp = @fopen($lockfile, "w"); |
| 3187 | 3187 | if ($fp) { |
| 3188 | 3188 | if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) { |
| 3189 | 3189 | $force_install_lockinstall = '444'; // For backward compatibility |
| 3190 | 3190 | } |
| 3191 | - fwrite($fp, "This is a lock file to prevent use of install or upgrade pages (set with permission " . $force_install_lockinstall . ")"); |
|
| 3191 | + fwrite($fp, "This is a lock file to prevent use of install or upgrade pages (set with permission ".$force_install_lockinstall.")"); |
|
| 3192 | 3192 | fclose($fp); |
| 3193 | 3193 | dolChmod($lockfile, $force_install_lockinstall); |
| 3194 | 3194 | |
@@ -3196,25 +3196,25 @@ discard block |
||
| 3196 | 3196 | } |
| 3197 | 3197 | } |
| 3198 | 3198 | if (empty($createlock)) { |
| 3199 | - print '<div class="warning">' . $this->lang->trans("WarningRemoveInstallDir") . "</div>"; |
|
| 3199 | + print '<div class="warning">'.$this->lang->trans("WarningRemoveInstallDir")."</div>"; |
|
| 3200 | 3200 | } |
| 3201 | 3201 | |
| 3202 | 3202 | print "<br>"; |
| 3203 | 3203 | |
| 3204 | - print $this->lang->trans("YouNeedToPersonalizeSetup") . "<br><br><br>"; |
|
| 3204 | + print $this->lang->trans("YouNeedToPersonalizeSetup")."<br><br><br>"; |
|
| 3205 | 3205 | |
| 3206 | - print '<div class="center">> <a href="../admin/index.php?mainmenu=home&leftmenu=setup' . (isset($login) ? '&username=' . urlencode($login) : '') . '">'; |
|
| 3207 | - print '<span class="fas fa-external-link-alt"></span> ' . $this->lang->trans("GoToSetupArea"); |
|
| 3206 | + print '<div class="center">> <a href="../admin/index.php?mainmenu=home&leftmenu=setup'.(isset($login) ? '&username='.urlencode($login) : '').'">'; |
|
| 3207 | + print '<span class="fas fa-external-link-alt"></span> '.$this->lang->trans("GoToSetupArea"); |
|
| 3208 | 3208 | print '</a></div><br>'; |
| 3209 | 3209 | } else { |
| 3210 | 3210 | // If here MAIN_VERSION_LAST_UPGRADE is not empty |
| 3211 | - print $this->lang->trans("VersionLastUpgrade") . ': <b><span class="ok">' . Functions::getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') . '</span></b><br>'; |
|
| 3212 | - print $this->lang->trans("VersionProgram") . ': <b><span class="ok">' . DOL_VERSION . '</span></b><br>'; |
|
| 3213 | - print $this->lang->trans("MigrationNotFinished") . '<br>'; |
|
| 3211 | + print $this->lang->trans("VersionLastUpgrade").': <b><span class="ok">'.Functions::getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').'</span></b><br>'; |
|
| 3212 | + print $this->lang->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b><br>'; |
|
| 3213 | + print $this->lang->trans("MigrationNotFinished").'<br>'; |
|
| 3214 | 3214 | print "<br>"; |
| 3215 | 3215 | |
| 3216 | - print '<div class="center"><a href="' . $dolibarr_main_url_root . '/install/index.php">'; |
|
| 3217 | - print '<span class="fas fa-link-alt"></span> ' . $this->lang->trans("GoToUpgradePage"); |
|
| 3216 | + print '<div class="center"><a href="'.$dolibarr_main_url_root.'/install/index.php">'; |
|
| 3217 | + print '<span class="fas fa-link-alt"></span> '.$this->lang->trans("GoToUpgradePage"); |
|
| 3218 | 3218 | print '</a></div>'; |
| 3219 | 3219 | } |
| 3220 | 3220 | } |
@@ -3223,20 +3223,20 @@ discard block |
||
| 3223 | 3223 | if (!Functions::getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) { |
| 3224 | 3224 | // Upgrade is finished (database is on the same version than files) |
| 3225 | 3225 | print '<img class="valignmiddle inline-block paddingright" src="../theme/common/octicons/build/svg/checklist.svg" width="20" alt="Configuration">'; |
| 3226 | - print ' <span class="valignmiddle">' . $this->lang->trans("SystemIsUpgraded") . "</span><br>"; |
|
| 3226 | + print ' <span class="valignmiddle">'.$this->lang->trans("SystemIsUpgraded")."</span><br>"; |
|
| 3227 | 3227 | |
| 3228 | 3228 | // Create install.lock file if it does not exists. |
| 3229 | 3229 | // Note: it should always exists. A better solution to allow upgrade will be to add an upgrade.unlock file |
| 3230 | 3230 | $createlock = 0; |
| 3231 | 3231 | if (!empty($force_install_lockinstall) || Functions::getDolGlobalString('MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE')) { |
| 3232 | 3232 | // Upgrade is finished, we modify the lock file |
| 3233 | - $lockfile = DOL_DATA_ROOT . '/install.lock'; |
|
| 3233 | + $lockfile = DOL_DATA_ROOT.'/install.lock'; |
|
| 3234 | 3234 | $fp = @fopen($lockfile, "w"); |
| 3235 | 3235 | if ($fp) { |
| 3236 | 3236 | if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) { |
| 3237 | 3237 | $force_install_lockinstall = '444'; // For backward compatibility |
| 3238 | 3238 | } |
| 3239 | - fwrite($fp, "This is a lock file to prevent use of install or upgrade pages (set with permission " . $force_install_lockinstall . ")"); |
|
| 3239 | + fwrite($fp, "This is a lock file to prevent use of install or upgrade pages (set with permission ".$force_install_lockinstall.")"); |
|
| 3240 | 3240 | fclose($fp); |
| 3241 | 3241 | dolChmod($lockfile, $force_install_lockinstall); |
| 3242 | 3242 | |
@@ -3244,31 +3244,31 @@ discard block |
||
| 3244 | 3244 | } |
| 3245 | 3245 | } |
| 3246 | 3246 | if (empty($createlock)) { |
| 3247 | - print '<br><div class="warning">' . $this->lang->trans("WarningRemoveInstallDir") . "</div>"; |
|
| 3247 | + print '<br><div class="warning">'.$this->lang->trans("WarningRemoveInstallDir")."</div>"; |
|
| 3248 | 3248 | } |
| 3249 | 3249 | |
| 3250 | 3250 | // Delete the upgrade.unlock file it it exists |
| 3251 | - $unlockupgradefile = DOL_DATA_ROOT . '/upgrade.unlock'; |
|
| 3251 | + $unlockupgradefile = DOL_DATA_ROOT.'/upgrade.unlock'; |
|
| 3252 | 3252 | dol_delete_file($unlockupgradefile, 0, 0, 0, null, false, 0); |
| 3253 | 3253 | |
| 3254 | 3254 | print "<br>"; |
| 3255 | 3255 | |
| 3256 | - $morehtml = '<br><div class="center"><a href="../index.php?mainmenu=home' . (isset($login) ? '&username=' . urlencode($login) : '') . '">'; |
|
| 3257 | - $morehtml .= '<span class="fas fa-link-alt"></span> ' . $this->lang->trans("GoToDolibarr") . '...'; |
|
| 3256 | + $morehtml = '<br><div class="center"><a href="../index.php?mainmenu=home'.(isset($login) ? '&username='.urlencode($login) : '').'">'; |
|
| 3257 | + $morehtml .= '<span class="fas fa-link-alt"></span> '.$this->lang->trans("GoToDolibarr").'...'; |
|
| 3258 | 3258 | $morehtml .= '</a></div><br>'; |
| 3259 | 3259 | } else { |
| 3260 | 3260 | // If here MAIN_VERSION_LAST_UPGRADE is not empty |
| 3261 | - print $this->lang->trans("VersionLastUpgrade") . ': <b><span class="ok">' . Functions::getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') . '</span></b><br>'; |
|
| 3262 | - print $this->lang->trans("VersionProgram") . ': <b><span class="ok">' . DOL_VERSION . '</span></b>'; |
|
| 3261 | + print $this->lang->trans("VersionLastUpgrade").': <b><span class="ok">'.Functions::getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').'</span></b><br>'; |
|
| 3262 | + print $this->lang->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b>'; |
|
| 3263 | 3263 | |
| 3264 | 3264 | print "<br>"; |
| 3265 | 3265 | |
| 3266 | 3266 | $morehtml = '<br><div class="center"><a href="../install/index.php">'; |
| 3267 | - $morehtml .= '<span class="fas fa-link-alt"></span> ' . $this->lang->trans("GoToUpgradePage"); |
|
| 3267 | + $morehtml .= '<span class="fas fa-link-alt"></span> '.$this->lang->trans("GoToUpgradePage"); |
|
| 3268 | 3268 | $morehtml .= '</a></div>'; |
| 3269 | 3269 | } |
| 3270 | 3270 | } else { |
| 3271 | - Functions::dol_print_error(null, 'step5.php: unknown choice of action=' . $action . ' in create lock file seaction'); |
|
| 3271 | + Functions::dol_print_error(null, 'step5.php: unknown choice of action='.$action.' in create lock file seaction'); |
|
| 3272 | 3272 | } |
| 3273 | 3273 | |
| 3274 | 3274 | // Clear cache files |
@@ -3278,7 +3278,7 @@ discard block |
||
| 3278 | 3278 | if ($error && isset($argv[1])) { |
| 3279 | 3279 | $ret = 1; |
| 3280 | 3280 | } |
| 3281 | - $this->dolibarr_install_syslog("Exit " . $ret); |
|
| 3281 | + $this->dolibarr_install_syslog("Exit ".$ret); |
|
| 3282 | 3282 | |
| 3283 | 3283 | $this->dolibarr_install_syslog("--- step5: Dolibarr setup finished"); |
| 3284 | 3284 | |