Source for file install3.php

Documentation is available at install3.php

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

Documentation generated on Mon, 05 May 2008 16:20:35 +0400 by phpDocumentor 1.4.0