1: 2: /* -------------------------------------------------------------
3: This file is part of FreeDESK
4:
5: FreeDESK is (C) Copyright 2012 David Cutting
6:
7: FreeDESK is free software: you can redistribute it and/or modify
8: it under the terms of the GNU General Public License as published by
9: the Free Software Foundation, either version 3 of the License, or
10: (at your option) any later version.
11:
12: FreeDESK is distributed in the hope that it will be useful,
13: but WITHOUT ANY WARRANTY; without even the implied warranty of
14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: GNU General Public License for more details.
16:
17: You should have received a copy of the GNU General Public License
18: along with FreeDESK. If not, see www.gnu.org/licenses
19:
20: For more information see www.purplepixie.org/freedesk/
21: -------------------------------------------------------------- */
22:
23: /**
24: * The main setup file
25: **/
26: ?>
27:
28:
29: FreeDESK Setup 30:
31:
54:
55:
56: 57: $setup=$_SERVER['SCRIPT_NAME'];
58: function step_list($steps, $current)
59: {
60: echo "
133: The following settings are for a connection to a MySQL database where the FreeDESK data will be stored.
134: 135: echo "136: ?>
137:
138:
139:
140:
Server
141:
142:
143:
Username
144:
145:
Password
146:
147:
148:
Table Prefix
149:
150:
151:
Database
152:
153:
154:
Create Database
155:
156:
157:
Password Salt
158:
e.g. three or four random characters
159:
160:
161:
162:
163: 164:
165: $fp=@fopen("config/Config.php","a");
166: if (!$fp)
167: {
168: echo "Warning: the config/Config.php file is not writeable so you will have to manually update the file.
";
169: echo "Or if you make the file world-writeable (e.g. chmod 777 config in Linux) then the script will create it automatically.";
170: }
171: else
172: fclose($fp);
173:
174: }
175:
176: else if ($step == 3) // Validate and Write
177: {
178: echo "
Validating Connection Settings
";
179: $sql=mysql_connect($_REQUEST['db_server'],$_REQUEST['db_username'],$_REQUEST['db_password']);
180: if (!$sql)
181: {
182: echo "Error: Could not connect to the database. Please go back in your browser and input correct credentials