PageRenderTime 54ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/public_html/admin/install/index.php

https://bitbucket.org/dhaun/geeklog
PHP | 1305 lines | 915 code | 174 blank | 216 comment | 170 complexity | f7ed8fa7d700ce7f35d8f3b6d6a19139 MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.1

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /* Reminder: always indent with 4 spaces (no tabs). */
  3. // +---------------------------------------------------------------------------+
  4. // | Geeklog 1.8 |
  5. // +---------------------------------------------------------------------------+
  6. // | index.php |
  7. // | |
  8. // | Geeklog installation script. |
  9. // +---------------------------------------------------------------------------+
  10. // | Copyright (C) 2007-2011 by the following authors: |
  11. // | |
  12. // | Authors: Matt West - matt AT mattdanger DOT net |
  13. // | Dirk Haun - dirk AT haun-online DOT de |
  14. // +---------------------------------------------------------------------------+
  15. // | |
  16. // | This program is free software; you can redistribute it and/or |
  17. // | modify it under the terms of the GNU General Public License |
  18. // | as published by the Free Software Foundation; either version 2 |
  19. // | of the License, or (at your option) any later version. |
  20. // | |
  21. // | This program is distributed in the hope that it will be useful, |
  22. // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
  23. // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
  24. // | GNU General Public License for more details. |
  25. // | |
  26. // | You should have received a copy of the GNU General Public License |
  27. // | along with this program; if not, write to the Free Software Foundation, |
  28. // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
  29. // | |
  30. // +---------------------------------------------------------------------------+
  31. // | You don't need to change anything in this file. Please read |
  32. // | docs/english/install.html which describes how to install Geeklog. |
  33. // +---------------------------------------------------------------------------+
  34. require_once 'lib-install.php';
  35. require_once 'lib-upgrade.php';
  36. /**
  37. * Installer engine
  38. *
  39. * The guts of the installation and upgrade package.
  40. *
  41. * @param string $install_type 'install' or 'upgrade'
  42. * @param int $install_step 1 - 4
  43. */
  44. function INST_installEngine($install_type, $install_step)
  45. {
  46. global $_CONF, $_TABLES, $LANG_INSTALL, $LANG_CHARSET, $_DB, $_DB_dbms, $_DB_table_prefix, $_URL, $gl_path, $html_path, $dbconfig_path, $siteconfig_path, $display, $language, $form_label_dir, $use_innodb;
  47. switch ($install_step) {
  48. /**
  49. * Page 1 - Enter Geeklog config information
  50. */
  51. case 1:
  52. require_once $dbconfig_path; // Get the current DB info
  53. if ($install_type == 'upgrade') {
  54. $v = INST_checkPost150Upgrade($dbconfig_path, $siteconfig_path);
  55. // will skip to step 3 if possible, otherwise return here
  56. if ($v == VERSION) {
  57. // looks like we're already up to date
  58. $display .= '<h2>' . $LANG_INSTALL[74] . '</h2>' . LB
  59. . '<p>' . $LANG_INSTALL[75] . '</p>';
  60. return;
  61. }
  62. }
  63. $display .= '<h1 class="heading">' . $LANG_INSTALL[101] . ' ' . htmlspecialchars($_REQUEST['display_step']) . ' - ' . $LANG_INSTALL[102] . '</h1>' . LB;
  64. // Set all the form values either with their defaults or with received POST data.
  65. // The only instance where you'd get POST data would be if the user has to
  66. // go back because they entered incorrect database information.
  67. $site_name = (isset($_POST['site_name'])) ? str_replace('\\', '', $_POST['site_name']) : $LANG_INSTALL[29];
  68. $site_slogan = (isset($_POST['site_slogan'])) ? str_replace('\\', '', $_POST['site_slogan']) : $LANG_INSTALL[30];
  69. $db_selected = '';
  70. if (isset($_POST['db_type'])) {
  71. switch ($_POST['db_type']) {
  72. case 'mysql-innodb':
  73. $db_selected = 'mysql-innodb';
  74. break;
  75. case 'mssql':
  76. $db_selected = 'mssql';
  77. break;
  78. case 'pgsql':
  79. $db_selected = 'pgsql';
  80. break;
  81. default:
  82. $db_selected = 'mysql';
  83. break;
  84. }
  85. } else {
  86. switch ($_DB_dbms) {
  87. case 'mssql':
  88. $db_selected = 'mssql';
  89. break;
  90. case 'pgsql':
  91. $db_selected = 'pgsql';
  92. break;
  93. default:
  94. $db_selected = 'mysql';
  95. break;
  96. }
  97. }
  98. if (($_DB_host != 'localhost') || ($_DB_name != 'geeklog') ||
  99. ($_DB_user != 'username') || ($_DB_pass != 'password')) {
  100. // only display those if they all have their default values
  101. $_DB_host = '';
  102. $_DB_name = '';
  103. $_DB_user = '';
  104. $_DB_pass = '';
  105. }
  106. $db_host = isset($_POST['db_host']) ? $_POST['db_host']
  107. : ($_DB_host != 'localhost' ? '' : $_DB_host);
  108. $db_name = isset($_POST['db_name']) ? $_POST['db_name']
  109. : ($_DB_name != 'geeklog' ? '' : $_DB_name);
  110. $db_user = isset($_POST['db_user']) ? $_POST['db_user']
  111. : ($_DB_user != 'username' ? '' : $_DB_user);
  112. $db_pass = isset($_POST['db_pass']) ? $_POST['db_pass'] : '';
  113. $db_prefix = isset($_POST['db_prefix']) ? $_POST['db_prefix']
  114. : $_DB_table_prefix;
  115. $site_url = isset($_POST['site_url']) ? $_POST['site_url'] : INST_getSiteUrl();
  116. $site_admin_url = isset($_POST['site_admin_url']) ? $_POST['site_admin_url'] : INST_getSiteAdminUrl();
  117. $host_name = explode(':', $_SERVER['HTTP_HOST']);
  118. $host_name = $host_name[0];
  119. if (empty($_CONF['site_mail'])) {
  120. $_CONF['site_mail'] = 'admin@example.com';
  121. }
  122. $site_mail = isset($_POST['site_mail']) ? $_POST['site_mail'] : ($_CONF['site_mail'] != 'admin@example.com' ? $_CONF['site_mail'] : 'admin@' . $host_name);
  123. if (empty($_CONF['noreply_mail'])) {
  124. $_CONF['noreply_mail'] = 'noreply@example.com';
  125. }
  126. $noreply_mail = isset($_POST['noreply_mail']) ? $_POST['noreply_mail'] : ($_CONF['noreply_mail'] != 'noreply@example.com' ? $_CONF['noreply_mail'] : 'noreply@' . $host_name);
  127. if (isset($_POST['utf8']) && ($_POST['utf8'] == 'on')) {
  128. $utf8 = true;
  129. } else {
  130. $utf8 = false;
  131. if (strcasecmp($LANG_CHARSET, 'utf-8') == 0) {
  132. $utf8 = true;
  133. }
  134. }
  135. if ($install_type == 'install') {
  136. $buttontext = $LANG_INSTALL[50];
  137. } else {
  138. $buttontext = $LANG_INSTALL[25];
  139. }
  140. $display .= '<h2>' . $LANG_INSTALL[31] . '</h2>
  141. <form action="index.php" method="post" name="install">
  142. <input type="hidden" name="mode" value="' . htmlspecialchars($install_type) . '"' . XHTML . '>
  143. <input type="hidden" name="step" value="2"' . XHTML . '>
  144. <input type="hidden" name="display_step" value="' . htmlspecialchars($_REQUEST['display_step']) . '"' . XHTML . '>
  145. <input type="hidden" name="language" value="' . $language . '"' . XHTML . '>
  146. <input type="hidden" name="dbconfig_path" value="' . htmlspecialchars($dbconfig_path) . '"' . XHTML . '>
  147. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[32] . ' ' . INST_helpLink('site_name') . '</label> <input type="text" name="site_name" value="' . htmlspecialchars($site_name) . '" size="40"' . XHTML . '></p>
  148. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[33] . ' ' . INST_helpLink('site_slogan') . '</label> <input type="text" name="site_slogan" value="' . htmlspecialchars($site_slogan) . '" size="40"' . XHTML . '></p>
  149. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[34] . ' ' . INST_helpLink('db_type') . '</label> '
  150. . INST_listOfSupportedDBs($dbconfig_path, $db_selected,
  151. ($install_type == 'install' ? true : false)) .
  152. '</p>
  153. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[39] . ' ' . INST_helpLink('db_host') . '</label> <input type="text" name="db_host" value="'. htmlspecialchars($db_host) .'" size="20"' . XHTML . '></p>
  154. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[40] . ' ' . INST_helpLink('db_name') . '</label> <input type="text" name="db_name" value="'. htmlspecialchars($db_name) . '" size="20"' . XHTML . '></p>
  155. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[41] . ' ' . INST_helpLink('db_user') . '</label> <input type="text" name="db_user" value="' . htmlspecialchars($db_user) . '" size="20"' . XHTML . '></p>
  156. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[42] . ' ' . INST_helpLink('db_pass') . '</label> <input type="password" name="db_pass" value="' . $db_pass . '" size="20"' . XHTML . '></p>
  157. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[43] . ' ' . INST_helpLink('db_prefix') . '</label> <input type="text" name="db_prefix" value="' . htmlspecialchars($db_prefix) . '" size="20"' . XHTML . '></p>
  158. <br' . XHTML . '>
  159. <h2>' . $LANG_INSTALL[44] . '</h2>
  160. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[45] . ' ' . INST_helpLink('site_url') . '</label> <input type="text" name="site_url" value="' . htmlspecialchars($site_url) . '" size="50"' . XHTML . '> &nbsp; ' . $LANG_INSTALL[46] . '</p>
  161. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[47] . ' ' . INST_helpLink('site_admin_url') . '</label> <input type="text" name="site_admin_url" value="' . htmlspecialchars($site_admin_url) . '" size="50"' . XHTML . '> &nbsp; ' . $LANG_INSTALL[46] . '</p>
  162. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[48] . ' ' . INST_helpLink('site_mail') . '</label> <input type="text" name="site_mail" value="' . htmlspecialchars($site_mail) . '" size="50"' . XHTML . '></p>
  163. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[49] . ' ' . INST_helpLink('noreply_mail') . '</label> <input type="text" name="noreply_mail" value="' . htmlspecialchars($noreply_mail) . '" size="50"' . XHTML . '></p>';
  164. if ($install_type == 'install') {
  165. $display .= '
  166. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[92] . ' ' . INST_helpLink('utf8') . '</label> <input type="checkbox" name="utf8"' . ($utf8 ? ' checked="checked"' : '') . XHTML . '></p>';
  167. }
  168. $display .='<br' . XHTML . '>
  169. <input type="submit" name="submit" class="submit button big-button" value="' . $buttontext . ' &gt;&gt;"' . XHTML . '>
  170. <input type="submit" name="install_plugins" class="submit button big-button" value="' . $buttontext . ' ' . $LANG_INSTALL[103] . ' &gt;&gt;"' . XHTML . '>
  171. </form>' . LB;
  172. break;
  173. /**
  174. * Page 2 - Enter information into db-config.php
  175. * and ask about InnoDB tables (if supported)
  176. */
  177. case 2:
  178. // Set all the variables from the received POST data.
  179. $site_name = $_POST['site_name'];
  180. $site_slogan = $_POST['site_slogan'];
  181. $site_url = $_POST['site_url'];
  182. $site_admin_url = $_POST['site_admin_url'];
  183. $site_mail = $_POST['site_mail'];
  184. $noreply_mail = $_POST['noreply_mail'];
  185. $utf8 = (isset($_POST['utf8']) && ($_POST['utf8'] == 'on')) ? true : false;
  186. $install_plugins = (isset($_POST['install_plugins'])) ? true : false;
  187. $DB = array('type' => $_POST['db_type'],
  188. 'host' => $_POST['db_host'],
  189. 'name' => $_POST['db_name'],
  190. 'user' => $_POST['db_user'],
  191. 'pass' => $_POST['db_pass'],
  192. 'table_prefix' => $_POST['db_prefix']);
  193. // Check if $site_admin_url is correct
  194. if (!INST_urlExists($site_admin_url)) {
  195. $display .= '<h2>' . $LANG_INSTALL[104] . '</h2><p>'
  196. . $LANG_INSTALL[105] . '</p>'
  197. . INST_showReturnFormData($_POST) . LB;
  198. // Check for blank password in production environment
  199. } else if (!INST_dbPasswordCheck($site_url, $DB)) {
  200. $display .= '<h2>' . $LANG_INSTALL[54] . '</h2><p>'
  201. . $LANG_INSTALL[107] . '</p>'
  202. . INST_showReturnFormData($_POST) . LB;
  203. // Check if we can connect to the database
  204. } else if (!INST_dbConnect($DB)) {
  205. $display .= '<h2>' . $LANG_INSTALL[54] . '</h2><p>'
  206. . $LANG_INSTALL[55] . '</p>'
  207. . INST_showReturnFormData($_POST) . LB;
  208. // Check if the user's version of MySQL is out of date
  209. } else if (INST_mysqlOutOfDate($DB)) {
  210. $myv = mysql_v($DB['host'], $DB['user'], $DB['pass']);
  211. $display .= '<h1>' . sprintf($LANG_INSTALL[51], SUPPORTED_MYSQL_VER)
  212. . '</h1>' . LB;
  213. $display .= '<p>' . sprintf($LANG_INSTALL[52], SUPPORTED_MYSQL_VER)
  214. . $myv[0] . '.' . $myv[1] . '.' . $myv[2]
  215. . $LANG_INSTALL[53] . '</p>' . LB;
  216. // Check if database doesn't exist
  217. } else if (!INST_dbExists($DB)) {
  218. $display .= '<h2>' . $LANG_INSTALL[56] . '</h2><p>'
  219. . $LANG_INSTALL[57] . '</p>'
  220. . INST_showReturnFormData($_POST) . LB;
  221. } else {
  222. // Write the database info to db-config.php
  223. if (!INST_writeConfig($dbconfig_path, $DB)) {
  224. exit($LANG_INSTALL[26] . ' ' . htmlspecialchars($dbconfig_path)
  225. . $LANG_INSTALL[58]);
  226. }
  227. // for the default charset, patch siteconfig.php again
  228. if ($install_type != 'upgrade') {
  229. if (!INST_setDefaultCharset($siteconfig_path,
  230. ($utf8 ? 'utf-8' : $LANG_CHARSET))) {
  231. exit($LANG_INSTALL[26] . ' ' . $siteconfig_path
  232. . $LANG_INSTALL[58]);
  233. }
  234. }
  235. require $dbconfig_path;
  236. require_once $siteconfig_path;
  237. require_once $_CONF['path_system'] . 'lib-database.php';
  238. $req_string = 'index.php?mode=' . $install_type
  239. . '&step=3&dbconfig_path=' . $dbconfig_path
  240. . '&install_plugins=' . $install_plugins
  241. . '&language=' . $language
  242. . '&site_name=' . urlencode($site_name)
  243. . '&site_slogan=' . urlencode($site_slogan)
  244. . '&site_url=' . urlencode($site_url)
  245. . '&site_admin_url=' . urlencode($site_admin_url)
  246. . '&site_mail=' . urlencode($site_mail)
  247. . '&noreply_mail=' . urlencode($noreply_mail);
  248. if ($utf8) {
  249. $req_string .= '&utf8=true';
  250. }
  251. switch ($install_type) {
  252. case 'install':
  253. $hidden_fields = '<input type="hidden" name="mode" value="' . $install_type . '"' . XHTML . '>
  254. <input type="hidden" name="language" value="' . $language . '"' . XHTML . '>
  255. <input type="hidden" name="dbconfig_path" value="' . htmlspecialchars($dbconfig_path) . '"' . XHTML . '>
  256. <input type="hidden" name="site_name" value="' . urlencode($site_name) . '"' . XHTML . '>
  257. <input type="hidden" name="site_slogan" value="' . urlencode($site_slogan) . '"' . XHTML . '>
  258. <input type="hidden" name="site_url" value="' . urlencode($site_url) . '"' . XHTML . '>
  259. <input type="hidden" name="site_admin_url" value="' . urlencode($site_admin_url) . '"' . XHTML . '>
  260. <input type="hidden" name="site_mail" value="' . urlencode($site_mail) . '"' . XHTML . '>
  261. <input type="hidden" name="noreply_mail" value="' . urlencode($noreply_mail) . '"' . XHTML . '>
  262. <input type="hidden" name="utf8" value="' . ($utf8 ? 'true' : 'false') . '"' . XHTML . '>';
  263. // If using MySQL check to see if InnoDB is supported
  264. if ($DB['type'] == 'mysql-innodb' && !INST_innodbSupported()) {
  265. // Warn that InnoDB tables are not supported
  266. $display .= '<h2>' . $LANG_INSTALL[59] . '</h2>
  267. <p>' . $LANG_INSTALL['60'] . '</p>
  268. <br' . XHTML . '>
  269. <div style="margin-left: auto; margin-right: auto; width: 125px">
  270. <div style="position: relative; right: 10px">
  271. <form action="index.php" method="post">
  272. <input type="hidden" name="language" value="' . $language . '"' . XHTML . '>
  273. <input type="hidden" name="step" value="1"' . XHTML . '>
  274. ' . $hidden_fields . '
  275. <input type="submit" class="button big-button" value="&lt;&lt; ' . $LANG_INSTALL[61] . '"' . XHTML . '>
  276. </form>
  277. </div>
  278. <div style="position: relative; left: 65px; top: -27px">
  279. <form action="index.php" method="post">
  280. <input type="hidden" name="language" value="' . $language . '"' . XHTML . '>
  281. <input type="hidden" name="step" value="3"' . XHTML . '>
  282. ' . $hidden_fields . '
  283. <input type="hidden" name="innodb" value="false"' . XHTML . '>
  284. <input type="submit" class="button big-button" name="submit" value="' . $LANG_INSTALL[62] . ' &gt;&gt;"' . XHTML . '>
  285. </form>
  286. </div>
  287. </div>' . LB;
  288. } else {
  289. // Continue on to step 3 where the installation will happen
  290. if ($DB['type'] == 'mysql-innodb') {
  291. $req_string .= '&innodb=true';
  292. }
  293. header('Location: ' . $req_string);
  294. }
  295. break;
  296. case 'upgrade':
  297. // Try and find out what the current version of GL is
  298. $curv = INST_identifyGeeklogVersion();
  299. if ($curv == VERSION) {
  300. // If current version is the newest version
  301. // then there's no need to update.
  302. $display .= '<h2>' . $LANG_INSTALL[74] . '</h2>' . LB
  303. . '<p>' . $LANG_INSTALL[75] . '</p>';
  304. } elseif ($curv == 'empty') {
  305. $display .= '<h2>' . $LANG_INSTALL[90] . '</h2>' . LB
  306. . '<p>' . $LANG_INSTALL[91] . '</p>';
  307. } else {
  308. $old_versions = array('1.2.5-1','1.3','1.3.1','1.3.2','1.3.2-1','1.3.3','1.3.4','1.3.5','1.3.6','1.3.7','1.3.8','1.3.9','1.3.10','1.3.11','1.4.0','1.4.1','1.5.0','1.5.1','1.5.2','1.6.0','1.6.1','1.7.0','1.7.1','1.7.2');
  309. if (empty($curv)) {
  310. // If we were unable to determine the current GL
  311. // version is then ask the user what it is
  312. $display .= '<h2>' . $LANG_INSTALL[76] . '</h2>
  313. <p>' . $LANG_INSTALL[77] . '</p>
  314. <form action="index.php" method="post">
  315. <input type="hidden" name="mode" value="upgrade"' . XHTML . '>
  316. <input type="hidden" name="step" value="3"' . XHTML . '>
  317. <input type="hidden" name="dbconfig_path" value="' . htmlspecialchars($dbconfig_path) . '"' . XHTML . '>
  318. <p><label class="' . $form_label_dir . '">' . $LANG_INSTALL[89] . '</label> <select name="version">';
  319. $tmp_counter = 0;
  320. $ver_selected = '';
  321. foreach ($old_versions as $version) {
  322. if ($tmp_counter == (count($old_versions) - 1)) {
  323. $ver_selected = ' selected="selected"';
  324. }
  325. $display .= LB . '<option' . $ver_selected . '>' . $version . '</option>';
  326. $tmp_counter++;
  327. }
  328. $display .= '</select></p>
  329. <br' . XHTML . '>
  330. <input type="submit" name="submit" class="submit button big-button" value="' . $LANG_INSTALL[25] . ' &gt;&gt;"' . XHTML . '>
  331. </form>' . LB;
  332. $curv = $old_versions[count($old_versions) - 1];
  333. } else {
  334. // Continue on to step 3 where the upgrade will happen
  335. header('Location: ' . $req_string . '&version=' . $curv);
  336. }
  337. }
  338. break;
  339. }
  340. }
  341. break;
  342. /**
  343. * Page 3 - Install
  344. */
  345. case 3:
  346. $gl_path = str_replace('db-config.php', '', $dbconfig_path);
  347. $install_plugins= ((isset($_REQUEST['install_plugins']) && !empty($_REQUEST['install_plugins']))
  348. ? true
  349. : false);
  350. $next_link = ($install_plugins
  351. ? 'install-plugins.php?language=' . $language
  352. : 'success.php?type=' . $install_type . '&language=' . $language);
  353. switch ($install_type) {
  354. case 'install':
  355. if (isset($_POST['submit']) &&
  356. ($_POST['submit'] == '<< ' . $LANG_INSTALL[61])) {
  357. header('Location: index.php?mode=install');
  358. }
  359. // Check whether to use InnoDB tables
  360. $use_innodb = false;
  361. if ((isset($_POST['innodb']) && $_POST['innodb'] == 'true') || (isset($_GET['innodb']) && $_GET['innodb'] == 'true')) {
  362. $use_innodb = true;
  363. }
  364. $utf8 = false;
  365. if ((isset($_POST['utf8']) && $_POST['utf8'] == 'true') || (isset($_GET['utf8']) && $_GET['utf8'] == 'true')) {
  366. $utf8 = true;
  367. }
  368. // We need all this just to do one DB query
  369. require_once $dbconfig_path;
  370. require_once $siteconfig_path;
  371. require_once $_CONF['path_system'] . 'lib-database.php';
  372. if($_DB_dbms=='pgsql')
  373. {
  374. //Create a func to check if plpgsql is already installed
  375. DB_query("CREATE OR REPLACE FUNCTION make_plpgsql()
  376. RETURNS VOID LANGUAGE SQL AS $$
  377. CREATE LANGUAGE plpgsql;
  378. $$;
  379. SELECT
  380. CASE
  381. WHEN EXISTS( SELECT 1 FROM pg_catalog.pg_language WHERE lanname='plpgsql')
  382. THEN NULL
  383. ELSE make_plpgsql() END;");
  384. //Create a function to check if table exists
  385. DB_query("CREATE OR REPLACE FUNCTION check_table(varchar, varchar)
  386. RETURNS boolean AS $$
  387. DECLARE
  388. v_cnt integer;
  389. v_tbl boolean;
  390. BEGIN
  391. SELECT count(1) INTO v_cnt FROM pg_tables where tablename = $1 and
  392. schemaname = $2;
  393. IF v_cnt > 0 THEN
  394. v_tbl = 'true';
  395. END IF;
  396. return v_tbl;
  397. END;
  398. $$ LANGUAGE 'plpgsql'");
  399. }
  400. // Check if GL is already installed
  401. if (INST_checkTableExists('vars')) {
  402. $display .= '<p>' . $LANG_INSTALL[63] . '</p>
  403. <ol>
  404. <li>' . $LANG_INSTALL[64] . '</li>
  405. <li>' . $LANG_INSTALL[65] . '</li>
  406. </ol>
  407. <div style="margin-left: auto; margin-right: auto; width: 175px">
  408. <div style="position: absolute">
  409. <form action="index.php" method="post">
  410. <input type="hidden" name="mode" value="install"' . XHTML . '>
  411. <input type="hidden" name="step" value="3"' . XHTML . '>
  412. <input type="hidden" value="' . $language . '"' . XHTML . '>
  413. <input type="hidden" name="dbconfig_path" value="' . htmlspecialchars($dbconfig_path) . '"' . XHTML . '>
  414. <input type="hidden" name="innodb" value="' . (($use_innodb) ? 'true' : 'false') . '"' . XHTML . '>
  415. <input type="hidden" name="install_plugins" value="' . $install_plugins . '"' . XHTML . '>
  416. <input type="submit" class="button big-button" value="' . $LANG_INSTALL[66] . '"' . XHTML . '>
  417. </form>
  418. </div>
  419. <div style="position: relative; left: 105px; top: 5px">
  420. <form action="index.php" method="post">
  421. <input type="hidden" name="mode" value="upgrade"' . XHTML . '>
  422. <input type="hidden" name="language" value="' . $language . '"' . XHTML . '>
  423. <input type="hidden" name="dbconfig_path" value="' . htmlspecialchars($dbconfig_path) . '"' . XHTML . '>
  424. <input type="submit" class="button big-button" value="' . $LANG_INSTALL[25] . '"' . XHTML . '>
  425. </form>
  426. </div>
  427. </div>
  428. ' . LB;
  429. } else {
  430. if (INST_createDatabaseStructures()) {
  431. $site_name = isset($_POST['site_name']) ? $_POST['site_name'] : (isset($_GET['site_name']) ? $_GET['site_name'] : '') ;
  432. $site_slogan = isset($_POST['site_slogan']) ? $_POST['site_slogan'] : (isset($_GET['site_slogan']) ? $_GET['site_slogan'] : '') ;
  433. $site_url = isset($_POST['site_url']) ? $_POST['site_url'] : (isset($_GET['site_url']) ? $_GET['site_url'] : '') ;
  434. $site_admin_url = isset($_POST['site_admin_url']) ? $_POST['site_admin_url'] : (isset($_GET['site_admin_url']) ? $_GET['site_admin_url'] : '') ;
  435. $site_mail = isset($_POST['site_mail']) ? $_POST['site_mail'] : (isset($_GET['site_mail']) ? $_GET['site_mail'] : '') ;
  436. $noreply_mail = isset($_POST['noreply_mail']) ? $_POST['noreply_mail'] : (isset($_GET['noreply_mail']) ? $_GET['noreply_mail'] : '') ;
  437. INST_personalizeAdminAccount($site_mail, $site_url);
  438. // Insert the form data into the conf_values table
  439. require_once $_CONF['path_system'] . 'classes/config.class.php';
  440. require_once 'config-install.php';
  441. install_config();
  442. $config = config::get_instance();
  443. $config->set('site_name', urldecode($site_name));
  444. $config->set('site_slogan', urldecode($site_slogan));
  445. $config->set('site_url', urldecode($site_url));
  446. $config->set('site_admin_url', urldecode($site_admin_url));
  447. $config->set('site_mail', urldecode($site_mail));
  448. $config->set('noreply_mail', urldecode($noreply_mail));
  449. $config->set('path_html', $html_path);
  450. $config->set('path_log', $gl_path . 'logs/');
  451. $config->set('path_language', $gl_path . 'language/');
  452. $config->set('backup_path', $gl_path . 'backups/');
  453. $config->set('path_data', $gl_path . 'data/');
  454. $config->set('path_images', $html_path . 'images/');
  455. $config->set('path_themes', $html_path . 'layout/');
  456. $config->set('rdf_file', $html_path . 'backend/geeklog.rss');
  457. $config->set('path_pear', $_CONF['path_system'] . 'pear/');
  458. $config->set_default('default_photo', urldecode($site_url) . '/default.jpg');
  459. $lng = INST_getDefaultLanguage($gl_path . 'language/', $language, $utf8);
  460. if (!empty($lng)) {
  461. $config->set('language', $lng);
  462. }
  463. INST_setVersion($siteconfig_path);
  464. if (! $install_plugins) {
  465. // do a default install of all available plugins
  466. /**
  467. * For the plugin install we would actually need
  468. * lib-common.php in the global namespace. Since
  469. * we're in a function, we need to hack a few
  470. * things and rely on a few global declarations
  471. * (see beginning of function).
  472. */
  473. // Hack: not needed here - avoid notice
  474. $_DB_mysqldump_path = '';
  475. // Hack: lib-common will overwrite $language
  476. $lx_inst = $language;
  477. require_once '../../lib-common.php';
  478. $language = $lx_inst;
  479. INST_defaultPluginInstall();
  480. }
  481. // Installation is complete. Continue onto either
  482. // custom plugin installation page or success page
  483. header('Location: ' . $next_link);
  484. } else {
  485. $display .= "<h2>" . $LANG_INSTALL[67] . "</h2><p>" . $LANG_INSTALL[68] . "</p>";
  486. }
  487. }
  488. break;
  489. case 'upgrade':
  490. // Get and set which version to display
  491. $version = '';
  492. if (isset($_GET['version'])) {
  493. $version = $_GET['version'];
  494. } else {
  495. if (isset($_POST['version'])) {
  496. $version = $_POST['version'];
  497. }
  498. }
  499. // Let's do this
  500. require_once $dbconfig_path;
  501. require_once $siteconfig_path;
  502. require_once $_CONF['path_system'] . 'lib-database.php';
  503. // If this is a MySQL database check to see if it was
  504. // installed with InnoDB support
  505. if ($_DB_dbms == 'mysql') {
  506. // Query `vars` and see if 'database_engine' == 'InnoDB'
  507. $result = DB_query("SELECT `name`,`value` FROM {$_TABLES['vars']} WHERE `name`='database_engine'");
  508. $row = DB_fetchArray($result);
  509. if ($row['value'] == 'InnoDB') {
  510. $use_innodb = true;
  511. } else {
  512. $use_innodb = false;
  513. }
  514. }
  515. if (INST_doDatabaseUpgrades($version)) {
  516. if (version_compare($version, '1.5.0') == -1) {
  517. // After updating the database we'll want to update some of the information from the form.
  518. $site_name = isset($_POST['site_name']) ? $_POST['site_name'] : (isset($_GET['site_name']) ? $_GET['site_name'] : '') ;
  519. $site_slogan = isset($_POST['site_slogan']) ? $_POST['site_slogan'] : (isset($_GET['site_slogan']) ? $_GET['site_slogan'] : '') ;
  520. $site_url = isset($_POST['site_url']) ? $_POST['site_url'] : (isset($_GET['site_url']) ? $_GET['site_url'] : '') ;
  521. $site_admin_url = isset($_POST['site_admin_url']) ? $_POST['site_admin_url'] : (isset($_GET['site_admin_url']) ? $_GET['site_admin_url'] : '') ;
  522. $site_mail = isset($_POST['site_mail']) ? $_POST['site_mail'] : (isset($_GET['site_mail']) ? $_GET['site_mail'] : '') ;
  523. $noreply_mail = isset($_POST['noreply_mail']) ? $_POST['noreply_mail'] : (isset($_GET['noreply_mail']) ? $_GET['noreply_mail'] : '') ;
  524. require_once $_CONF['path_system'] . 'classes/config.class.php';
  525. $config = config::get_instance();
  526. $config->set('site_name', urldecode($site_name));
  527. $config->set('site_slogan', urldecode($site_slogan));
  528. $config->set('site_url', urldecode($site_url));
  529. $config->set('site_admin_url', urldecode($site_admin_url));
  530. $config->set('site_mail', urldecode($site_mail));
  531. $config->set('noreply_mail', urldecode($noreply_mail));
  532. $config->set_default('default_photo', urldecode($site_url) . '/default.jpg');
  533. } else {
  534. $site_url = isset($_POST['site_url']) ? $_POST['site_url'] : (isset($_GET['site_url']) ? $_GET['site_url'] : '') ;
  535. $site_admin_url = isset($_POST['site_admin_url']) ? $_POST['site_admin_url'] : (isset($_GET['site_admin_url']) ? $_GET['site_admin_url'] : '') ;
  536. }
  537. INST_fixPathsAndUrls($_CONF['path'], $html_path,
  538. urldecode($site_url), urldecode($site_admin_url));
  539. // disable plugins for which we don't have the source files
  540. INST_checkPlugins();
  541. // extra step 4: upgrade plugins
  542. $next_link = 'index.php?step=4&mode=' . $install_type
  543. . '&language=' . $language;
  544. if ($install_plugins) {
  545. $next_link .= '&install_plugins=true';
  546. }
  547. header('Location: ' . $next_link);
  548. } else {
  549. $display .= '<h2>' . $LANG_INSTALL[78] . '</h2>
  550. <p>' . $LANG_INSTALL[79] . '</p>' . LB;
  551. }
  552. break;
  553. }
  554. break;
  555. /**
  556. * Extra Step 4 - Upgrade plugins
  557. */
  558. case 4:
  559. INST_pluginUpgrades();
  560. $install_plugins = ((isset($_GET['install_plugins']) &&
  561. !empty($_GET['install_plugins']))
  562. ? true
  563. : false);
  564. if (! $install_plugins) {
  565. // if we don't do the manual selection, install all new plugins now
  566. INST_autoinstallNewPlugins();
  567. }
  568. $next_link = ($install_plugins
  569. ? 'install-plugins.php?language=' . $language
  570. : 'success.php?type=' . $install_type
  571. . '&language=' . $language);
  572. header('Location: ' . $next_link);
  573. break;
  574. }
  575. }
  576. /**
  577. * Check to see if required files are writable by the web server.
  578. *
  579. * @param array $files list of files to check
  580. * @return boolean true if all files are writable
  581. *
  582. */
  583. function INST_checkIfWritable($files)
  584. {
  585. $writable = true;
  586. foreach ($files as $file) {
  587. if (!$tmp_file = @fopen($file, 'a')) {
  588. // Unable to modify
  589. $writable = false;
  590. } else {
  591. fclose($tmp_file);
  592. }
  593. }
  594. return $writable;
  595. }
  596. /**
  597. * Returns an HTML formatted string containing a list of which files
  598. * have incorrect permissions.
  599. *
  600. * @param array $files List of files to check
  601. * @return string HTML and permission warning message.
  602. *
  603. */
  604. function INST_permissionWarning($files)
  605. {
  606. global $LANG_INSTALL, $form_label_dir;
  607. $display .= '
  608. <div class="install-path-container-outer">
  609. <div class="install-path-container-inner">
  610. <h2>' . $LANG_INSTALL[81] . '</h2>
  611. <p>' . $LANG_INSTALL[82] . '</p>
  612. <br' . XHTML . '>
  613. <p><label class="' . $form_label_dir . '"><b>' . $LANG_INSTALL[10] . '</b></label> <b>' . $LANG_INSTALL[11] . '</b></p>
  614. ' . LB;
  615. foreach ($files as $file) {
  616. if (!$file_handler = @fopen ($file, 'a')) {
  617. $display .= '<p><label class="' . $form_label_dir . '"><code>' . $file . '</code></label>' ;
  618. $file_perms = sprintf ("%3o", @fileperms ($file) & 0777);
  619. $display .= '<span class="permissions-list">' . $LANG_INSTALL[12] . ' 777</span> (' . $LANG_INSTALL[13] . ' ' . $file_perms . ')</p>' . LB ;
  620. } else {
  621. fclose ($file_handler);
  622. }
  623. }
  624. $display .= '
  625. </div>
  626. </div>
  627. <br' . XHTML . '><br' . XHTML . '>' . LB;
  628. return $display;
  629. }
  630. /**
  631. * Returns the HTML form to return the user's inputted data to the
  632. * previous page.
  633. *
  634. * @return string HTML form code.
  635. *
  636. */
  637. function INST_showReturnFormData($post_data)
  638. {
  639. global $mode, $dbconfig_path, $language, $LANG_INSTALL;
  640. $display = '
  641. <form action="index.php" method="post">
  642. <input type="hidden" name="mode" value="' . htmlspecialchars($mode) . '"' . XHTML . '>
  643. <input type="hidden" name="step" value="1"' . XHTML . '>
  644. <input type="hidden" name="display_step" value="' . htmlspecialchars($_REQUEST['display_step']) . '"' . XHTML . '>
  645. <input type="hidden" name="dbconfig_path" value="' . htmlspecialchars($dbconfig_path) . '"' . XHTML . '>
  646. <input type="hidden" name="language" value="' . $language . '"' . XHTML . '>
  647. <input type="hidden" name="site_name" value="' . htmlspecialchars($post_data['site_name']) . '"' . XHTML . '>
  648. <input type="hidden" name="site_slogan" value="' . htmlspecialchars($post_data['site_slogan']) . '"' . XHTML . '>
  649. <input type="hidden" name="db_type" value="' . htmlspecialchars($post_data['db_type']) . '"' . XHTML . '>
  650. <input type="hidden" name="db_host" value="' . htmlspecialchars($post_data['db_host']) . '"' . XHTML . '>
  651. <input type="hidden" name="db_name" value="' . htmlspecialchars($post_data['db_name']) . '"' . XHTML . '>
  652. <input type="hidden" name="db_user" value="' . htmlspecialchars($post_data['db_user']) . '"' . XHTML . '>
  653. <input type="hidden" name="db_prefix" value="' . htmlspecialchars($post_data['db_prefix']) . '"' . XHTML . '>
  654. <input type="hidden" name="site_url" value="' . htmlspecialchars($post_data['site_url']) . '"' . XHTML . '>
  655. <input type="hidden" name="site_admin_url" value="' . htmlspecialchars($post_data['site_admin_url']) . '"' . XHTML . '>
  656. <input type="hidden" name="site_mail" value="' . htmlspecialchars($post_data['site_mail']) . '"' . XHTML . '>
  657. <input type="hidden" name="noreply_mail" value="' . htmlspecialchars($post_data['noreply_mail']) . '"' . XHTML . '>
  658. <p align="center"><input type="submit" class="button big-button" value="&lt;&lt; ' . $LANG_INSTALL[61] . '"' . XHTML . '></p>
  659. </form>';
  660. return $display;
  661. }
  662. /**
  663. * Sets up the database tables
  664. *
  665. * @return boolean True if successful
  666. *
  667. */
  668. function INST_createDatabaseStructures()
  669. {
  670. global $_CONF, $_TABLES, $_DB, $_DB_dbms, $_DB_host, $_DB_user, $_DB_pass,
  671. $site_url, $use_innodb;
  672. $_DB->setDisplayError(true);
  673. // Because the create table syntax can vary from dbms-to-dbms we are
  674. // leaving that up to each database driver (e.g. mysql.class.php,
  675. // postgresql.class.php, etc)
  676. // Get DBMS-specific create table array and data array
  677. require_once $_CONF['path'] . 'sql/' . $_DB_dbms . '_tableanddata.php';
  678. $progress = '';
  679. if (INST_checkTableExists('access')) {
  680. return false;
  681. }
  682. switch($_DB_dbms){
  683. case 'mysql':
  684. INST_updateDB($_SQL);
  685. if ($use_innodb) {
  686. DB_query("INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('database_engine', 'InnoDB')");
  687. }
  688. break;
  689. case 'mssql':
  690. foreach ($_SQL as $sql) {
  691. $_DB->dbQuery($sql, 0, 1);
  692. }
  693. break;
  694. case 'pgsql':
  695. foreach ($_SQL as $sql) {
  696. $_DB->dbQuery($sql, 0, 1);
  697. }
  698. break;
  699. default:
  700. die("Unknown DB type '$_DB_dbms'");
  701. break;
  702. }
  703. // Now insert mandatory data and a small subset of initial data
  704. foreach ($_DATA as $data) {
  705. $progress .= "executing " . $data . "<br" . XHTML . ">\n";
  706. DB_query($data);
  707. }
  708. return true;
  709. }
  710. /**
  711. * On a fresh install, set the Admin's account email and homepage
  712. *
  713. * @param string $site_mail email address, e.g. the site email
  714. * @param string $site_url the site's URL
  715. * @return void
  716. *
  717. */
  718. function INST_personalizeAdminAccount($site_mail, $site_url)
  719. {
  720. global $_TABLES, $_DB_dbms;
  721. if (($_DB_dbms == 'mysql') || ($_DB_dbms == 'mssql') || ($_DB_dbms== 'pgsql')) {
  722. // let's try and personalize the Admin account a bit ...
  723. if (!empty($site_mail)) {
  724. if (strpos($site_mail, 'example.com') === false) {
  725. DB_query("UPDATE {$_TABLES['users']} SET email = '" . addslashes($site_mail) . "' WHERE uid = 2");
  726. }
  727. }
  728. if (!empty($site_url)) {
  729. if (strpos($site_url, 'example.com') === false) {
  730. DB_query("UPDATE {$_TABLES['users']} SET homepage = '" . addslashes($site_url) . "' WHERE uid = 2");
  731. }
  732. }
  733. }
  734. }
  735. /**
  736. * Derive site's default language from available information
  737. *
  738. * @param string $langpath path where the language files are kept
  739. * @param string $language language used in the install script
  740. * @param boolean $utf8 whether to use UTF-8
  741. * @return string name of default language (for the config)
  742. *
  743. */
  744. function INST_getDefaultLanguage($langpath, $language, $utf8 = false)
  745. {
  746. $pos = strpos($language, '_utf-8');
  747. if ($pos !== false) {
  748. $language = substr($language, 0, $pos);
  749. }
  750. if ($utf8) {
  751. $lngname = $language . '_utf-8';
  752. } else {
  753. $lngname = $language;
  754. }
  755. $lngfile = $lngname . '.php';
  756. if (!file_exists($langpath . $lngfile)) {
  757. // doesn't exist - fall back to English
  758. if ($utf8) {
  759. $lngname = 'english_utf-8';
  760. } else {
  761. $lngname = 'english';
  762. }
  763. }
  764. return $lngname;
  765. }
  766. /**
  767. * Handle default install of available plugins
  768. *
  769. * Picks up and installs all plugins with an autoinstall.php.
  770. * Any errors are silently ignored ...
  771. *
  772. */
  773. function INST_defaultPluginInstall()
  774. {
  775. global $_CONF, $_TABLES, $_DB_dbms, $_DB_table_prefix;
  776. if (! function_exists('COM_errorLog')) {
  777. // "Emergency" version of COM_errorLog
  778. function COM_errorLog($a, $b = '')
  779. {
  780. return '';
  781. }
  782. }
  783. INST_autoinstallNewPlugins();
  784. }
  785. // +---------------------------------------------------------------------------+
  786. // | Main |
  787. // +---------------------------------------------------------------------------+
  788. // prepare some hints about what /path/to/geeklog might be ...
  789. $gl_path = strtr(__FILE__, '\\', '/'); // replace all '\' with '/'
  790. for ($i = 0; $i < 4; $i++) {
  791. $remains = strrchr($gl_path, '/');
  792. if ($remains === false) {
  793. break;
  794. } else {
  795. $gl_path = substr($gl_path, 0, -strlen($remains));
  796. }
  797. }
  798. $html_path = INST_getHtmlPath();
  799. $siteconfig_path = '../../siteconfig.php';
  800. $dbconfig_path = (isset($_POST['dbconfig_path'])) ? $_POST['dbconfig_path'] : ((isset($_GET['dbconfig_path'])) ? $_GET['dbconfig_path'] : '');
  801. $dbconfig_path = INST_sanitizePath($dbconfig_path);
  802. $step = isset($_GET['step']) ? $_GET['step'] : (isset($_POST['step']) ? $_POST['step'] : 1);
  803. $mode = isset($_GET['mode']) ? $_GET['mode'] : (isset($_POST['mode']) ? $_POST['mode'] : '');
  804. $use_innodb = false;
  805. // $display holds all the outputted HTML and content
  806. if (defined('XHTML')) {
  807. $display = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  808. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
  809. } else {
  810. $display = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  811. <html>';
  812. }
  813. $display .= '<head>
  814. <meta http-equiv="Content-Type" content="text/html;charset=' . $LANG_CHARSET . '"' . XHTML . '>
  815. <link rel="stylesheet" type="text/css" href="layout/style.css"' . XHTML . '>
  816. <meta name="robots" content="noindex,nofollow"' . XHTML . '>
  817. <title>' . $LANG_INSTALL[0] . '</title>
  818. </head>
  819. <body dir="' . $LANG_DIRECTION . '">
  820. <div class="header-navigation-container">
  821. <div class="header-navigation-line">
  822. <a href="' . $LANG_INSTALL[87] . '" class="header-navigation">' . $LANG_INSTALL[1] . '</a>&nbsp;&nbsp;&nbsp;
  823. </div>
  824. </div>
  825. <div class="header-logobg-container-inner">
  826. <a class="header-logo" href="http://www.geeklog.net/">
  827. <img src="layout/logo.png" width="151" height="56" alt="Geeklog"' . XHTML . '>
  828. </a>
  829. <div class="header-slogan">' . $LANG_INSTALL[2] . ' <br' . XHTML . '><br' . XHTML . '>' . LB;
  830. // Show the language drop down selection on the first page
  831. if (empty($mode) || ($mode == 'check_permissions')) {
  832. $display .='<form action="index.php" method="post" style="display:inline;">' . LB;
  833. $_PATH = array('dbconfig', 'public_html');
  834. if (isset($_GET['mode']) || isset($_POST['mode'])) {
  835. $value = (isset($_POST['mode'])) ? $_POST['mode'] : $_GET['mode'];
  836. $display .= '<input type="hidden" name="mode" value="' . htmlspecialchars($value) . '"' . XHTML . '>' . LB;
  837. }
  838. foreach ($_PATH as $name) {
  839. if (isset($_GET[$name . '_path']) || isset($_POST[$name . '_path'])) {
  840. $value = (isset($_POST[$name . '_path'])) ? $_POST[$name . '_path'] : $_GET[$name . '_path'];
  841. $value = INST_sanitizePath($value);
  842. $display .= '<input type="hidden" name="' . $name .'_path" value="' . htmlspecialchars($value) . '"' . XHTML . '>' . LB;
  843. }
  844. }
  845. $display .= $LANG_INSTALL[86] . ': <select name="language">' . LB;
  846. foreach (glob('language/*.php') as $filename) {
  847. $filename = preg_replace('/.php/', '', preg_replace('/language\//', '', $filename));
  848. $display .= '<option value="' . $filename . '"' . (($filename == $language) ? ' selected="selected"' : '') . '>' . INST_prettifyLanguageName($filename) . '</option>' . LB;
  849. }
  850. $display .= '</select>
  851. <input type="submit" class="language-button button" value="' . $LANG_INSTALL[80] . '"' . XHTML . '>
  852. </form>';
  853. }
  854. $display .= '
  855. </div>
  856. </div>
  857. <div class="installation-container">
  858. <div class="installation-body-container">' . LB;
  859. // Make sure the version of PHP is supported.
  860. if (INST_phpOutOfDate()) {
  861. // If their version of PHP is not supported, print an error:
  862. $display .= '<h1 class="heading">' . sprintf($LANG_INSTALL[4], SUPPORTED_PHP_VER) . '</h1>' . LB;
  863. $display .= '<p>' . sprintf($LANG_INSTALL[5], SUPPORTED_PHP_VER) . phpversion() . $LANG_INSTALL[6] . '</p>' . LB;
  864. } else {
  865. // Ok, the user's version is supported. Let's move on
  866. switch ($mode) {
  867. /**
  868. * The script first checks the location of the db-config.php file. By default
  869. * the file is located in Geeklog-1.x/ but the script will also check the
  870. * public_html/ directory. If the script can't find the file in either of these
  871. * two places, then it will ask the user to user its location.
  872. */
  873. default:
  874. // Check the location of db-config.php
  875. // We'll base our /path/to/geeklog on its location
  876. $gl_path .= '/';
  877. $form_fields = '';
  878. $num_errors = 0;
  879. $dbconfig_path = '';
  880. $dbconfig_file = 'db-config.php';
  881. $display .= '<h1 class="heading">' . $LANG_INSTALL[3] . '</h1>' . LB;
  882. if (!file_exists($gl_path . $dbconfig_file) && !file_exists($gl_path . 'public_html/' . $dbconfig_file)) {
  883. // If the file/directory is not located in the default location
  884. // or in public_html have the user enter its location.
  885. $form_fields .= '<p><label class="' . $form_label_dir . '"><code>db-config.php</code></label> '

Large files files are truncated, but you can click here to view the full file