C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\mamFM\_installation\install3.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<?php
/**
* @version $Id: install3.php 2510 2006-02-21 04:59:41Z stingrey $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

/** Include common.php */
require_once( 'common.php' );

$DBhostname mosGetParam$_POST'DBhostname''' );
$DBuserName mosGetParam$_POST'DBuserName''' );
$DBpassword mosGetParam$_POST'DBpassword''' );
$DBname      mosGetParam$_POST'DBname''' );
$DBPrefix      mosGetParam$_POST'DBPrefix''' );
$sitename      mosGetParam$_POST'sitename''' );
$adminEmail mosGetParam$_POST'adminEmail''');
$filePerms    mosGetParam$_POST'filePerms''');
$dirPerms    mosGetParam$_POST'dirPerms''');
$configArray['siteUrl'] = trimmosGetParam$_POST'siteUrl''' ) );
$configArray['absolutePath'] = trimmosGetParam$_POST'absolutePath''' ) );
if (
get_magic_quotes_gpc()) {
    
$configArray['absolutePath'] = stripslashes(stripslashes($configArray['absolutePath']));
    
$sitename stripslashes(stripslashes($sitename));
}

if (
$sitename == '') {
    echo 
"<form name=\"stepBack\" method=\"post\" action=\"install2.php\">
            <input type=\"hidden\" name=\"DBhostname\" value=\"
$DBhostname\">
            <input type=\"hidden\" name=\"DBuserName\" value=\"
$DBuserName\">
            <input type=\"hidden\" name=\"DBpassword\" value=\"
$DBpassword\">
            <input type=\"hidden\" name=\"DBname\" value=\"
$DBname\">
            <input type=\"hidden\" name=\"DBPrefix\" value=\"
$DBPrefix\">
            <input type=\"hidden\" name=\"DBcreated\" value=1>
        </form>"
;

    echo 
"<script>alert('The sitename has not been provided'); document.stepBack.submit();</script>";
    return;
}

echo 
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Joomla - Web Installer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="shortcut icon" href="../images/favicon.ico" />
<link rel="stylesheet" href="install.css" type="text/css" />
<script type="text/javascript">
<!--
function check() {
    // form validation check
    var formValid = true;
    var f = document.form;
    if ( f.siteUrl.value == '' ) {
        alert('Please enter Site URL');
        f.siteUrl.focus();
        formValid = false;
    } else if ( f.absolutePath.value == '' ) {
        alert('Please enter the absolute path to your site');
        f.absolutePath.focus();
        formValid = false;
    } else if ( f.adminEmail.value == '' ) {
        alert('Please enter an email address to contact your administrator');
        f.adminEmail.focus();
        formValid = false;
    } else if ( f.adminPassword.value == '' ) {
        alert('Please enter a password for you administrator');
        f.adminPassword.focus();
        formValid = false;
    }

    return formValid;
}

function changeFilePermsMode(mode)
{
    if(document.getElementById) {
        switch (mode) {
            case 0:
                document.getElementById('filePermsFlags').style.display = 'none';
                break;
            default:
                document.getElementById('filePermsFlags').style.display = '';
        } // switch
    } // if
}

function changeDirPermsMode(mode)
{
    if(document.getElementById) {
        switch (mode) {
            case 0:
                document.getElementById('dirPermsFlags').style.display = 'none';
                break;
            default:
                document.getElementById('dirPermsFlags').style.display = '';
        } // switch
    } // if
}
//-->
</script>
</head>
<body onload="document.form.siteUrl.focus();">
<div id="wrapper">
    <div id="header">
        <div id="joomla"><img src="header_install.png" alt="Joomla Installation" /></div>
    </div>
</div>
<div id="ctr" align="center">
    <form action="install4.php" method="post" name="form" id="form" onsubmit="return check();">
    <input type="hidden" name="DBhostname" value="<?php echo "$DBhostname"?>" />
    <input type="hidden" name="DBuserName" value="<?php echo "$DBuserName"?>" />
    <input type="hidden" name="DBpassword" value="<?php echo "$DBpassword"?>" />
    <input type="hidden" name="DBname" value="<?php echo "$DBname"?>" />
    <input type="hidden" name="DBPrefix" value="<?php echo "$DBPrefix"?>" />
    <input type="hidden" name="sitename" value="<?php echo "$sitename"?>" />
    <div class="install">
        <div id="stepbar">
            <div class="step-off">pre-installation check</div>
            <div class="step-off">license</div>
            <div class="step-off">step 1</div>
            <div class="step-off">step 2</div>
            <div class="step-on">step 3</div>
            <div class="step-off">step 4</div>
        </div>
        <div id="right">
            <div id="step">step 3</div>
            <div class="far-right">
                <input class="button" type="submit" name="next" value="Next >>"/>
            </div>
            <div class="clr"></div>
            <h1>Confirm the site URL, path, admin e-mail and file/directory chmods</h1>
            <div class="install-text">
                  <p>If URL and Path look correct then please do not change them.
                  If you are not sure then please contact your ISP or administrator. Usually
                  the values displayed will work for your site.<br/>
                  <br/>
                  Enter your e-mail address, this will be the e-mail address of the site
                  SuperAdministrator.<br />
                  <br/>
                  The permission settings will be used while installing Joomla itself, by
                  the Joomla addon-installers and by the media manager. If you are unsure
                  what flags shall be set, leave the default settings at the moment.
                  You can still change these flags later in the site global configuration.</p>
            </div>
            <div class="install-form">
                <div class="form-block">
                    <table class="content2">
                    <tr>
                        <td width="100">URL</td>
<?php
    $url 
"";
    if (
$configArray['siteUrl'])
        
$url $configArray['siteUrl'];
    else {
        
$port = ( $_SERVER['SERVER_PORT'] == 80 ) ? '' ":".$_SERVER['SERVER_PORT'];
        
$root $_SERVER['SERVER_NAME'].$port.$_SERVER['PHP_SELF'];
        
$root str_replace("installation/","",$root);
        
$root str_replace("/install3.php","",$root);
        
$url "http://".$root;
    }
?>                        <td align="center"><input class="inputbox" type="text" name="siteUrl" value="<?php echo $url?>" size="50"/></td>
                    </tr>
                    <tr>
                        <td>Path</td>
<?php
    $abspath 
"";
    if (
$configArray['absolutePath'])
        
$abspath $configArray['absolutePath'];
    else {
        
$path getcwd();
        if (
preg_match("/\/installation/i""$path"))
            
$abspath str_replace('/installation',"",$path);
        else
            
$abspath str_replace('\installation',"",$path);
    }
?>                        <td align="center"><input class="inputbox" type="text" name="absolutePath" value="<?php echo $abspath?>" size="50"/></td>
                    </tr>
                    <tr>
                        <td>Your E-mail</td>
                        <td align="center"><input class="inputbox" type="text" name="adminEmail" value="<?php echo "$adminEmail"?>" size="50" /></td>
                    </tr>
                    <tr>
                        <td>Admin password</td>
                        <td align="center"><input class="inputbox" type="text" name="adminPassword" value="<?php echo mosMakePassword(8); ?>" size="50"/></td>
                    </tr>
                    <tr>
<?php
    $mode 
0;
    
$flags 0644;
    if (
$filePerms!='') {
        
$mode 1;
        
$flags octdec($filePerms);
    } 
// if
?>
                        <td colspan="2">
                              <fieldset><legend>File Permissions</legend>
                                <table cellpadding="1" cellspacing="1" border="0">
                                    <tr>
                                        <td><input type="radio" id="filePermsMode0" name="filePermsMode" value="0" onclick="changeFilePermsMode(0)"<?php if (!$mode) echo ' checked="checked"'?>/></td>
                                        <td><label for="filePermsMode0">Dont CHMOD files (use server defaults)</label></td>
                                    </tr>
                                    <tr>
                                        <td><input type="radio" id="filePermsMode1" name="filePermsMode" value="1" onclick="changeFilePermsMode(1)"<?php if ($mode) echo ' checked="checked"'?>/></td>
                                        <td><label for="filePermsMode1"> CHMOD files to:</label></td>
                                    </tr>
                                    <tr id="filePermsFlags"<?php if (!$mode) echo ' style="display:none"'?>>
                                        <td>&nbsp;</td>
                                        <td>
                                            <table cellpadding="1" cellspacing="0" border="0">
                                                <tr>
                                                    <td>User:</td>
                                                    <td><input type="checkbox" id="filePermsUserRead" name="filePermsUserRead" value="1"<?php if ($flags 0400) echo ' checked="checked"'?>/></td>
                                                    <td><label for="filePermsUserRead">read</label></td>
                                                    <td><input type="checkbox" id="filePermsUserWrite" name="filePermsUserWrite" value="1"<?php if ($flags 0200) echo ' checked="checked"'?>/></td>
                                                    <td><label for="filePermsUserWrite">write</label></td>
                                                    <td><input type="checkbox" id="filePermsUserExecute" name="filePermsUserExecute" value="1"<?php if ($flags 0100) echo ' checked="checked"'?>/></td>
                                                    <td width="100%"><label for="filePermsUserExecute">execute</label></td>
                                                </tr>
                                                <tr>
                                                    <td>Group:</td>
                                                    <td><input type="checkbox" id="filePermsGroupRead" name="filePermsGroupRead" value="1"<?php if ($flags 040) echo ' checked="checked"'?>/></td>
                                                    <td><label for="filePermsGroupRead">read</label></td>
                                                    <td><input type="checkbox" id="filePermsGroupWrite" name="filePermsGroupWrite" value="1"<?php if ($flags 020) echo ' checked="checked"'?>/></td>
                                                    <td><label for="filePermsGroupWrite">write</label></td>
                                                    <td><input type="checkbox" id="filePermsGroupExecute" name="filePermsGroupExecute" value="1"<?php if ($flags 010) echo ' checked="checked"'?>/></td>
                                                    <td width="100%"><label for="filePermsGroupExecute">execute</label></td>
                                                </tr>
                                                <tr>
                                                    <td>World:</td>
                                                    <td><input type="checkbox" id="filePermsWorldRead" name="filePermsWorldRead" value="1"<?php if ($flags 04) echo ' checked="checked"'?>/></td>
                                                    <td><label for="filePermsWorldRead">read</label></td>
                                                    <td><input type="checkbox" id="filePermsWorldWrite" name="filePermsWorldWrite" value="1"<?php if ($flags 02) echo ' checked="checked"'?>/></td>
                                                    <td><label for="filePermsWorldWrite">write</label></td>
                                                    <td><input type="checkbox" id="filePermsWorldExecute" name="filePermsWorldExecute" value="1"<?php if ($flags 01) echo ' checked="checked"'?>/></td>
                                                    <td width="100%"><label for="filePermsWorldExecute">execute</label></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </fieldset>
                        </td>
                    </tr>
                    <tr>
<?php
    $mode 
0;
    
$flags 0755;
    if (
$dirPerms!='') {
        
$mode 1;
        
$flags octdec($dirPerms);
    } 
// if
?>
                        <td colspan="2">
                              <fieldset><legend>Directory Permissions</legend>
                                <table cellpadding="1" cellspacing="1" border="0">
                                    <tr>
                                        <td><input type="radio" id="dirPermsMode0" name="dirPermsMode" value="0" onclick="changeDirPermsMode(0)"<?php if (!$mode) echo ' checked="checked"'?>/></td>
                                        <td><label for="dirPermsMode0">Dont CHMOD directories (use server defaults)</label></td>
                                    </tr>
                                    <tr>
                                        <td><input type="radio" id="dirPermsMode1" name="dirPermsMode" value="1" onclick="changeDirPermsMode(1)"<?php if ($mode) echo ' checked="checked"'?>/></td>
                                        <td><label for="dirPermsMode1"> CHMOD directories to:</label></td>
                                    </tr>
                                    <tr id="dirPermsFlags"<?php if (!$mode) echo ' style="display:none"'?>>
                                        <td>&nbsp;</td>
                                        <td>
                                            <table cellpadding="1" cellspacing="0" border="0">
                                                <tr>
                                                    <td>User:</td>
                                                    <td><input type="checkbox" id="dirPermsUserRead" name="dirPermsUserRead" value="1"<?php if ($flags 0400) echo ' checked="checked"'?>/></td>
                                                    <td><label for="dirPermsUserRead">read</label></td>
                                                    <td><input type="checkbox" id="dirPermsUserWrite" name="dirPermsUserWrite" value="1"<?php if ($flags 0200) echo ' checked="checked"'?>/></td>
                                                    <td><label for="dirPermsUserWrite">write</label></td>
                                                    <td><input type="checkbox" id="dirPermsUserSearch" name="dirPermsUserSearch" value="1"<?php if ($flags 0100) echo ' checked="checked"'?>/></td>
                                                    <td width="100%"><label for="dirPermsUserSearch">search</label></td>
                                                </tr>
                                                <tr>
                                                    <td>Group:</td>
                                                    <td><input type="checkbox" id="dirPermsGroupRead" name="dirPermsGroupRead" value="1"<?php if ($flags 040) echo ' checked="checked"'?>/></td>
                                                    <td><label for="dirPermsGroupRead">read</label></td>
                                                    <td><input type="checkbox" id="dirPermsGroupWrite" name="dirPermsGroupWrite" value="1"<?php if ($flags 020) echo ' checked="checked"'?>/></td>
                                                    <td><label for="dirPermsGroupWrite">write</label></td>
                                                    <td><input type="checkbox" id="dirPermsGroupSearch" name="dirPermsGroupSearch" value="1"<?php if ($flags 010) echo ' checked="checked"'?>/></td>
                                                    <td width="100%"><label for="dirPermsGroupSearch">search</label></td>
                                                </tr>
                                                <tr>
                                                    <td>World:</td>
                                                    <td><input type="checkbox" id="dirPermsWorldRead" name="dirPermsWorldRead" value="1"<?php if ($flags 04) echo ' checked="checked"'?>/></td>
                                                    <td><label for="dirPermsWorldRead">read</label></td>
                                                    <td><input type="checkbox" id="dirPermsWorldWrite" name="dirPermsWorldWrite" value="1"<?php if ($flags 02) echo ' checked="checked"'?>/></td>
                                                    <td><label for="dirPermsWorldWrite">write</label></td>
                                                    <td><input type="checkbox" id="dirPermsWorldSearch" name="dirPermsWorldSearch" value="1"<?php if ($flags 01) echo ' checked="checked"'?>/></td>
                                                    <td width="100%"><label for="dirPermsWorldSearch">search</label></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </fieldset>
                        </td>
                    </tr>
                    </table>
                </div>
            </div>
            <div id="break"></div>
        </div>
        <div class="clr"></div>
    </div>
    </form>
</div>
<div class="clr"></div>
<div class="ctr">
    <a href="http://www.joomla.org" target="_blank">Joomla!</a> is Free Software released under the GNU/GPL License.
</div>
</body>
</html>