--- mambo/branches/4.6/installation/install4.php 2007/10/22 05:41:57 1358 +++ mambo/branches/4.6/installation/install4.php 2007/10/23 08:50:31 1359 @@ -1,485 +1,491 @@ - - - - - - - - - - - - - - "; - echo ""; - return; -} - -if($DBhostname && $DBuserName && $DBname) { - $configArray['DBhostname'] = $DBhostname; - $configArray['DBuserName'] = $DBuserName; - $configArray['DBpassword'] = $DBpassword; - $configArray['DBname'] = $DBname; - $configArray['DBPrefix'] = $DBPrefix; -} else { - echo "
- - - - - - - - - - - - -
"; - - echo ""; - return; -} - -if ($sitename) { - $configArray['sitename'] = $sitename; -} else { - ?> -
- - - - - - - - - - - - -
- - - - Please check back again soon.')."';\n"; - $config .= "\$mosConfig_error_message = '".T_('This site is temporarily unavailable.
Please notify the System Administrator')."';\n"; - $config .= "\$mosConfig_debug = '0';\n"; - $config .= "\$mosConfig_lifetime = '900';\n"; - $config .= "\$mosConfig_MetaDesc = '".T_('This site uses Mambo - the free, open source content management system')."';\n"; - $config .= "\$mosConfig_MetaKeys = 'mambo user, Mambo';\n"; - $config .= "\$mosConfig_MetaTitle = '1';\n"; - $config .= "\$mosConfig_MetaAuthor = '1';\n"; - $config .= "\$mosConfig_locale_debug = '0';\n"; - $config .= "\$mosConfig_locale_use_gettext = '0';\n"; - $config .= "\$mosConfig_locale = 'en';\n"; - $config .= "\$mosConfig_offset = '0';\n"; - $config .= "\$mosConfig_hideAuthor = '0';\n"; - $config .= "\$mosConfig_hideCreateDate = '0';\n"; - $config .= "\$mosConfig_hideModifyDate = '0';\n"; - $config .= "\$mosConfig_hidePdf = '".intval( !is_writable( "{$configArray['absolutePath']}/media/" ) )."';\n"; - $config .= "\$mosConfig_hidePrint = '0';\n"; - $config .= "\$mosConfig_hideEmail = '0';\n"; - $config .= "\$mosConfig_enable_log_items = '0';\n"; - $config .= "\$mosConfig_enable_log_searches = '0';\n"; - $config .= "\$mosConfig_enable_stats = '0';\n"; - $config .= "\$mosConfig_sef = '0';\n"; - $config .= "\$mosConfig_vote = '0';\n"; - $config .= "\$mosConfig_gzip = '0';\n"; - $config .= "\$mosConfig_multipage_toc = '1';\n"; - $config .= "\$mosConfig_allowUserRegistration = '1';\n"; - $config .= "\$mosConfig_link_titles = '0';\n"; - $config .= "\$mosConfig_error_reporting = '-1';\n"; - $config .= "\$mosConfig_register_globals = '1';\n"; - $config .= "\$mosConfig_list_limit = '50';\n"; - $config .= "\$mosConfig_caching = '0';\n"; - $config .= "\$mosConfig_cachepath = '{$configArray['absolutePath']}/cache';\n"; - $config .= "\$mosConfig_cachetime = '900';\n"; - $config .= "\$mosConfig_mailer = 'mail';\n"; - $config .= "\$mosConfig_mailfrom = '$adminEmail';\n"; - $config .= "\$mosConfig_fromname = '{$configArray['sitename']}';\n"; - $config .= "\$mosConfig_sendmail = '/usr/sbin/sendmail';\n"; - $config .= "\$mosConfig_smtpauth = '0';\n"; - $config .= "\$mosConfig_smtpuser = '';\n"; - $config .= "\$mosConfig_smtppass = '';\n"; - $config .= "\$mosConfig_smtphost = 'localhost';\n"; - $config .= "\$mosConfig_back_button = '0';\n"; - $config .= "\$mosConfig_item_navigation = '0';\n"; - $config .= "\$mosConfig_secret = '" . mosMakePassword(16) . "';\n"; - $config .= "\$mosConfig_pagetitles = '1';\n"; - $config .= "\$mosConfig_readmore = '1';\n"; - $config .= "\$mosConfig_hits = '1';\n"; - $config .= "\$mosConfig_icons = '1';\n"; - $config .= "\$mosConfig_favicon = 'favicon.ico';\n"; - $config .= "\$mosConfig_fileperms = '".$configArray['filePerms']."';\n"; - $config .= "\$mosConfig_dirperms = '".$configArray['dirPerms']."';\n"; - $config .= "\$mosConfig_helpurl = 'http://docs.mambo-foundation.org';\n"; - $config .= "\$mosConfig_mbf_content = '0';\n"; - $config .= "\$mosConfig_doctype = 'xhtml-trans';\n"; - $config .= "setlocale (LC_TIME, \$mosConfig_locale);\n"; - $config .= "?>"; - - if ($canWrite && ($fp = fopen("../configuration.php", "w"))) { - fputs( $fp, $config, strlen( $config ) ); - fclose( $fp ); - } else { - $canWrite = false; - } // if - - $cryptpass=md5($adminPassword); - - mysql_connect($DBhostname, $DBuserName, $DBpassword); - mysql_select_db($DBname); - - // create the admin user - $installdate = date("Y-m-d H:i:s"); - $query = "INSERT INTO `{$DBPrefix}users` VALUES (62, 'Administrator', 'admin', '$adminEmail', '$cryptpass', 'Super Administrator', 0, 1, 25, '$installdate', '0000-00-00 00:00:00', '', '')"; - mysql_query( $query ); - // add the ARO (Access Request Object) - $query = "INSERT INTO `{$DBPrefix}core_acl_aro` VALUES (10,'users','62',0,'Administrator',0)"; - mysql_query( $query ); - // add the map between the ARO and the Group - $query = "INSERT INTO `{$DBPrefix}core_acl_groups_aro_map` VALUES (25,'',10)"; - mysql_query( $query ); - - // chmod files and directories if desired - $chmod_report = T_('Directory and file permissions left unchanged.'); - if ($filePerms != '' || $dirPerms != '') { - $mosrootfiles = array( - 'administrator', - 'cache', - 'components', - 'editor', - 'files', - 'help', - 'images', - 'includes', - 'parameters', - 'installation', - 'language', - 'mambots', - 'media', - 'modules', - 'templates', - 'CHANGELOG', - 'configuration.php', - 'htaccess.txt', - 'index.php', - 'index2.php', - 'index3.php', - 'INSTALL', - 'LICENSE', - 'mainbody.php', - 'offline.php', - 'page404.php', - 'pathway.php', - 'README', - 'robots.txt' - ); - $filemode = NULL; - if ($filePerms != '') $filemode = octdec($filePerms); - $dirmode = NULL; - if ($dirPerms != '') $dirmode = octdec($dirPerms); - $chmodOk = TRUE; - foreach ($mosrootfiles as $file) - if (!mosChmodRecursive($absolutePath.'/'.$file, $filemode, $dirmode)) - $chmodOk = FALSE; - if ($chmodOk) - $chmod_report = T_('File and directory permissions successfully changed.'); - else - $chmod_report = T_('File and directory permissions could not be changed.
'. - 'Please CHMOD mambo files and directories manually.'); - } // if chmod wanted -} else { -?> -
- - - - - - - - - - - - -
- -"; -?> - - - -<?php echo T_('Mambo - Web Installer') ?> - - - - - -
- -
-
-
-
-
-
-
-
-
-
-
-
- /> - /> -
-
-
-
-
-
-

-
Click the "View Site" button to start Mambo site or "Administration" to take you to administrator login.

Please take a moment to fill out the form below.

') ?> -
-
-
- - - - - - - - - - - - - - - - -
REMOVE THE INSTALLATION DIRECTORY') ?>
admin
 
 
-
- -
-
-
-
-
-
-
-
-

- - - - - - -
-


-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  
  
  
   - -

-
   -
-
-
-
-
-
-
-
-
-Mambo is Free Software released under the GNU/GPL License.') ?> -
- - \ No newline at end of file + +"; +?> + + + +<?php echo T_('Mambo - Web Installer') ?> + + + + + + + + + + + + + + + + + + + "; + $error_msg = T_('You must provide a valid admin email address'); + echo ""; + return; +} + +if($DBhostname && $DBuserName && $DBname) { + $configArray['DBhostname'] = $DBhostname; + $configArray['DBuserName'] = $DBuserName; + $configArray['DBpassword'] = $DBpassword; + $configArray['DBname'] = $DBname; + $configArray['DBPrefix'] = $DBPrefix; +} else { + echo "
+ + + + + + + + + + + + +
"; + $error_msg = T_('The database details provided are incorrect and/or empty'); + echo ""; + return; +} + +if ($sitename) { + $configArray['sitename'] = $sitename; +} else { + ?> +
+ + + + + + + + + + + + +
+ alert('".$error_msg."'); document.stepBack.submit(); "; + return; + +} + +if (file_exists( '../configuration.php' )) { + $canWrite = is_writable( '../configuration.php' ); +} else { + $canWrite = is_writable( '..' ); +} + +if ($siteUrl) { + $configArray['siteUrl']=$siteUrl; + // Fix for Windows + $absolutePath= str_replace("\\","/", $absolutePath); + $absolutePath= str_replace("//","/", $absolutePath); + $configArray['absolutePath']=$absolutePath; + $configArray['filePerms']=$filePerms; + $configArray['dirPerms']=$dirPerms; + $configArray['sitename'] = addslashes($configArray['sitename']); + + $config = " Please check back again soon.')."';\n"; + $config .= "\$mosConfig_error_message = '".T_('This site is temporarily unavailable.
Please notify the System Administrator')."';\n"; + $config .= "\$mosConfig_debug = '0';\n"; + $config .= "\$mosConfig_lifetime = '900';\n"; + $config .= "\$mosConfig_MetaDesc = '".T_('This site uses Mambo - the free, open source content management system')."';\n"; + $config .= "\$mosConfig_MetaKeys = 'mambo user, Mambo';\n"; + $config .= "\$mosConfig_MetaTitle = '1';\n"; + $config .= "\$mosConfig_MetaAuthor = '1';\n"; + $config .= "\$mosConfig_locale_debug = '0';\n"; + $config .= "\$mosConfig_locale_use_gettext = '0';\n"; + $config .= "\$mosConfig_locale = 'en';\n"; + $config .= "\$mosConfig_offset = '0';\n"; + $config .= "\$mosConfig_hideAuthor = '0';\n"; + $config .= "\$mosConfig_hideCreateDate = '0';\n"; + $config .= "\$mosConfig_hideModifyDate = '0';\n"; + $config .= "\$mosConfig_hidePdf = '".intval( !is_writable( "{$configArray['absolutePath']}/media/" ) )."';\n"; + $config .= "\$mosConfig_hidePrint = '0';\n"; + $config .= "\$mosConfig_hideEmail = '0';\n"; + $config .= "\$mosConfig_enable_log_items = '0';\n"; + $config .= "\$mosConfig_enable_log_searches = '0';\n"; + $config .= "\$mosConfig_enable_stats = '0';\n"; + $config .= "\$mosConfig_sef = '0';\n"; + $config .= "\$mosConfig_vote = '0';\n"; + $config .= "\$mosConfig_gzip = '0';\n"; + $config .= "\$mosConfig_multipage_toc = '1';\n"; + $config .= "\$mosConfig_allowUserRegistration = '1';\n"; + $config .= "\$mosConfig_link_titles = '0';\n"; + $config .= "\$mosConfig_error_reporting = '-1';\n"; + $config .= "\$mosConfig_register_globals = '1';\n"; + $config .= "\$mosConfig_list_limit = '50';\n"; + $config .= "\$mosConfig_caching = '0';\n"; + $config .= "\$mosConfig_cachepath = '{$configArray['absolutePath']}/cache';\n"; + $config .= "\$mosConfig_cachetime = '900';\n"; + $config .= "\$mosConfig_mailer = 'mail';\n"; + $config .= "\$mosConfig_mailfrom = '$adminEmail';\n"; + $config .= "\$mosConfig_fromname = '{$configArray['sitename']}';\n"; + $config .= "\$mosConfig_sendmail = '/usr/sbin/sendmail';\n"; + $config .= "\$mosConfig_smtpauth = '0';\n"; + $config .= "\$mosConfig_smtpuser = '';\n"; + $config .= "\$mosConfig_smtppass = '';\n"; + $config .= "\$mosConfig_smtphost = 'localhost';\n"; + $config .= "\$mosConfig_back_button = '0';\n"; + $config .= "\$mosConfig_item_navigation = '0';\n"; + $config .= "\$mosConfig_secret = '" . mosMakePassword(16) . "';\n"; + $config .= "\$mosConfig_pagetitles = '1';\n"; + $config .= "\$mosConfig_readmore = '1';\n"; + $config .= "\$mosConfig_hits = '1';\n"; + $config .= "\$mosConfig_icons = '1';\n"; + $config .= "\$mosConfig_favicon = 'favicon.ico';\n"; + $config .= "\$mosConfig_fileperms = '".$configArray['filePerms']."';\n"; + $config .= "\$mosConfig_dirperms = '".$configArray['dirPerms']."';\n"; + $config .= "\$mosConfig_helpurl = 'http://docs.mambo-foundation.org';\n"; + $config .= "\$mosConfig_mbf_content = '0';\n"; + $config .= "\$mosConfig_doctype = 'xhtml-trans';\n"; + $config .= "setlocale (LC_TIME, \$mosConfig_locale);\n"; + $config .= "?>"; + + if ($canWrite && ($fp = fopen("../configuration.php", "w"))) { + fputs( $fp, $config, strlen( $config ) ); + fclose( $fp ); + } else { + $canWrite = false; + } // if + + $cryptpass=md5($adminPassword); + + mysql_connect($DBhostname, $DBuserName, $DBpassword); + mysql_select_db($DBname); + + // create the admin user + $installdate = date("Y-m-d H:i:s"); + $query = "INSERT INTO `{$DBPrefix}users` VALUES (62, 'Administrator', 'admin', '$adminEmail', '$cryptpass', 'Super Administrator', 0, 1, 25, '$installdate', '0000-00-00 00:00:00', '', '')"; + mysql_query( $query ); + // add the ARO (Access Request Object) + $query = "INSERT INTO `{$DBPrefix}core_acl_aro` VALUES (10,'users','62',0,'Administrator',0)"; + mysql_query( $query ); + // add the map between the ARO and the Group + $query = "INSERT INTO `{$DBPrefix}core_acl_groups_aro_map` VALUES (25,'',10)"; + mysql_query( $query ); + + // chmod files and directories if desired + $chmod_report = T_('Directory and file permissions left unchanged.'); + if ($filePerms != '' || $dirPerms != '') { + $mosrootfiles = array( + 'administrator', + 'cache', + 'components', + 'editor', + 'files', + 'help', + 'images', + 'includes', + 'parameters', + 'installation', + 'language', + 'mambots', + 'media', + 'modules', + 'templates', + 'CHANGELOG', + 'configuration.php', + 'htaccess.txt', + 'index.php', + 'index2.php', + 'index3.php', + 'INSTALL', + 'LICENSE', + 'mainbody.php', + 'offline.php', + 'page404.php', + 'pathway.php', + 'README', + 'robots.txt' + ); + $filemode = NULL; + if ($filePerms != '') $filemode = octdec($filePerms); + $dirmode = NULL; + if ($dirPerms != '') $dirmode = octdec($dirPerms); + $chmodOk = TRUE; + foreach ($mosrootfiles as $file) + if (!mosChmodRecursive($absolutePath.'/'.$file, $filemode, $dirmode)) + $chmodOk = FALSE; + if ($chmodOk) + $chmod_report = T_('File and directory permissions successfully changed.'); + else + $chmod_report = T_('File and directory permissions could not be changed.
'. + 'Please CHMOD mambo files and directories manually.'); + } // if chmod wanted +} else { +?> +
+ + + + + + + + + + + + +
+alert('".$error_msg."'); document.stepBack.submit(); "; + return; +} ?> +
+ +
+
+
+
+
+
+
+
+
+
+
+
+ /> + /> +
+
+
+
+
+
+

+
Click the "View Site" button to start Mambo site or "Administration" to take you to administrator login.

Please take a moment to fill out the form below.

') ?> +
+
+
+ + + + + + + + + + + + + + + + +
REMOVE THE INSTALLATION DIRECTORY') ?>
admin
 
 
+
+ +
+
+
+
+
+
+
+
+

+ + + + + + +
+


+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  
  
  
   + +

+
   +
+
+
+
+
+
+
+
+
+Mambo is Free Software released under the GNU/GPL License.') ?> +
+ + +