@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | * @access public |
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | -include_once XOOPS_ROOT_PATH . '/class/logger/xoopslogger.php'; |
|
| 20 | -include_once XOOPS_ROOT_PATH . '/class/database/databasefactory.php'; |
|
| 21 | -include_once XOOPS_ROOT_PATH . '/class/database/' . XOOPS_DB_TYPE . 'database.php'; |
|
| 22 | -include_once XOOPS_ROOT_PATH . '/class/database/sqlutility.php'; |
|
| 19 | +include_once XOOPS_ROOT_PATH.'/class/logger/xoopslogger.php'; |
|
| 20 | +include_once XOOPS_ROOT_PATH.'/class/database/databasefactory.php'; |
|
| 21 | +include_once XOOPS_ROOT_PATH.'/class/database/'.XOOPS_DB_TYPE.'database.php'; |
|
| 22 | +include_once XOOPS_ROOT_PATH.'/class/database/sqlutility.php'; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Database manager |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $this->db->connect(false); |
| 65 | 65 | |
| 66 | - $result = $this->db->query('CREATE DATABASE ' . XOOPS_DB_NAME); |
|
| 66 | + $result = $this->db->query('CREATE DATABASE '.XOOPS_DB_NAME); |
|
| 67 | 67 | |
| 68 | 68 | return ($result != false); |
| 69 | 69 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | } elseif ($prefixed_query[1] === 'DROP TABLE') { |
| 128 | - if ($this->db->query('DROP TABLE ' . $table) != false) { |
|
| 128 | + if ($this->db->query('DROP TABLE '.$table) != false) { |
|
| 129 | 129 | if (!isset($this->s_tables['drop'][$table])) { |
| 130 | 130 | $this->s_tables['drop'][$table] = 1; |
| 131 | 131 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | { |
| 229 | 229 | $this->db->connect(); |
| 230 | 230 | $table = $this->db->prefix($table); |
| 231 | - $query = 'INSERT INTO ' . $table . ' ' . $query; |
|
| 231 | + $query = 'INSERT INTO '.$table.' '.$query; |
|
| 232 | 232 | if (!$this->db->queryF($query)) { |
| 233 | 233 | if (!isset($this->f_tables['insert'][$table])) { |
| 234 | 234 | $this->f_tables['insert'][$table] = 1; |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $deleted = array(); |
| 267 | 267 | $this->db->connect(); |
| 268 | 268 | foreach ($tables as $key => $val) { |
| 269 | - if (!$this->db->query('DROP TABLE ' . $this->db->prefix($key))) { |
|
| 269 | + if (!$this->db->query('DROP TABLE '.$this->db->prefix($key))) { |
|
| 270 | 270 | $deleted[] = $ct; |
| 271 | 271 | } |
| 272 | 272 | } |
@@ -285,9 +285,9 @@ discard block |
||
| 285 | 285 | $ret = false; |
| 286 | 286 | if ($table != '') { |
| 287 | 287 | $this->db->connect(); |
| 288 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix($table); |
|
| 288 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix($table); |
|
| 289 | 289 | $result = $this->db->query($sql); |
| 290 | - $ret = !empty($result); //return false on error or $table not found |
|
| 290 | + $ret = !empty($result); //return false on error or $table not found |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | return $ret; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function check_config() |
| 31 | 31 | { |
| 32 | - $sql = 'SELECT COUNT(*) FROM `' . $GLOBALS['xoopsDB']->prefix('config') . "` WHERE `conf_name` IN ('break1', 'usetips')"; |
|
| 32 | + $sql = 'SELECT COUNT(*) FROM `'.$GLOBALS['xoopsDB']->prefix('config')."` WHERE `conf_name` IN ('break1', 'usetips')"; |
|
| 33 | 33 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 34 | 34 | return false; |
| 35 | 35 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function check_templates() |
| 45 | 45 | { |
| 46 | - $sql = 'SELECT COUNT(*) FROM `' . $GLOBALS['xoopsDB']->prefix('tplfile') . "` WHERE `tpl_file` IN ('system_header.html', 'system_header.tpl') AND `tpl_type` = 'admin'"; |
|
| 46 | + $sql = 'SELECT COUNT(*) FROM `'.$GLOBALS['xoopsDB']->prefix('tplfile')."` WHERE `tpl_file` IN ('system_header.html', 'system_header.tpl') AND `tpl_type` = 'admin'"; |
|
| 47 | 47 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 48 | 48 | return false; |
| 49 | 49 | } |
@@ -59,13 +59,13 @@ discard block |
||
| 59 | 59 | { |
| 60 | 60 | $dbm = new Db_manager(); |
| 61 | 61 | |
| 62 | - $sql = 'SELECT conf_id FROM `' . $GLOBALS['xoopsDB']->prefix('config') . "` WHERE `conf_name` IN ('cpanel')"; |
|
| 62 | + $sql = 'SELECT conf_id FROM `'.$GLOBALS['xoopsDB']->prefix('config')."` WHERE `conf_name` IN ('cpanel')"; |
|
| 63 | 63 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 64 | 64 | return false; |
| 65 | 65 | } |
| 66 | 66 | $count = $GLOBALS['xoopsDB']->fetchRow($result); |
| 67 | 67 | |
| 68 | - $sql = 'UPDATE `' . $GLOBALS['xoopsDB']->prefix('config') . "` SET `conf_value` = 'default' WHERE `conf_id` = " . $count[0]; |
|
| 68 | + $sql = 'UPDATE `'.$GLOBALS['xoopsDB']->prefix('config')."` SET `conf_value` = 'default' WHERE `conf_id` = ".$count[0]; |
|
| 69 | 69 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 70 | 70 | return false; |
| 71 | 71 | } |
@@ -112,25 +112,25 @@ discard block |
||
| 112 | 112 | require_once '../class/xoopslists.php'; |
| 113 | 113 | $editors = XoopsLists::getDirListAsArray('../class/xoopseditor'); |
| 114 | 114 | foreach ($editors as $dir) { |
| 115 | - $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('" . $dir . "', '" . $dir . "', $block_id)"); |
|
| 115 | + $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('".$dir."', '".$dir."', $block_id)"); |
|
| 116 | 116 | } |
| 117 | 117 | foreach ($editors as $dir) { |
| 118 | - $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('" . $dir . "', '" . $dir . "', $com_id)"); |
|
| 118 | + $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('".$dir."', '".$dir."', $com_id)"); |
|
| 119 | 119 | } |
| 120 | 120 | foreach ($editors as $dir) { |
| 121 | - $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('" . $dir . "', '" . $dir . "', $main_id)"); |
|
| 121 | + $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('".$dir."', '".$dir."', $main_id)"); |
|
| 122 | 122 | } |
| 123 | 123 | $icons = XoopsLists::getDirListAsArray('../modules/system/images/icons'); |
| 124 | 124 | foreach ($icons as $dir) { |
| 125 | - $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('" . $dir . "', '" . $dir . "', $icon_id)"); |
|
| 125 | + $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('".$dir."', '".$dir."', $icon_id)"); |
|
| 126 | 126 | } |
| 127 | 127 | $breadcrumb = XoopsLists::getDirListAsArray('../modules/system/images/breadcrumb'); |
| 128 | 128 | foreach ($breadcrumb as $dir) { |
| 129 | - $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('" . $dir . "', '" . $dir . "', $bc_id)"); |
|
| 129 | + $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('".$dir."', '".$dir."', $bc_id)"); |
|
| 130 | 130 | } |
| 131 | 131 | $jqueryui = XoopsLists::getDirListAsArray('../modules/system/css/ui'); |
| 132 | 132 | foreach ($jqueryui as $dir) { |
| 133 | - $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('" . $dir . "', '" . $dir . "', $jquery_id)"); |
|
| 133 | + $dbm->insert('configoption', " (confop_name,confop_value,conf_id) VALUES ('".$dir."', '".$dir."', $jquery_id)"); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | return true; |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | $time = time(); |
| 148 | 148 | foreach ($modversion['templates'] as $tplfile) { |
| 149 | 149 | // Admin templates |
| 150 | - if (isset($tplfile['type']) && $tplfile['type'] === 'admin' && $fp = fopen('../modules/system/templates/admin/' . $tplfile['file'], 'r')) { |
|
| 151 | - $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '" . addslashes($tplfile['file']) . "', '" . addslashes($tplfile['description']) . "', " . $time . ', ' . $time . ", 'admin')"); |
|
| 152 | - $tplsource = fread($fp, filesize('../modules/system/templates/admin/' . $tplfile['file'])); |
|
| 150 | + if (isset($tplfile['type']) && $tplfile['type'] === 'admin' && $fp = fopen('../modules/system/templates/admin/'.$tplfile['file'], 'r')) { |
|
| 151 | + $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '".addslashes($tplfile['file'])."', '".addslashes($tplfile['description'])."', ".$time.', '.$time.", 'admin')"); |
|
| 152 | + $tplsource = fread($fp, filesize('../modules/system/templates/admin/'.$tplfile['file'])); |
|
| 153 | 153 | fclose($fp); |
| 154 | - $dbm->insert('tplsource', ' (tpl_id, tpl_source) VALUES (' . $newtplid . ", '" . addslashes($tplsource) . "')"); |
|
| 154 | + $dbm->insert('tplsource', ' (tpl_id, tpl_source) VALUES ('.$newtplid.", '".addslashes($tplsource)."')"); |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
@@ -172,10 +172,10 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | private function strayblockCriteria() |
| 174 | 174 | { |
| 175 | - $criteria = new CriteriaCompo(new Criteria('mid','1', '=')); |
|
| 176 | - $criteria->add(new Criteria('block_type','S', '=')); |
|
| 177 | - $criteria->add(new Criteria('func_num','1', '=')); |
|
| 178 | - $criteria->add(new Criteria('template','system_block_user.html', '=')); |
|
| 175 | + $criteria = new CriteriaCompo(new Criteria('mid', '1', '=')); |
|
| 176 | + $criteria->add(new Criteria('block_type', 'S', '=')); |
|
| 177 | + $criteria->add(new Criteria('func_num', '1', '=')); |
|
| 178 | + $criteria->add(new Criteria('template', 'system_block_user.html', '=')); |
|
| 179 | 179 | return $criteria; |
| 180 | 180 | } |
| 181 | 181 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | return false; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - return @$this->xoops_putLicenseKey($this->xoops_buildLicenceKey(), XOOPS_ROOT_PATH . '/include/license.php', __DIR__ . '/license.dist.php'); |
|
| 57 | + return @$this->xoops_putLicenseKey($this->xoops_buildLicenceKey(), XOOPS_ROOT_PATH.'/include/license.php', __DIR__.'/license.dist.php'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $fver_buf = file($license_file_dist); |
| 69 | 69 | foreach ($fver_buf as $line => $value) { |
| 70 | 70 | if (strpos($value, 'XOOPS_LICENSE_KEY') > 0) { |
| 71 | - $ret = 'define(\'XOOPS_LICENSE_KEY\', \'' . $system_key . "');"; |
|
| 71 | + $ret = 'define(\'XOOPS_LICENSE_KEY\', \''.$system_key."');"; |
|
| 72 | 72 | } else { |
| 73 | 73 | $ret = $value; |
| 74 | 74 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | fclose($fver); |
| 78 | 78 | chmod($licensefile, 0444); |
| 79 | 79 | |
| 80 | - return 'Written License Key: ' . $system_key; |
|
| 80 | + return 'Written License Key: '.$system_key; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | public function xoops_buildLicenceKey() |
| 88 | 88 | { |
| 89 | 89 | $xoops_serdat = array(); |
| 90 | - mt_srand(((float)('0' . substr(microtime(), strpos(microtime(), ' ') + 1, strlen(microtime()) - strpos(microtime(), ' ') + 1))) * mt_rand(30, 99999)); |
|
| 91 | - mt_srand(((float)('0' . substr(microtime(), strpos(microtime(), ' ') + 1, strlen(microtime()) - strpos(microtime(), ' ') + 1))) * mt_rand(30, 99999)); |
|
| 90 | + mt_srand(((float)('0'.substr(microtime(), strpos(microtime(), ' ') + 1, strlen(microtime()) - strpos(microtime(), ' ') + 1))) * mt_rand(30, 99999)); |
|
| 91 | + mt_srand(((float)('0'.substr(microtime(), strpos(microtime(), ' ') + 1, strlen(microtime()) - strpos(microtime(), ' ') + 1))) * mt_rand(30, 99999)); |
|
| 92 | 92 | $checksums = array(1 => 'md5', 2 => 'sha1'); |
| 93 | 93 | $type = mt_rand(1, 2); |
| 94 | 94 | $func = $checksums[$type]; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | while (strlen($xoops_key) > 40) { |
| 126 | 126 | $lpos = mt_rand(18, strlen($xoops_key)); |
| 127 | - $xoops_key = substr($xoops_key, 0, $lpos) . substr($xoops_key, $lpos + 1, strlen($xoops_key) - ($lpos + 1)); |
|
| 127 | + $xoops_key = substr($xoops_key, 0, $lpos).substr($xoops_key, $lpos + 1, strlen($xoops_key) - ($lpos + 1)); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | return $this->xoops_stripeKey($xoops_key); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if ($i < $length) { |
| 145 | 145 | ++$uu; |
| 146 | 146 | if ($uu == $strip) { |
| 147 | - $ret .= substr($xoops_key, $i, 1) . '-'; |
|
| 147 | + $ret .= substr($xoops_key, $i, 1).'-'; |
|
| 148 | 148 | $uu = 0; |
| 149 | 149 | } else { |
| 150 | 150 | if (substr($xoops_key, $i, 1) != '-') { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $tables['xoopscomments'] = array('com_status'); |
| 180 | 180 | |
| 181 | 181 | foreach ($tables as $table => $keys) { |
| 182 | - $sql = 'SHOW KEYS FROM `' . $GLOBALS['xoopsDB']->prefix($table) . '`'; |
|
| 182 | + $sql = 'SHOW KEYS FROM `'.$GLOBALS['xoopsDB']->prefix($table).'`'; |
|
| 183 | 183 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 184 | 184 | continue; |
| 185 | 185 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $tables['xoopscomments'] = array('com_status'); |
| 211 | 211 | |
| 212 | 212 | foreach ($tables as $table => $keys) { |
| 213 | - $sql = 'SHOW KEYS FROM `' . $GLOBALS['xoopsDB']->prefix($table) . '`'; |
|
| 213 | + $sql = 'SHOW KEYS FROM `'.$GLOBALS['xoopsDB']->prefix($table).'`'; |
|
| 214 | 214 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 215 | 215 | continue; |
| 216 | 216 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | foreach ($keys as $key) { |
| 222 | 222 | if (!in_array($key, $existing_keys)) { |
| 223 | - $sql = 'ALTER TABLE `' . $GLOBALS['xoopsDB']->prefix($table) . "` ADD INDEX `{$key}` (`{$key}`)"; |
|
| 223 | + $sql = 'ALTER TABLE `'.$GLOBALS['xoopsDB']->prefix($table)."` ADD INDEX `{$key}` (`{$key}`)"; |
|
| 224 | 224 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 225 | 225 | return false; |
| 226 | 226 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $this->tasks = array('sess_id', 'mainfile', 'zaplegacy'); |
| 26 | 26 | $this->usedFiles = array( |
| 27 | 27 | 'mainfile.php', |
| 28 | - XOOPS_VAR_PATH . '/data/secure.php', |
|
| 28 | + XOOPS_VAR_PATH.'/data/secure.php', |
|
| 29 | 29 | 'modules/system/themes/legacy/legacy.php' |
| 30 | 30 | ); |
| 31 | 31 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $row = $db->fetchRow($result); |
| 61 | 61 | if ($row) { |
| 62 | 62 | $columnLength = $row[0]; |
| 63 | - return (int) $columnLength; |
|
| 63 | + return (int)$columnLength; |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | return 0; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function check_sess_id() |
| 75 | 75 | { |
| 76 | - return (bool) ($this->getColumnLength('session', 'sess_id') >= 256); |
|
| 76 | + return (bool)($this->getColumnLength('session', 'sess_id') >= 256); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -104,10 +104,10 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | $path .= '/'; |
| 106 | 106 | clearstatcache(); |
| 107 | - if (!$inFile = fopen($path . $sourceName, 'r')) { |
|
| 107 | + if (!$inFile = fopen($path.$sourceName, 'r')) { |
|
| 108 | 108 | return sprintf(_FILE_ACCESS_ERROR, $sourceName); |
| 109 | 109 | } else { |
| 110 | - $content = fread($inFile, filesize($path . $sourceName)); |
|
| 110 | + $content = fread($inFile, filesize($path.$sourceName)); |
|
| 111 | 111 | fclose($inFile); |
| 112 | 112 | |
| 113 | 113 | foreach ($vars as $key => $val) { |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $content = preg_replace("/(define\()([\"'])({$key})\\2,\s*([\"'])(.*?)\\4\s*\)/", "define('{$key}', '{$val}')", $content); |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | - $outFile = fopen($path . $fileName, 'w'); |
|
| 121 | + $outFile = fopen($path.$fileName, 'w'); |
|
| 122 | 122 | if (false === $outFile) { |
| 123 | 123 | return sprintf(_FILE_ACCESS_ERROR, $fileName); |
| 124 | 124 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | } else { |
| 168 | 168 | $result = $this->writeConfigurationFile( |
| 169 | 169 | $upgradeControl->mainfileKeys, |
| 170 | - XOOPS_VAR_PATH . '/data', |
|
| 170 | + XOOPS_VAR_PATH.'/data', |
|
| 171 | 171 | 'secure.dist.php', |
| 172 | 172 | 'secure.php' |
| 173 | 173 | ); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | public function apply_zaplegacy() |
| 198 | 198 | { |
| 199 | 199 | $fileName = 'modules/system/themes/legacy/legacy.php'; |
| 200 | - $result = rename('../' . $fileName, '../' . $fileName . '.bak'); |
|
| 200 | + $result = rename('../'.$fileName, '../'.$fileName.'.bak'); |
|
| 201 | 201 | if (false === $result) { |
| 202 | 202 | return sprintf(_FILE_ACCESS_ERROR, $fileName); |
| 203 | 203 | } |
@@ -7,9 +7,9 @@ |
||
| 7 | 7 | define('LEGEND_DATABASE', 'Database Character Set'); |
| 8 | 8 | |
| 9 | 9 | define('XOOPS_LIB_PATH_LABEL', 'XOOPS library directory'); |
| 10 | -define('XOOPS_LIB_PATH_HELP', 'Physical path to the XOOPS library directory WITHOUT trailing slash, for forward compatibility. Locate the folder out of ' . XOOPS_ROOT_PATH . ' to make it secure.'); |
|
| 10 | +define('XOOPS_LIB_PATH_HELP', 'Physical path to the XOOPS library directory WITHOUT trailing slash, for forward compatibility. Locate the folder out of '.XOOPS_ROOT_PATH.' to make it secure.'); |
|
| 11 | 11 | define('XOOPS_DATA_PATH_LABEL', 'XOOPS datafiles directory'); |
| 12 | -define('XOOPS_DATA_PATH_HELP', 'Physical path to the XOOPS datafiles (writable) directory WITHOUT trailing slash, for forward compatibility. Locate the folder out of ' . XOOPS_ROOT_PATH . ' to make it secure.'); |
|
| 12 | +define('XOOPS_DATA_PATH_HELP', 'Physical path to the XOOPS datafiles (writable) directory WITHOUT trailing slash, for forward compatibility. Locate the folder out of '.XOOPS_ROOT_PATH.' to make it secure.'); |
|
| 13 | 13 | |
| 14 | 14 | define('DB_COLLATION_LABEL', 'Database character set and collation'); |
| 15 | 15 | define('DB_COLLATION_HELP', "As of 4.12 MySQL supports custom character set and collation. However it is more complex than expected, so DON'T make any change unless you are confident with your choice."); |
@@ -89,22 +89,22 @@ discard block |
||
| 89 | 89 | } else { |
| 90 | 90 | if (!empty($upgradeControl->needWriteFiles)) { |
| 91 | 91 | echo '<div class="panel panel-danger">' |
| 92 | - . '<div class="panel-heading">' . _SET_FILES_WRITABLE . '</div>' |
|
| 92 | + . '<div class="panel-heading">'._SET_FILES_WRITABLE.'</div>' |
|
| 93 | 93 | . '<div class="panel-body"><ul class="fa-ul">'; |
| 94 | 94 | foreach ($upgradeControl->needWriteFiles as $file) { |
| 95 | - echo '<li><i class="fa-li fa fa-ban text-danger"></i>' . $file . '</li>'; |
|
| 95 | + echo '<li><i class="fa-li fa fa-ban text-danger"></i>'.$file.'</li>'; |
|
| 96 | 96 | $GLOBALS['error'] = true; |
| 97 | 97 | } |
| 98 | 98 | echo '</ul></div></div>'; |
| 99 | 99 | } else { |
| 100 | 100 | $next = $upgradeControl->getNextPatch(); |
| 101 | - printf('<h2>' . _PERFORMING_UPGRADE . '</h2>', $next); |
|
| 101 | + printf('<h2>'._PERFORMING_UPGRADE.'</h2>', $next); |
|
| 102 | 102 | /** @var $upgrader XoopsUpgrade */ |
| 103 | 103 | $upgradeClass = $upgradeControl->upgradeQueue[$next]->patchClass; |
| 104 | 104 | $upgrader = new $upgradeClass(); |
| 105 | 105 | $res = $upgrader->apply(); |
| 106 | 106 | if ($message = $upgrader->message()) { |
| 107 | - echo '<div class="well">' . $message . '</div>'; |
|
| 107 | + echo '<div class="well">'.$message.'</div>'; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | if ($res) { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | if (0 === $upgradeControl->countUpgradeQueue()) { |
| 116 | 116 | echo $upgradeControl->oneButtonContinueForm( |
| 117 | - XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=system', |
|
| 117 | + XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&op=update&module=system', |
|
| 118 | 118 | array() |
| 119 | 119 | ); |
| 120 | 120 | } else { |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | <meta name="description" content=""> |
| 16 | 16 | <meta name="author" content=""> |
| 17 | 17 | |
| 18 | - <title><?php echo XOOPS_VERSION . ' : ' . _XOOPS_UPGRADE; ?></title> |
|
| 18 | + <title><?php echo XOOPS_VERSION.' : '._XOOPS_UPGRADE; ?></title> |
|
| 19 | 19 | |
| 20 | 20 | <link rel="icon" type="image/png" href="<?php echo XOOPS_URL ?>/upgrade/assets/img/favicon.png"/> |
| 21 | 21 | <!-- Bootstrap Core CSS --> |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | ?> |
| 41 | 41 | <?php |
| 42 | - if (file_exists('language/' . $upgradeControl->upgradeLanguage . '/style.css')) { |
|
| 42 | + if (file_exists('language/'.$upgradeControl->upgradeLanguage.'/style.css')) { |
|
| 43 | 43 | echo '<link rel="stylesheet" type="text/css" media="all" href="language/' |
| 44 | - . $upgradeControl->upgradeLanguage . '/style.css" />'; |
|
| 44 | + . $upgradeControl->upgradeLanguage.'/style.css" />'; |
|
| 45 | 45 | } |
| 46 | 46 | ?> |
| 47 | 47 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $languages = $upgradeControl->availableLanguages(); |
| 72 | 72 | foreach ($languages as $lang) { |
| 73 | 73 | $upgradeControl->loadLanguage('support', $lang); |
| 74 | - echo '<li><a href="?lang=' . $lang . '">' . $lang . '</a></li>'; |
|
| 74 | + echo '<li><a href="?lang='.$lang.'">'.$lang.'</a></li>'; |
|
| 75 | 75 | } |
| 76 | 76 | ?> |
| 77 | 77 | </ul> |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | <ul class="dropdown-menu"> |
| 82 | 82 | <?php |
| 83 | 83 | foreach ($upgradeControl->supportSites as $lang => $support) { |
| 84 | - echo '<li><a href="' . $support['url'] . '" target="_blank">' . $support['title'] . '</a></li>'; |
|
| 84 | + echo '<li><a href="'.$support['url'].'" target="_blank">'.$support['title'].'</a></li>'; |
|
| 85 | 85 | } |
| 86 | 86 | ?> |
| 87 | 87 | </ul> |
@@ -98,14 +98,14 @@ discard block |
||
| 98 | 98 | foreach ($upgradeControl->upgradeQueue as $stepName => $info) { |
| 99 | 99 | if (!$info->applied && $firstNeeded) { |
| 100 | 100 | echo'<li class="active"><a><span class="fa fa-exclamation-triangle"></span> ' |
| 101 | - . $stepName . '</a></li>'; |
|
| 101 | + . $stepName.'</a></li>'; |
|
| 102 | 102 | $firstNeeded = false; |
| 103 | 103 | } elseif (!$info->applied) { |
| 104 | 104 | echo'<li><a><span class="fa fa-exclamation-triangle text-warning"></span> ' |
| 105 | - . $stepName . '</a></li>'; |
|
| 105 | + . $stepName.'</a></li>'; |
|
| 106 | 106 | } else { |
| 107 | 107 | echo'<li><a><span class="fa fa-check text-success"></span> ' |
| 108 | - . $stepName . '</a></li>'; |
|
| 108 | + . $stepName.'</a></li>'; |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | ?> |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | </div> |
| 160 | 160 | </div> |
| 161 | 161 | <?php |
| 162 | - $versionParts=array(); |
|
| 163 | - $versionResult = preg_match ('/(^[a-z\s]*)([0-9\.]*)/i', XOOPS_VERSION, $versionParts); |
|
| 162 | + $versionParts = array(); |
|
| 163 | + $versionResult = preg_match('/(^[a-z\s]*)([0-9\.]*)/i', XOOPS_VERSION, $versionParts); |
|
| 164 | 164 | ?> |
| 165 | 165 | |
| 166 | 166 | <div class="col-lg-3 col-md-6"> |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | * Check the url to see if we reached 'page_end.php' and if so, launch the cleanup via ajax. |
| 216 | 216 | **/ |
| 217 | 217 | if ('page_end.php' == location.pathname.substring(location.pathname.lastIndexOf('/') + 1)) { |
| 218 | - $.post( "cleanup.php", { instsuffix: <?php echo isset($install_rename_suffix) ? "'" . $install_rename_suffix . "'" : "''"; ?> } ); |
|
| 218 | + $.post( "cleanup.php", { instsuffix: <?php echo isset($install_rename_suffix) ? "'".$install_rename_suffix."'" : "''"; ?> } ); |
|
| 219 | 219 | }; |
| 220 | 220 | }); |
| 221 | 221 | </script> |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | "; |
| 37 | - $manual = '<h2>' . _MANUAL_INSTRUCTIONS . "</h2>\n<p>" . sprintf(_COPY_RED_LINES, 'mainfile.php') . "</p> |
|
| 37 | + $manual = '<h2>'._MANUAL_INSTRUCTIONS."</h2>\n<p>".sprintf(_COPY_RED_LINES, 'mainfile.php')."</p> |
|
| 38 | 38 | <pre style='border:1px solid black;width:650px;overflow:auto;'><span style='color:#ff0000;font-weight:bold;'>$patchCode</span> |
| 39 | 39 | if (!isset(\$xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') { |
| 40 | 40 | include XOOPS_ROOT_PATH.\"/include/common.php\"; |
| 41 | 41 | } |
| 42 | 42 | </pre>"; |
| 43 | - $lines = file('../mainfile.php'); |
|
| 43 | + $lines = file('../mainfile.php'); |
|
| 44 | 44 | |
| 45 | 45 | $insert = -1; |
| 46 | 46 | $matchProtector = '/modules/protector/include/precheck.inc.php'; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | if ($insert == -1) { |
| 61 | - printf(_FAILED_PATCH . '<br>', 'mainfile.php'); |
|
| 61 | + printf(_FAILED_PATCH.'<br>', 'mainfile.php'); |
|
| 62 | 62 | echo $manual; |
| 63 | 63 | |
| 64 | 64 | return false; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $prepend = implode('', array_slice($lines, 0, $insert)); |
| 81 | 81 | $append = implode('', array_slice($lines, $insert)); |
| 82 | 82 | |
| 83 | - $content = $prepend . $patchCode . $append; |
|
| 83 | + $content = $prepend.$patchCode.$append; |
|
| 84 | 84 | $content = str_replace(array("\r\n", "\n"), $newline, $content); |
| 85 | 85 | |
| 86 | 86 | fwrite($fp, $content); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | public function check_auth_db() |
| 100 | 100 | { |
| 101 | 101 | $db = $GLOBALS['xoopsDB']; |
| 102 | - $value = $this->getDbValue($db, 'config', 'conf_id', "`conf_name` = 'ldap_provisionning' AND `conf_catid` = " . XOOPS_CONF_AUTH); |
|
| 102 | + $value = $this->getDbValue($db, 'config', 'conf_id', "`conf_name` = 'ldap_provisionning' AND `conf_catid` = ".XOOPS_CONF_AUTH); |
|
| 103 | 103 | |
| 104 | 104 | return (bool)$value; |
| 105 | 105 | } |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | $cat = $this->getDbValue($db, 'configcategory', 'confcat_id', "`confcat_name` ='_MD_AM_AUTHENTICATION'"); |
| 126 | 126 | if ($cat !== false && $cat != XOOPS_CONF_AUTH) { |
| 127 | 127 | // 2.2 downgrade bug: LDAP cat is here but has a catid of 0 |
| 128 | - $db->queryF('DELETE FROM ' . $db->prefix('configcategory') . " WHERE `confcat_name` ='_MD_AM_AUTHENTICATION' "); |
|
| 129 | - $db->queryF('DELETE FROM ' . $db->prefix('config') . " WHERE `conf_modid`=0 AND `conf_catid` = $cat"); |
|
| 128 | + $db->queryF('DELETE FROM '.$db->prefix('configcategory')." WHERE `confcat_name` ='_MD_AM_AUTHENTICATION' "); |
|
| 129 | + $db->queryF('DELETE FROM '.$db->prefix('config')." WHERE `conf_modid`=0 AND `conf_catid` = $cat"); |
|
| 130 | 130 | $cat = false; |
| 131 | 131 | } |
| 132 | 132 | if (empty($cat)) { |
| 133 | 133 | // Insert config category ( always XOOPS_CONF_AUTH = 7 ) |
| 134 | - $db->queryF(' INSERT INTO ' . $db->prefix('configcategory') . " (confcat_id,confcat_name) VALUES (7,'_MD_AM_AUTHENTICATION')"); |
|
| 134 | + $db->queryF(' INSERT INTO '.$db->prefix('configcategory')." (confcat_id,confcat_name) VALUES (7,'_MD_AM_AUTHENTICATION')"); |
|
| 135 | 135 | } |
| 136 | 136 | // Insert config values |
| 137 | 137 | $table = $db->prefix('config'); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | 'ldap_manager_dn' => "'_MD_AM_LDAP_MANAGER_DN', 'manager_dn', '_MD_AM_LDAP_MANAGER_DN_DESC', 'textbox', 'text', 5", |
| 143 | 143 | 'ldap_manager_pass' => "'_MD_AM_LDAP_MANAGER_PASS', 'manager_pass', '_MD_AM_LDAP_MANAGER_PASS_DESC', 'textbox', 'text', 6", |
| 144 | 144 | 'ldap_version' => "'_MD_AM_LDAP_VERSION', '3', '_MD_AM_LDAP_VERSION_DESC', 'textbox', 'text', 7", |
| 145 | - 'ldap_users_bypass' => "'_MD_AM_LDAP_USERS_BYPASS', '" . serialize(array('admin')) . "', '_MD_AM_LDAP_USERS_BYPASS_DESC', 'textarea', 'array', 8", |
|
| 145 | + 'ldap_users_bypass' => "'_MD_AM_LDAP_USERS_BYPASS', '".serialize(array('admin'))."', '_MD_AM_LDAP_USERS_BYPASS_DESC', 'textarea', 'array', 8", |
|
| 146 | 146 | 'ldap_loginname_asdn' => "'_MD_AM_LDAP_LOGINNAME_ASDN', 'uid_asdn', '_MD_AM_LDAP_LOGINNAME_ASDN_D', 'yesno', 'int', 9", |
| 147 | 147 | 'ldap_loginldap_attr' => "'_MD_AM_LDAP_LOGINLDAP_ATTR', 'uid', '_MD_AM_LDAP_LOGINLDAP_ATTR_D', 'textbox', 'text', 10", |
| 148 | 148 | 'ldap_filter_person' => "'_MD_AM_LDAP_FILTER_PERSON', '', '_MD_AM_LDAP_FILTER_PERSON_DESC', 'textbox', 'text', 11", |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | 'ldap_surname_attr' => "'_MD_AM_LDAP_SURNAME_ATTR', 'sn', '_MD_AM_LDAP_SURNAME_ATTR_DESC', 'textbox', 'text', 17"); |
| 155 | 155 | foreach ($data as $name => $values) { |
| 156 | 156 | if (!$this->getDbValue($db, 'config', 'conf_id', "`conf_modid`=0 AND `conf_catid`=7 AND `conf_name`='$name'")) { |
| 157 | - $this->query("INSERT INTO `$table` (conf_modid,conf_catid,conf_name,conf_title,conf_value,conf_desc,conf_formtype,conf_valuetype,conf_order) " . "VALUES ( 0,7,'$name',$values)"); |
|
| 157 | + $this->query("INSERT INTO `$table` (conf_modid,conf_catid,conf_name,conf_title,conf_value,conf_desc,conf_formtype,conf_valuetype,conf_order) "."VALUES ( 0,7,'$name',$values)"); |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | // Insert auth_method config options |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | return false; |
| 59 | 59 | } |
| 60 | 60 | if (XOOPS_LICENSE_KEY == '000000-000000-000000-000000-000000') { |
| 61 | - return @$this->xoops_putLicenseKey($this->xoops_buildLicenceKey(), XOOPS_ROOT_PATH . '/include/license.php', __DIR__ . '/license.dist.php'); |
|
| 61 | + return @$this->xoops_putLicenseKey($this->xoops_buildLicenceKey(), XOOPS_ROOT_PATH.'/include/license.php', __DIR__.'/license.dist.php'); |
|
| 62 | 62 | } else { |
| 63 | - return @$this->xoops_upgradeLicenseKey($this->xoops_getPublicLicenceKey(), XOOPS_ROOT_PATH . '/include/license.php', __DIR__ . '/license.dist.php'); |
|
| 63 | + return @$this->xoops_upgradeLicenseKey($this->xoops_getPublicLicenceKey(), XOOPS_ROOT_PATH.'/include/license.php', __DIR__.'/license.dist.php'); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | chmod($licensefile, 0777); |
| 74 | 74 | $fver = fopen($licensefile, 'w'); |
| 75 | 75 | $fver_buf = file($license_file_dist); |
| 76 | - $license_key = $public_key . substr(XOOPS_LICENSE_KEY, 13, strlen(XOOPS_LICENSE_KEY) - 13); |
|
| 76 | + $license_key = $public_key.substr(XOOPS_LICENSE_KEY, 13, strlen(XOOPS_LICENSE_KEY) - 13); |
|
| 77 | 77 | foreach ($fver_buf as $line => $value) { |
| 78 | 78 | if (strpos($value, 'XOOPS_LICENSE_KEY') > 0) { |
| 79 | - $ret = 'define(\'XOOPS_LICENSE_KEY\', \'' . $license_key . "');"; |
|
| 79 | + $ret = 'define(\'XOOPS_LICENSE_KEY\', \''.$license_key."');"; |
|
| 80 | 80 | } else { |
| 81 | 81 | $ret = $value; |
| 82 | 82 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | fclose($fver); |
| 86 | 86 | chmod($licensefile, 0444); |
| 87 | 87 | |
| 88 | - return 'Written License Key: ' . $license_key; |
|
| 88 | + return 'Written License Key: '.$license_key; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $fver_buf = file($license_file_dist); |
| 100 | 100 | foreach ($fver_buf as $line => $value) { |
| 101 | 101 | if (strpos($value, 'XOOPS_LICENSE_KEY') > 0) { |
| 102 | - $ret = 'define(\'XOOPS_LICENSE_KEY\', \'' . $system_key . "');"; |
|
| 102 | + $ret = 'define(\'XOOPS_LICENSE_KEY\', \''.$system_key."');"; |
|
| 103 | 103 | } else { |
| 104 | 104 | $ret = $value; |
| 105 | 105 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | fclose($fver); |
| 109 | 109 | chmod($licensefile, 0444); |
| 110 | 110 | |
| 111 | - return 'Written License Key: ' . $system_key; |
|
| 111 | + return 'Written License Key: '.$system_key; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | public function xoops_buildLicenceKey() |
| 160 | 160 | { |
| 161 | 161 | $xoops_serdat = array(); |
| 162 | - mt_srand(((float)('0' . substr(microtime(), strpos(microtime(), ' ') + 1, strlen(microtime()) - strpos(microtime(), ' ') + 1))) * mt_rand(30, 99999)); |
|
| 163 | - mt_srand(((float)('0' . substr(microtime(), strpos(microtime(), ' ') + 1, strlen(microtime()) - strpos(microtime(), ' ') + 1))) * mt_rand(30, 99999)); |
|
| 162 | + mt_srand(((float)('0'.substr(microtime(), strpos(microtime(), ' ') + 1, strlen(microtime()) - strpos(microtime(), ' ') + 1))) * mt_rand(30, 99999)); |
|
| 163 | + mt_srand(((float)('0'.substr(microtime(), strpos(microtime(), ' ') + 1, strlen(microtime()) - strpos(microtime(), ' ') + 1))) * mt_rand(30, 99999)); |
|
| 164 | 164 | $checksums = array(1 => 'md5', 2 => 'sha1'); |
| 165 | 165 | $type = mt_rand(1, 2); |
| 166 | 166 | $func = $checksums[$type]; |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | while (strlen($xoops_key) > 40) { |
| 199 | 199 | $lpos = mt_rand(18, strlen($xoops_key)); |
| 200 | - $xoops_key = substr($xoops_key, 0, $lpos) . substr($xoops_key, $lpos + 1, strlen($xoops_key) - ($lpos + 1)); |
|
| 200 | + $xoops_key = substr($xoops_key, 0, $lpos).substr($xoops_key, $lpos + 1, strlen($xoops_key) - ($lpos + 1)); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | return $this->xoops_stripeKey($xoops_key); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | if ($i < $length) { |
| 216 | 216 | ++$uu; |
| 217 | 217 | if ($uu == $strip) { |
| 218 | - $ret .= substr($xoops_key, $i, 1) . '-'; |
|
| 218 | + $ret .= substr($xoops_key, $i, 1).'-'; |
|
| 219 | 219 | $uu = 0; |
| 220 | 220 | } else { |
| 221 | 221 | if (substr($xoops_key, $i, 1) != '-') { |