Annotation of /mambo/branches/4.6/installation/install3.php
Parent Directory
|
Revision Log
Revision 3 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: install3.php,v 1.3 2005/11/27 07:01:36 cauld Exp $ | ||
| 4 : | * @package Mambo | ||
| 5 : | * @copyright (C) 2000 - 2005 Miro International Pty Ltd | ||
| 6 : | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
| 7 : | * Mambo is Free Software | ||
| 8 : | */ | ||
| 9 : | |||
| 10 : | /** Include common.php */ | ||
| 11 : | require_once( 'common.php' ); | ||
| 12 : | |||
| 13 : | $DBhostname = mosGetParam( $_POST, 'DBhostname', '' ); | ||
| 14 : | $DBuserName = mosGetParam( $_POST, 'DBuserName', '' ); | ||
| 15 : | $DBpassword = mosGetParam( $_POST, 'DBpassword', '' ); | ||
| 16 : | $DBname = mosGetParam( $_POST, 'DBname', '' ); | ||
| 17 : | $DBPrefix = mosGetParam( $_POST, 'DBPrefix', '' ); | ||
| 18 : | $sitename = mosGetParam( $_POST, 'sitename', '' ); | ||
| 19 : | $adminEmail = mosGetParam( $_POST, 'adminEmail', ''); | ||
| 20 : | $filePerms = mosGetParam( $_POST, 'filePerms', ''); | ||
| 21 : | $dirPerms = mosGetParam( $_POST, 'dirPerms', ''); | ||
| 22 : | $configArray['siteUrl'] = trim( mosGetParam( $_POST, 'siteUrl', '' ) ); | ||
| 23 : | $configArray['absolutePath'] = trim( mosGetParam( $_POST, 'absolutePath', '' ) ); | ||
| 24 : | if (get_magic_quotes_gpc()) { | ||
| 25 : | $configArray['absolutePath'] = stripslashes(stripslashes($configArray['absolutePath'])); | ||
| 26 : | $sitename = stripslashes(stripslashes($sitename)); | ||
| 27 : | } | ||
| 28 : | |||
| 29 : | if ($sitename == '') { | ||
| 30 : | echo "<form name=\"stepBack\" method=\"post\" action=\"install2.php\"> | ||
| 31 : | <input type=\"hidden\" name=\"DBhostname\" value=\"$DBhostname\"> | ||
| 32 : | <input type=\"hidden\" name=\"DBuserName\" value=\"$DBuserName\"> | ||
| 33 : | <input type=\"hidden\" name=\"DBpassword\" value=\"$DBpassword\"> | ||
| 34 : | <input type=\"hidden\" name=\"DBname\" value=\"$DBname\"> | ||
| 35 : | <input type=\"hidden\" name=\"DBPrefix\" value=\"$DBPrefix\"> | ||
| 36 : | <input type=\"hidden\" name=\"DBcreated\" value=1> | ||
| 37 : | </form>"; | ||
| 38 : | |||
| 39 : | echo "<script>alert('The sitename has not been provided'); document.stepBack.submit();</script>"; | ||
| 40 : | return; | ||
| 41 : | } | ||
| 42 : | |||
| 43 : | echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; | ||
| 44 : | ?> | ||
| 45 : | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 46 : | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 47 : | <head> | ||
| 48 : | <title>Mambo - Web Installer</title> | ||
| 49 : | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
| 50 : | <link rel="shortcut icon" href="../../images/favicon.ico" /> | ||
| 51 : | <link rel="stylesheet" href="install.css" type="text/css" /> | ||
| 52 : | <script type="text/javascript"> | ||
| 53 : | <!-- | ||
| 54 : | function check() { | ||
| 55 : | // form validation check | ||
| 56 : | var formValid = true; | ||
| 57 : | var f = document.form; | ||
| 58 : | if ( f.siteUrl.value == '' ) { | ||
| 59 : | alert('Please enter Site URL'); | ||
| 60 : | f.siteUrl.focus(); | ||
| 61 : | formValid = false; | ||
| 62 : | } else if ( f.absolutePath.value == '' ) { | ||
| 63 : | alert('Please enter the absolute path to your site'); | ||
| 64 : | f.absolutePath.focus(); | ||
| 65 : | formValid = false; | ||
| 66 : | } else if ( f.adminEmail.value == '' ) { | ||
| 67 : | alert('Please enter an email address to contact your administrator'); | ||
| 68 : | f.adminEmail.focus(); | ||
| 69 : | formValid = false; | ||
| 70 : | } else if ( f.adminPassword.value == '' ) { | ||
| 71 : | alert('Please enter a password for you administrator'); | ||
| 72 : | f.adminPassword.focus(); | ||
| 73 : | formValid = false; | ||
| 74 : | } | ||
| 75 : | |||
| 76 : | return formValid; | ||
| 77 : | } | ||
| 78 : | |||
| 79 : | function changeFilePermsMode(mode) | ||
| 80 : | { | ||
| 81 : | if(document.getElementById) { | ||
| 82 : | switch (mode) { | ||
| 83 : | case 0: | ||
| 84 : | document.getElementById('filePermsFlags').style.display = 'none'; | ||
| 85 : | break; | ||
| 86 : | default: | ||
| 87 : | document.getElementById('filePermsFlags').style.display = ''; | ||
| 88 : | } // switch | ||
| 89 : | } // if | ||
| 90 : | } | ||
| 91 : | |||
| 92 : | function changeDirPermsMode(mode) | ||
| 93 : | { | ||
| 94 : | if(document.getElementById) { | ||
| 95 : | switch (mode) { | ||
| 96 : | case 0: | ||
| 97 : | document.getElementById('dirPermsFlags').style.display = 'none'; | ||
| 98 : | break; | ||
| 99 : | default: | ||
| 100 : | document.getElementById('dirPermsFlags').style.display = ''; | ||
| 101 : | } // switch | ||
| 102 : | } // if | ||
| 103 : | } | ||
| 104 : | //--> | ||
| 105 : | </script> | ||
| 106 : | </head> | ||
| 107 : | <body onload="document.form.siteUrl.focus();"> | ||
| 108 : | <div id="wrapper"> | ||
| 109 : | <div id="header"> | ||
| 110 : | <div id="mambo"><img src="header_install.png" alt="Mambo Installation" /></div> | ||
| 111 : | </div> | ||
| 112 : | </div> | ||
| 113 : | <div id="ctr" align="center"> | ||
| 114 : | <form action="install4.php" method="post" name="form" id="form" onsubmit="return check();"> | ||
| 115 : | <input type="hidden" name="DBhostname" value="<?php echo "$DBhostname"; ?>" /> | ||
| 116 : | <input type="hidden" name="DBuserName" value="<?php echo "$DBuserName"; ?>" /> | ||
| 117 : | <input type="hidden" name="DBpassword" value="<?php echo "$DBpassword"; ?>" /> | ||
| 118 : | <input type="hidden" name="DBname" value="<?php echo "$DBname"; ?>" /> | ||
| 119 : | <input type="hidden" name="DBPrefix" value="<?php echo "$DBPrefix"; ?>" /> | ||
| 120 : | <input type="hidden" name="sitename" value="<?php echo "$sitename"; ?>" /> | ||
| 121 : | <div class="install"> | ||
| 122 : | <div id="stepbar"> | ||
| 123 : | <div class="step-off">pre-installation check</div> | ||
| 124 : | <div class="step-off">license</div> | ||
| 125 : | <div class="step-off">step 1</div> | ||
| 126 : | <div class="step-off">step 2</div> | ||
| 127 : | <div class="step-on">step 3</div> | ||
| 128 : | <div class="step-off">step 4</div> | ||
| 129 : | </div> | ||
| 130 : | <div id="right"> | ||
| 131 : | <div id="step">step 3</div> | ||
| 132 : | <div class="far-right"> | ||
| 133 : | <input class="button" type="submit" name="next" value="Next >>"/> | ||
| 134 : | </div> | ||
| 135 : | <div class="clr"></div> | ||
| 136 : | <h1>Confirm the site URL, path, admin e-mail and file/directory chmods</h1> | ||
| 137 : | <div class="install-text"> | ||
| 138 : | <p>If URL and Path looks correct then please do not change. | ||
| 139 : | If you are not sure then please contact your ISP or administrator. Usually | ||
| 140 : | the values displayed will work for your site.<br/> | ||
| 141 : | <br/> | ||
| 142 : | Enter your e-mail address, this will be the e-mail address of the site | ||
| 143 : | SuperAdministrator.<br /> | ||
| 144 : | <br/> | ||
| 145 : | The permission settings will be used while installing mambo itself, by | ||
| 146 : | the mambo addon-installers and by the media manager. If you are unsure | ||
| 147 : | what flags shall be set, leave the default settings at the moment. | ||
| 148 : | You can still change these flags later in the site global configuration.</p> | ||
| 149 : | </div> | ||
| 150 : | <div class="install-form"> | ||
| 151 : | <div class="form-block"> | ||
| 152 : | <table class="content2"> | ||
| 153 : | <tr> | ||
| 154 : | <td width="100">URL</td> | ||
| 155 : | <?php | ||
| 156 : | $url = ""; | ||
| 157 : | if ($configArray['siteUrl']) | ||
| 158 : | $url = $configArray['siteUrl']; | ||
| 159 : | else { | ||
| 160 : | $root = $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; | ||
| 161 : | $root = str_replace("installation/","",$root); | ||
| 162 : | $root = str_replace("/install3.php","",$root); | ||
| 163 : | $url = "http://".$root; | ||
| 164 : | } | ||
| 165 : | ?> <td align="center"><input class="inputbox" type="text" name="siteUrl" value="<?php echo $url; ?>" size="50"/></td> | ||
| 166 : | </tr> | ||
| 167 : | <tr> | ||
| 168 : | <td>Path</td> | ||
| 169 : | <?php | ||
| 170 : | $abspath = ""; | ||
| 171 : | if ($configArray['absolutePath']) | ||
| 172 : | $abspath = $configArray['absolutePath']; | ||
| 173 : | else { | ||
| 174 : | $path = getcwd(); | ||
| 175 : | if (preg_match("/\/installation/i", "$path")) | ||
| 176 : | $abspath = str_replace('/installation',"",$path); | ||
| 177 : | else | ||
| 178 : | $abspath = str_replace('\installation',"",$path); | ||
| 179 : | } | ||
| 180 : | ?> <td align="center"><input class="inputbox" type="text" name="absolutePath" value="<?php echo $abspath; ?>" size="50"/></td> | ||
| 181 : | </tr> | ||
| 182 : | <tr> | ||
| 183 : | <td>Your E-mail</td> | ||
| 184 : | <td align="center"><input class="inputbox" type="text" name="adminEmail" value="<?php echo "$adminEmail"; ?>" size="50" /></td> | ||
| 185 : | </tr> | ||
| 186 : | <tr> | ||
| 187 : | <td>Admin password</td> | ||
| 188 : | <td align="center"><input class="inputbox" type="text" name="adminPassword" value="<?php echo mosMakePassword(8); ?>" size="50"/></td> | ||
| 189 : | </tr> | ||
| 190 : | <tr> | ||
| 191 : | <?php | ||
| 192 : | $mode = 0; | ||
| 193 : | $flags = 0644; | ||
| 194 : | if ($filePerms!='') { | ||
| 195 : | $mode = 1; | ||
| 196 : | $flags = octdec($filePerms); | ||
| 197 : | } // if | ||
| 198 : | ?> | ||
| 199 : | <td colspan="2"> | ||
| 200 : | <fieldset><legend>File Permissions</legend> | ||
| 201 : | <table cellpadding="1" cellspacing="1" border="0"> | ||
| 202 : | <tr> | ||
| 203 : | <td><input type="radio" id="filePermsMode0" name="filePermsMode" value="0" onclick="changeFilePermsMode(0)"<?php if (!$mode) echo ' checked="checked"'; ?>/></td> | ||
| 204 : | <td><label for="filePermsMode0">Dont CHMOD files (use server defaults)</label></td> | ||
| 205 : | </tr> | ||
| 206 : | <tr> | ||
| 207 : | <td><input type="radio" id="filePermsMode1" name="filePermsMode" value="1" onclick="changeFilePermsMode(1)"<?php if ($mode) echo ' checked="checked"'; ?>/></td> | ||
| 208 : | <td><label for="filePermsMode1"> CHMOD files to:</label></td> | ||
| 209 : | </tr> | ||
| 210 : | <tr id="filePermsFlags"<?php if (!$mode) echo ' style="display:none"'; ?>> | ||
| 211 : | <td> </td> | ||
| 212 : | <td> | ||
| 213 : | <table cellpadding="1" cellspacing="0" border="0"> | ||
| 214 : | <tr> | ||
| 215 : | <td>User:</td> | ||
| 216 : | <td><input type="checkbox" id="filePermsUserRead" name="filePermsUserRead" value="1"<?php if ($flags & 0400) echo ' checked="checked"'; ?>/></td> | ||
| 217 : | <td><label for="filePermsUserRead">read</label></td> | ||
| 218 : | <td><input type="checkbox" id="filePermsUserWrite" name="filePermsUserWrite" value="1"<?php if ($flags & 0200) echo ' checked="checked"'; ?>/></td> | ||
| 219 : | <td><label for="filePermsUserWrite">write</label></td> | ||
| 220 : | <td><input type="checkbox" id="filePermsUserExecute" name="filePermsUserExecute" value="1"<?php if ($flags & 0100) echo ' checked="checked"'; ?>/></td> | ||
| 221 : | <td width="100%"><label for="filePermsUserExecute">execute</label></td> | ||
| 222 : | </tr> | ||
| 223 : | <tr> | ||
| 224 : | <td>Group:</td> | ||
| 225 : | <td><input type="checkbox" id="filePermsGroupRead" name="filePermsGroupRead" value="1"<?php if ($flags & 040) echo ' checked="checked"'; ?>/></td> | ||
| 226 : | <td><label for="filePermsGroupRead">read</label></td> | ||
| 227 : | <td><input type="checkbox" id="filePermsGroupWrite" name="filePermsGroupWrite" value="1"<?php if ($flags & 020) echo ' checked="checked"'; ?>/></td> | ||
| 228 : | <td><label for="filePermsGroupWrite">write</label></td> | ||
| 229 : | <td><input type="checkbox" id="filePermsGroupExecute" name="filePermsGroupExecute" value="1"<?php if ($flags & 010) echo ' checked="checked"'; ?>/></td> | ||
| 230 : | <td width="100%"><label for="filePermsGroupExecute">execute</label></td> | ||
| 231 : | </tr> | ||
| 232 : | <tr> | ||
| 233 : | <td>World:</td> | ||
| 234 : | <td><input type="checkbox" id="filePermsWorldRead" name="filePermsWorldRead" value="1"<?php if ($flags & 04) echo ' checked="checked"'; ?>/></td> | ||
| 235 : | <td><label for="filePermsWorldRead">read</label></td> | ||
| 236 : | <td><input type="checkbox" id="filePermsWorldWrite" name="filePermsWorldWrite" value="1"<?php if ($flags & 02) echo ' checked="checked"'; ?>/></td> | ||
| 237 : | <td><label for="filePermsWorldWrite">write</label></td> | ||
| 238 : | <td><input type="checkbox" id="filePermsWorldExecute" name="filePermsWorldExecute" value="1"<?php if ($flags & 01) echo ' checked="checked"'; ?>/></td> | ||
| 239 : | <td width="100%"><label for="filePermsWorldExecute">execute</label></td> | ||
| 240 : | </tr> | ||
| 241 : | </table> | ||
| 242 : | </td> | ||
| 243 : | </tr> | ||
| 244 : | </table> | ||
| 245 : | </fieldset> | ||
| 246 : | </td> | ||
| 247 : | </tr> | ||
| 248 : | <tr> | ||
| 249 : | <?php | ||
| 250 : | $mode = 0; | ||
| 251 : | $flags = 0755; | ||
| 252 : | if ($dirPerms!='') { | ||
| 253 : | $mode = 1; | ||
| 254 : | $flags = octdec($dirPerms); | ||
| 255 : | } // if | ||
| 256 : | ?> | ||
| 257 : | <td colspan="2"> | ||
| 258 : | <fieldset><legend>Directory Permissions</legend> | ||
| 259 : | <table cellpadding="1" cellspacing="1" border="0"> | ||
| 260 : | <tr> | ||
| 261 : | <td><input type="radio" id="dirPermsMode0" name="dirPermsMode" value="0" onclick="changeDirPermsMode(0)"<?php if (!$mode) echo ' checked="checked"'; ?>/></td> | ||
| 262 : | <td><label for="dirPermsMode0">Dont CHMOD directories (use server defaults)</label></td> | ||
| 263 : | </tr> | ||
| 264 : | <tr> | ||
| 265 : | <td><input type="radio" id="dirPermsMode1" name="dirPermsMode" value="1" onclick="changeDirPermsMode(1)"<?php if ($mode) echo ' checked="checked"'; ?>/></td> | ||
| 266 : | <td><label for="dirPermsMode1"> CHMOD directories to:</label></td> | ||
| 267 : | </tr> | ||
| 268 : | <tr id="dirPermsFlags"<?php if (!$mode) echo ' style="display:none"'; ?>> | ||
| 269 : | <td> </td> | ||
| 270 : | <td> | ||
| 271 : | <table cellpadding="1" cellspacing="0" border="0"> | ||
| 272 : | <tr> | ||
| 273 : | <td>User:</td> | ||
| 274 : | <td><input type="checkbox" id="dirPermsUserRead" name="dirPermsUserRead" value="1"<?php if ($flags & 0400) echo ' checked="checked"'; ?>/></td> | ||
| 275 : | <td><label for="dirPermsUserRead">read</label></td> | ||
| 276 : | <td><input type="checkbox" id="dirPermsUserWrite" name="dirPermsUserWrite" value="1"<?php if ($flags & 0200) echo ' checked="checked"'; ?>/></td> | ||
| 277 : | <td><label for="dirPermsUserWrite">write</label></td> | ||
| 278 : | <td><input type="checkbox" id="dirPermsUserSearch" name="dirPermsUserSearch" value="1"<?php if ($flags & 0100) echo ' checked="checked"'; ?>/></td> | ||
| 279 : | <td width="100%"><label for="dirPermsUserSearch">search</label></td> | ||
| 280 : | </tr> | ||
| 281 : | <tr> | ||
| 282 : | <td>Group:</td> | ||
| 283 : | <td><input type="checkbox" id="dirPermsGroupRead" name="dirPermsGroupRead" value="1"<?php if ($flags & 040) echo ' checked="checked"'; ?>/></td> | ||
| 284 : | <td><label for="dirPermsGroupRead">read</label></td> | ||
| 285 : | <td><input type="checkbox" id="dirPermsGroupWrite" name="dirPermsGroupWrite" value="1"<?php if ($flags & 020) echo ' checked="checked"'; ?>/></td> | ||
| 286 : | <td><label for="dirPermsGroupWrite">write</label></td> | ||
| 287 : | <td><input type="checkbox" id="dirPermsGroupSearch" name="dirPermsGroupSearch" value="1"<?php if ($flags & 010) echo ' checked="checked"'; ?>/></td> | ||
| 288 : | <td width="100%"><label for="dirPermsGroupSearch">search</label></td> | ||
| 289 : | </tr> | ||
| 290 : | <tr> | ||
| 291 : | <td>World:</td> | ||
| 292 : | <td><input type="checkbox" id="dirPermsWorldRead" name="dirPermsWorldRead" value="1"<?php if ($flags & 04) echo ' checked="checked"'; ?>/></td> | ||
| 293 : | <td><label for="dirPermsWorldRead">read</label></td> | ||
| 294 : | <td><input type="checkbox" id="dirPermsWorldWrite" name="dirPermsWorldWrite" value="1"<?php if ($flags & 02) echo ' checked="checked"'; ?>/></td> | ||
| 295 : | <td><label for="dirPermsWorldWrite">write</label></td> | ||
| 296 : | <td><input type="checkbox" id="dirPermsWorldSearch" name="dirPermsWorldSearch" value="1"<?php if ($flags & 01) echo ' checked="checked"'; ?>/></td> | ||
| 297 : | <td width="100%"><label for="dirPermsWorldSearch">search</label></td> | ||
| 298 : | </tr> | ||
| 299 : | </table> | ||
| 300 : | </td> | ||
| 301 : | </tr> | ||
| 302 : | </table> | ||
| 303 : | </fieldset> | ||
| 304 : | </td> | ||
| 305 : | </tr> | ||
| 306 : | </table> | ||
| 307 : | </div> | ||
| 308 : | </div> | ||
| 309 : | <div id="break"></div> | ||
| 310 : | </div> | ||
| 311 : | <div class="clr"></div> | ||
| 312 : | </div> | ||
| 313 : | </form> | ||
| 314 : | </div> | ||
| 315 : | <div class="clr"></div> | ||
| 316 : | </body> | ||
| 317 : | </html> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

