2001-07-30 17:59:25 +02:00
< ? php
/************************************************************************** \
* phpGroupWare *
* http :// www . phpgroupware . org *
* -------------------------------------------- *
* This program is free software ; you can redistribute it and / or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation ; either version 2 of the License , or ( at your *
* option ) any later version . *
\ **************************************************************************/
/* $Id$ */
2002-03-03 22:53:00 +01:00
$phpgw_info = array ();
$GLOBALS [ 'phpgw_info' ][ 'flags' ] = array (
2002-01-02 16:47:54 +01:00
'nocachecontrol' => True ,
2001-07-30 17:59:25 +02:00
'noheader' => True ,
'nonavbar' => True ,
2001-08-21 20:48:50 +02:00
'currentapp' => 'home' ,
2001-07-30 17:59:25 +02:00
'noapi' => True
);
2001-08-21 20:48:50 +02:00
include ( './inc/functions.inc.php' );
2001-07-30 17:59:25 +02:00
2001-08-21 20:48:50 +02:00
include ( '../phpgwapi/setup/setup.inc.php' );
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'versions' ][ 'current_header' ] = $setup_info [ 'phpgwapi' ][ 'versions' ][ 'current_header' ];
2001-08-21 20:48:50 +02:00
unset ( $setup_info );
#include('../version.inc.php');
2001-07-30 17:59:25 +02:00
2001-08-21 20:48:50 +02:00
function check_form_values ()
2001-07-30 17:59:25 +02:00
{
2001-09-17 05:19:07 +02:00
if ( ! $GLOBALS [ 'HTTP_POST_VARS' ][ 'setting' ][ 'config_pass' ])
2001-08-21 20:48:50 +02:00
{
$errors .= " <br>You didn't enter a config password " ;
}
2001-09-17 05:19:07 +02:00
if ( ! $GLOBALS [ 'HTTP_POST_VARS' ][ 'setting' ][ 'HEADER_ADMIN_PASSWORD' ])
2001-08-21 20:48:50 +02:00
{
$errors .= " <br>You didn't enter a header admin password " ;
}
if ( $errors )
{
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_setup' ] -> html -> show_header ( 'Error' , True );
2001-08-21 20:48:50 +02:00
echo $errors ;
exit ;
}
2001-07-30 17:59:25 +02:00
}
/* authentication phase */
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'stage' ][ 'header' ] = $GLOBALS [ 'phpgw_setup' ] -> detection -> check_header ();
2001-07-30 17:59:25 +02:00
// added these to let the app work, need to templatize still
2002-03-03 22:53:00 +01:00
$tpl_root = $GLOBALS [ 'phpgw_setup' ] -> html -> setup_tpl_dir ( 'setup' );
2001-08-21 20:48:50 +02:00
$setup_tpl = CreateObject ( 'phpgwapi.Template' , $tpl_root );
$setup_tpl -> set_file ( array (
2001-07-30 17:59:25 +02:00
'T_head' => 'head.tpl' ,
'T_footer' => 'footer.tpl' ,
'T_alert_msg' => 'msg_alert_msg.tpl' ,
'T_login_main' => 'login_main.tpl' ,
'T_login_stage_header' => 'login_stage_header.tpl' ,
'T_setup_main' => 'setup_main.tpl' ,
'T_setup_db_blocks' => 'setup_db_blocks.tpl'
));
2001-08-21 20:48:50 +02:00
$setup_tpl -> set_block ( 'T_login_stage_header' , 'B_multi_domain' , 'V_multi_domain' );
$setup_tpl -> set_block ( 'T_login_stage_header' , 'B_single_domain' , 'V_single_domain' );
2001-07-30 17:59:25 +02:00
2002-03-03 22:53:00 +01:00
switch ( $GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'stage' ][ 'header' ])
2001-08-21 20:48:50 +02:00
{
case '1' :
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'HeaderFormMSG' ] = 'Create your header.inc.php' ;
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'PageMSG' ] = 'You have not created your header.inc.php yet!<br> You can create it now.' ;
2001-08-21 20:48:50 +02:00
break ;
case '2' :
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'HeaderFormMSG' ] = 'Your header admin password is NOT set. Please set it now!' ;
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'PageMSG' ] = 'Your header admin password is NOT set. Please set it now!' ;
2001-08-21 20:48:50 +02:00
break ;
case '3' :
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'HeaderFormMSG' ] = 'Your header.inc.php needs upgrading.' ;
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'PageMSG' ] = 'Your header.inc.php needs upgrading.<br><blink><font color=CC0000><b>WARNING!</b></font></blink><br>If you are using virtual domain support, this will <b>NOT</b> copy those domains over. You will need to do this manually, <b>MAKE BACKUPS!</b>' ;
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'HeaderLoginMSG' ] = 'Your header.inc.php needs upgrading.' ;
if ( ! $GLOBALS [ 'phpgw_setup' ] -> auth ( 'Header' ))
2001-08-21 20:48:50 +02:00
{
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_setup' ] -> html -> show_header ( 'Please login' , True );
$GLOBALS [ 'phpgw_setup' ] -> html -> login_form ();
2001-08-21 20:48:50 +02:00
exit ;
}
break ;
case '10' :
2002-03-03 22:53:00 +01:00
if ( ! $GLOBALS [ 'phpgw_setup' ] -> auth ( 'Header' ))
2001-08-21 20:48:50 +02:00
{
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_setup' ] -> html -> show_header ( 'Please login' , True );
$GLOBALS [ 'phpgw_setup' ] -> html -> login_form ();
2001-08-21 20:48:50 +02:00
exit ;
}
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'HeaderFormMSG' ] = 'Edit your header.inc.php' ;
$GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'PageMSG' ] = 'Edit your existing header.inc.php' ;
2001-08-21 20:48:50 +02:00
break ;
}
2001-07-30 17:59:25 +02:00
2001-09-17 05:19:07 +02:00
switch ( $HTTP_POST_VARS [ 'action' ])
2001-08-21 20:48:50 +02:00
{
case 'download' :
check_form_values ();
2001-09-17 05:19:07 +02:00
$header_template = CreateObject ( 'phpgwapi.Template' , '../' );
2001-08-21 20:48:50 +02:00
header ( 'Content-disposition: attachment; filename="header.inc.php"' );
header ( 'Content-type: application/octet-stream' );
header ( 'Pragma: no-cache' );
header ( 'Expires: 0' );
2002-03-03 22:53:00 +01:00
$newheader = $GLOBALS [ 'phpgw_setup' ] -> html -> generate_header ();
2001-08-21 20:48:50 +02:00
echo $newheader ;
break ;
case 'view' :
check_form_values ();
2001-09-17 05:19:07 +02:00
$header_template = CreateObject ( 'phpgwapi.Template' , '../' );
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_setup' ] -> html -> show_header ( 'Generated header.inc.php' , False , 'header' );
2001-08-21 20:48:50 +02:00
echo '<br>Save this text as contents of your header.inc.php<br><hr>' ;
2002-03-03 22:53:00 +01:00
$newheader = $GLOBALS [ 'phpgw_setup' ] -> html -> generate_header ();
2001-08-21 20:48:50 +02:00
echo '<pre>' ;
echo htmlentities ( $newheader );
echo '</pre><hr>' ;
2001-07-30 17:59:25 +02:00
echo '<form action="index.php" method=post>' ;
2001-08-21 20:48:50 +02:00
echo '<br> After retrieving the file put it into place as the header.inc.php, then click continue.<br>' ;
2001-07-30 17:59:25 +02:00
echo '<input type=hidden name="FormLogout" value="header">' ;
echo '<input type=submit name="junk" value="continue">' ;
echo '</form>' ;
echo '</body></html>' ;
break ;
2001-08-21 20:48:50 +02:00
case 'write config' :
check_form_values ();
2001-09-17 05:19:07 +02:00
$header_template = CreateObject ( 'phpgwapi.Template' , '../' );
2001-08-21 20:48:50 +02:00
if ( is_writeable ( '../header.inc.php' ) || ( ! file_exists ( '../header.inc.php' ) && is_writeable ( '../' )))
{
2002-03-03 22:53:00 +01:00
$newheader = $GLOBALS [ 'phpgw_setup' ] -> html -> generate_header ();
2001-08-21 20:48:50 +02:00
$fsetup = fopen ( '../header.inc.php' , 'wb' );
fwrite ( $fsetup , $newheader );
fclose ( $fsetup );
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_setup' ] -> html -> show_header ( 'Saved header.inc.php' , False , 'header' );
2001-08-21 20:48:50 +02:00
echo '<form action="index.php" method=post>' ;
echo '<br>Created header.inc.php! ' ;
echo '<input type=hidden name="FormLogout" value="header">' ;
echo '<input type=submit name="junk" value="continue">' ;
echo '</form>' ;
echo '</body></html>' ;
break ;
}
else
{
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_setup' ] -> html -> show_header ( 'Error generating header.inc.php' , False , 'header' );
2001-08-21 20:48:50 +02:00
echo 'Could not open header.inc.php for writing!<br>' . " \n " ;
echo 'Please check read/write permissions on directories or back up and use another option.<br>' ;
echo '</td></tr></table></body></html>' ;
}
break ;
default :
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_setup' ] -> html -> show_header ( $GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'HeaderFormMSG' ], False , 'header' );
echo $GLOBALS [ 'phpgw_info' ][ 'setup' ][ 'PageMSG' ];
2001-07-30 17:59:25 +02:00
/*
echo '<table border="0" width="100%" cellspacing="0" cellpadding="2">' ;
echo ' <tr><td align="center" WIDTH="20%" bgcolor="486591" colspan=2><font color="fefefe">Analysis</td></tr>' ;
echo '</table>' ;
*/
2001-08-21 20:48:50 +02:00
echo '<table border="0" width="100%" cellspacing="0" cellpadding="2">' ;
echo '<tr bgcolor="486591"><td align="center" colspan=2><font color="fefefe"> Analysis </font></td></tr><tr><td colspan=2>' ;
2001-07-30 17:59:25 +02:00
// Hardly try to find what DB-support is compiled in
// this dont work with PHP 3.0.10 and lower !
2001-08-21 20:48:50 +02:00
$supported_db = array ();
if ( extension_loaded ( 'mysql' ) || function_exists ( 'mysql_connect' ))
2001-07-30 17:59:25 +02:00
{
2001-08-21 20:48:50 +02:00
echo 'You appear to have MySQL support enabled<br>' . " \n " ;
$supported_db [] = 'mysql' ;
2001-07-30 17:59:25 +02:00
}
else
{
2001-08-21 20:48:50 +02:00
echo 'No MySQL support found. Disabling<br>' . " \n " ;
2001-07-30 17:59:25 +02:00
}
2001-08-21 20:48:50 +02:00
if ( extension_loaded ( 'pgsql' ) || function_exists ( 'pg_connect' ))
{
echo 'You appear to have Postgres-DB support enabled<br>' . " \n " ;
$supported_db [] = 'pgsql' ;
}
else
{
echo 'No Postgres-DB support found. Disabling<br>' . " \n " ;
}
if ( extension_loaded ( 'mssql' ) || function_exists ( 'mssql_connect' ))
2001-07-30 17:59:25 +02:00
{
2001-08-21 20:48:50 +02:00
echo 'You appear to have Microsoft SQL Server support enabled<br>' . " \n " ;
$supported_db [] = 'mssql' ;
2001-07-30 17:59:25 +02:00
}
else
{
2001-08-21 20:48:50 +02:00
echo 'No Microsoft SQL Server support found. Disabling<br>' . " \n " ;
}
if ( extension_loaded ( 'oci8' ))
{
echo 'You appear to have Oracle V8 (OCI) support enabled<br>' . " \n " ;
$supported_db [] = 'oracle' ;
}
else
{
if ( extension_loaded ( 'oracle' ))
2001-07-30 17:59:25 +02:00
{
2001-08-21 20:48:50 +02:00
echo 'You appear to have Oracle support enabled<br>' . " \n " ;
$supported_db [] = 'oracle' ;
}
else
{
echo 'No Oracle-DB support found. Disabling<br>' . " \n " ;
2001-07-30 17:59:25 +02:00
}
}
2001-08-21 20:48:50 +02:00
if ( ! count ( $supported_db ))
2001-07-30 17:59:25 +02:00
{
2001-08-21 20:48:50 +02:00
echo '<b><p align=center><font size=+2 color=red>did not found any valid DB support !<br>try to configure your php to support one of the above mentioned dbs or install phpgroupware by hand </font></p></b><td></tr></table></body></html>' ;
exit ;
2001-07-30 17:59:25 +02:00
}
2002-01-02 16:47:54 +01:00
if ( floor ( phpversion ()) == 3 )
{
echo 'You appear to be using PHP3. Disabling PHP4 sessions support<br>' . " \n " ;
$supported_sessions_type [] = 'db' ;
}
else
{
echo 'You appear to be using PHP4. Enabling PHP4 sessions support<br>' . " \n " ;
$supported_sessions_type [] = 'db' ;
$supported_sessions_type [] = 'php4' ;
}
2001-08-21 20:48:50 +02:00
$no_guess = false ;
if ( file_exists ( '../header.inc.php' ) && is_file ( '../header.inc.php' ))
2001-07-30 17:59:25 +02:00
{
2001-08-21 20:48:50 +02:00
echo 'Found existing configuration file. Loading settings from the file...<br>' . " \n " ;
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'flags' ][ 'noapi' ] = True ;
2001-08-21 20:48:50 +02:00
include ( '../header.inc.php' );
$no_guess = true ;
/* This code makes sure the newer multi-domain supporting header.inc.php is being used */
if ( ! isset ( $phpgw_domain ))
{
echo 'Your using an old configuration file format...<br>' . " \n " ;
echo 'Importing old settings into the new format....<br>' . " \n " ;
}
else
{
2002-03-03 22:53:00 +01:00
if ( $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'header_version' ] != $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'current_header_version' ])
2001-08-21 20:48:50 +02:00
{
echo 'Your using an old header.inc.php version...<br>' . " \n " ;
echo 'Importing old settings into the new format....<br>' . " \n " ;
}
reset ( $phpgw_domain );
$default_domain = each ( $phpgw_domain );
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'default_domain' ] = $default_domain [ 0 ];
2001-08-21 20:48:50 +02:00
unset ( $default_domain ); // we kill this for security reasons
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_host' ] = $phpgw_domain [ $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'default_domain' ]][ 'db_host' ];
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_name' ] = $phpgw_domain [ $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'default_domain' ]][ 'db_name' ];
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_user' ] = $phpgw_domain [ $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'default_domain' ]][ 'db_user' ];
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_pass' ] = $phpgw_domain [ $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'default_domain' ]][ 'db_pass' ];
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_type' ] = $phpgw_domain [ $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'default_domain' ]][ 'db_type' ];
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'config_passwd' ] = $phpgw_domain [ $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'default_domain' ]][ 'config_passwd' ];
2001-08-21 20:48:50 +02:00
}
if ( defined ( 'PHPGW_SERVER_ROOT' ))
{
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'server_root' ] = PHPGW_SERVER_ROOT ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'include_root' ] = PHPGW_INCLUDE_ROOT ;
2001-08-21 20:48:50 +02:00
}
2002-03-03 22:53:00 +01:00
elseif ( ! isset ( $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'include_root' ]) && $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'header_version' ] <= 1.6 )
2001-08-21 20:48:50 +02:00
{
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'include_root' ] = $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'server_root' ];
2001-08-21 20:48:50 +02:00
}
2002-03-03 22:53:00 +01:00
elseif ( ! isset ( $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'header_version' ]) && $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'header_version' ] <= 1.6 )
2001-08-21 20:48:50 +02:00
{
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'include_root' ] = $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'server_root' ];
2001-08-21 20:48:50 +02:00
}
2001-07-30 17:59:25 +02:00
}
2001-08-21 20:48:50 +02:00
else
2001-07-30 17:59:25 +02:00
{
2001-08-21 20:48:50 +02:00
echo 'sample configuration not found. using built in defaults<br>' . " \n " ;
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'server_root' ] = '/path/to/phpgroupware' ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'include_root' ] = '/path/to/phpgroupware' ;
2002-01-08 03:12:43 +01:00
/* This is the basic include needed on each page for phpGroupWare application compliance */
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'flags' ][ 'htmlcompliant' ] = True ;
2002-01-08 03:12:43 +01:00
/* These are the settings for the database system */
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_host' ] = 'localhost' ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_name' ] = 'phpgroupware' ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_user' ] = 'phpgroupware' ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_pass' ] = 'your_password' ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_type' ] = 'mysql' ; //mysql, pgsql (for postgresql), or oracle
2001-07-30 17:59:25 +02:00
/* These are a few of the advanced settings */
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_persistent' ] = True ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'config_passwd' ] = 'changeme' ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'mcrypt_enabled' ] = False ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'mcrypt_version' ] = '2.6.3' ;
2001-07-30 17:59:25 +02:00
2001-08-21 20:48:50 +02:00
srand (( double ) microtime () * 1000000 );
$random_char = array (
'0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' ,
2001-07-30 17:59:25 +02:00
'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' ,
'w' , 'x' , 'y' , 'z' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' ,
'M' , 'N' , 'O' , 'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' , 'X' , 'Y' , 'Z' );
2001-08-21 20:48:50 +02:00
for ( $i = 0 ; $i < 30 ; $i ++ )
{
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'mcrypt_iv' ] .= $random_char [ rand ( 1 , count ( $random_char ))];
2001-08-21 20:48:50 +02:00
}
2001-07-30 17:59:25 +02:00
}
// now guessing better settings then the default ones
2001-08-21 20:48:50 +02:00
if ( ! $no_guess )
{
echo 'Now guessing better values for defaults <br>' . " \n " ;
$this_dir = dirname ( $SCRIPT_FILENAME );
$updir = ereg_replace ( '/setup' , '' , $this_dir );
2002-03-03 22:53:00 +01:00
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'server_root' ] = $updir ;
$GLOBALS [ 'phpgw_info' ][ 'server' ][ 'include_root' ] = $updir ;
2001-08-21 20:48:50 +02:00
}
2001-07-30 17:59:25 +02:00
?>
</ td ></ tr >
2001-08-21 20:48:50 +02:00
< tr bgcolor = " 486591 " >< th colspan = " 2 " >< font color = " fefefe " > Settings </ font ></ th ></ tr >
< form action = " manageheader.php " method = " post " >
< input type = " hidden " name = " setting[write_config] " value = " true " >
2002-03-03 22:53:00 +01:00
< tr >< td colspan = " 2 " >< b > Server Root </ b >< br >< input type = " text " name = " setting[server_root] " size = " 80 " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['server_root'] ?> " ></ td ></ tr >
< tr >< td colspan = " 2 " >< b > Include Root ( this should be the same as Server Root unless you know what you are doing ) </ b >< br >< input type = " text " name = " setting[include_root] " size = " 80 " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['include_root'] ?> " ></ td ></ tr >
< tr >< td colspan = " 2 " >< b > Admin password to header manager </ b >< br >< input type = " text " name = " setting[HEADER_ADMIN_PASSWORD] " size = " 80 " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['header_admin_password'] ?> " ></ td ></ tr >
2001-07-30 17:59:25 +02:00
< br >< br >
2002-03-03 22:53:00 +01:00
< tr >< td >< b > DB Host </ b >< br >< input type = " text " name = " setting[db_host] " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['db_host'] ?> " ></ td >< td > Hostname / IP of Databaseserver </ td ></ tr >
< tr >< td >< b > DB Name </ b >< br >< input type = " text " name = " setting[db_name] " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['db_name'] ?> " ></ td >< td > Name of Database </ td ></ tr >
< tr >< td >< b > DB User </ b >< br >< input type = " text " name = " setting[db_user] " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['db_user'] ?> " ></ td >< td > Name of DB User as phpgroupware has to connect as </ td ></ tr >
< tr >< td >< b > DB Password </ b >< br >< input type = " text " name = " setting[db_pass] " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['db_pass'] ?> " ></ td >< td > Password of DB User </ td ></ tr >
2001-07-30 17:59:25 +02:00
< tr >< td >< b > DB Type </ b >< br >< select name = " setting[db_type] " >
< ? php
2001-08-21 20:48:50 +02:00
$selected = '' ;
2001-07-30 17:59:25 +02:00
$found_dbtype = false ;
while ( list ( $k , $v ) = each ( $supported_db ))
{
2002-03-03 22:53:00 +01:00
if ( $v == $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_type' ])
2001-07-30 17:59:25 +02:00
{
2001-08-21 20:48:50 +02:00
$selected = ' selected ' ;
2001-07-30 17:59:25 +02:00
$found_dbtype = true ;
}
else
{
2001-08-21 20:48:50 +02:00
$selected = '' ;
2001-07-30 17:59:25 +02:00
}
2001-08-21 20:48:50 +02:00
print '<option ' . $selected . ' value="' . $v . '">' . $v . " \n " ;
2001-07-30 17:59:25 +02:00
}
?>
</ select >
2002-01-02 16:47:54 +01:00
</ td >< td > What Database do you want to use with PHPGroupWare ? </ td ></ tr >
2001-07-30 17:59:25 +02:00
2002-03-03 22:53:00 +01:00
< tr >< td >< b > Configuration Password </ b >< br >< input type = text name = " setting[config_pass] " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['config_passwd'] ?> " ></ td >< td > Password needed for configuration </ td ></ tr >
2001-09-17 04:06:12 +02:00
< tr >< td >< b > Persistent connection </ b >< br >
< select type = " checkbox " name = " setting[db_persistent] " >
2002-03-03 22:53:00 +01:00
< option value = " True " < ? php echo ( $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_persistent' ] ? ' selected' : '' ); ?> >True</option>
< option value = " False " < ? php echo ( ! $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_persistent' ] ? ' selected' : '' ); ?> >False</option>
2002-01-08 03:12:43 +01:00
</ select ></ td >
< td > Do you want persistent connections ( higher performance , but eats memory ) </ td ></ tr >
2002-01-02 16:47:54 +01:00
2002-01-02 16:53:08 +01:00
< tr >< td >< b > Sessions Type </ b >< br >< select name = " setting[sessions_type] " >
2002-01-02 16:47:54 +01:00
< ? php
$selected = '' ;
while ( list ( $k , $v ) = each ( $supported_sessions_type ))
{
2002-03-03 22:53:00 +01:00
if ( $v == $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'sessions_type' ])
2002-01-02 16:47:54 +01:00
{
$selected = ' selected ' ;
}
else
{
$selected = '' ;
}
print '<option ' . $selected . ' value="' . $v . '">' . $v . " \n " ;
}
?>
</ select >
2002-01-02 16:55:09 +01:00
</ td >< td > What sessions management type do you want to use ( PHP4 session management often performs better ) ? </ td ></ tr >
2001-07-30 17:59:25 +02:00
< tr >< td colspan = 2 >< b > Enable MCrypt </ b >< br >
< select name = " setting[enable_mcrypt] " >
2002-03-03 22:53:00 +01:00
< ? php if ( $GLOBALS [ 'phpgw_info' ][ " server " ][ " mcrypt_enabled " ] == True ) { ?>
2001-08-21 20:48:50 +02:00
< option value = " True " selected > True
< option value = " False " > False
2001-07-30 17:59:25 +02:00
< ? php } else { ?>
2001-08-21 20:48:50 +02:00
< option value = " True " > True
< option value = " False " selected > False
2001-07-30 17:59:25 +02:00
< ? php } ?>
</ select >
</ td ></ tr >
2002-03-03 22:53:00 +01:00
< tr >< td >< b > MCrypt version </ b >< br >< input type = " text " name = " setting[mcrypt_version] " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['versions']['mcrypt'] ?> " ></ td >< td > Set this to " old " for versions & lt ; 2.4 , otherwise the exact mcrypt version you use </ td ></ tr >
< tr >< td >< b > MCrypt initilazation vector </ b >< br >< input type = " text " name = " setting[mcrypt_iv] " value = " <?php echo $GLOBALS['phpgw_info'] ['server']['mcrypt_iv'] ?> " size = " 30 " ></ td >< td > It should be around 30 bytes in length .< br > Note : The default has been randomly generated .</ td ></ tr >
2001-07-30 17:59:25 +02:00
< tr >< td >< b > Domain select box on login </ b >< br >
< select name = " setting[domain_selectbox] " >
2002-03-03 22:53:00 +01:00
< option value = " True " < ? php echo ( $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'domain_selectbox' ] ? ' selected' : '' ); ?> >True</option>
< option value = " False " < ? php echo ( ! $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'domain_selectbox' ] ? ' selected' : '' ); ?> >False</option>
2001-09-17 04:06:12 +02:00
</ select ></ td >< td >& nbsp ; </ td >
2001-07-30 17:59:25 +02:00
</ tr >
</ table >
< ? php
if ( ! $found_dbtype )
{
2002-03-03 22:53:00 +01:00
echo '<br><font color=red>Warning!<br>The db_type in defaults (' . $GLOBALS [ 'phpgw_info' ][ 'server' ][ 'db_type' ] . ') is not supported on this server. using first supported type.</font>' ;
2001-07-30 17:59:25 +02:00
}
echo " <br> " ;
if ( is_writeable ( '../header.inc.php' ) || ( ! file_exists ( '../header.inc.php' ) && is_writeable ( '../' )))
{
echo '<input type=submit name="action" value="write config">' ;
echo ' or <input type=submit name="action" value="download"> or <input type=submit name="action" value="view"> the file.</form>' ;
}
else
{
echo 'Cannot create the header.inc.php due to file permission restrictions.<br> Instead you can ' ;
echo '<input type=submit name="action" value="download">or <input type=submit name="action" value="view"> the file.</form>' ;
}
echo '<form action="index.php" method=post>' ;
echo '<br> After retrieving the file put it into place as the header.inc.php, then click continue.<br>' ;
echo '<input type=hidden name="FormLogout" value="header">' ;
2001-08-21 20:48:50 +02:00
//echo '<input type=hidden name="FormLogout" value="config">';
//echo '<input type=hidden name="ConfigLogin" value="Login">';
2002-03-03 22:53:00 +01:00
//echo '<input type=hidden name="FormPW" value="'.$phpgw_domain[$GLOBALS['phpgw_info']["server"]["default_domain"]]["config_passwd"].'">';
//echo '<input type=hidden name="FormDomain" value="'.$GLOBALS['phpgw_info']["server"]["default_domain"].'">';
2001-07-30 17:59:25 +02:00
echo '<input type=submit name="junk" value="continue">' ;
echo '</form>' ;
echo '</body>' ;
echo '</html>' ;
break ; // ending the switch default
2001-08-21 20:48:50 +02:00
}
2001-07-30 17:59:25 +02:00
?>