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

