True, 'nonavbar' => True, 'currentapp' => 'home', 'noapi' => True ); include('./inc/functions.inc.php'); include('../phpgwapi/setup/setup.inc.php'); $phpgw_info['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header']; unset($setup_info); #include('../version.inc.php'); function check_form_values() { global $setting, $phpgw_setup; if (! $setting['config_pass']) { $errors .= "
You didn't enter a config password"; } if (! $setting['HEADER_ADMIN_PASSWORD']) { $errors .= "
You didn't enter a header admin password"; } if ($errors) { $phpgw_setup->show_header('Error',True); echo $errors; exit; } } /* authentication phase */ $phpgw_info['setup']['stage']['header'] = $phpgw_setup->check_header(); // added these to let the app work, need to templatize still $tpl_root = $phpgw_setup->setup_tpl_dir('setup'); $setup_tpl = CreateObject('phpgwapi.Template',$tpl_root); $setup_tpl->set_file(array( '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' )); $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'); switch($phpgw_info['setup']['stage']['header']) { case '1': $phpgw_info['setup']['HeaderFormMSG'] = 'Create your header.inc.php'; $phpgw_info['setup']['PageMSG'] = 'You have not created your header.inc.php yet!
You can create it now.'; break; case '2': $phpgw_info['setup']['HeaderFormMSG'] = 'Your header admin password is NOT set. Please set it now!'; $phpgw_info['setup']['PageMSG'] = 'Your header admin password is NOT set. Please set it now!'; break; case '3': $phpgw_info['setup']['HeaderFormMSG'] = 'Your header.inc.php needs upgrading.'; $phpgw_info['setup']['PageMSG'] = 'Your header.inc.php needs upgrading.
WARNING!
If you are using virtual domain support, this will NOT copy those domains over. You will need to do this manually, MAKE BACKUPS!'; $phpgw_info['setup']['HeaderLoginMSG'] = 'Your header.inc.php needs upgrading.'; if (!$phpgw_setup->auth('Header')) { $phpgw_setup->show_header('Please login',True); $phpgw_setup->login_form(); exit; } break; case '10': if (!$phpgw_setup->auth('Header')) { $phpgw_setup->show_header('Please login',True); $phpgw_setup->login_form(); exit; } $phpgw_info['setup']['HeaderFormMSG'] = 'Edit your header.inc.php'; $phpgw_info['setup']['PageMSG'] = 'Edit your existing header.inc.php'; break; } switch($action) { case 'download': check_form_values(); $header_template = new Template('../'); header('Content-disposition: attachment; filename="header.inc.php"'); header('Content-type: application/octet-stream'); header('Pragma: no-cache'); header('Expires: 0'); $newheader = $phpgw_setup->generate_header(); echo $newheader; break; case 'view': check_form_values(); $header_template = new Template('../'); $phpgw_setup->show_header('Generated header.inc.php', False, 'header'); echo '
Save this text as contents of your header.inc.php

'; $newheader = $phpgw_setup->generate_header(); echo '
';
			echo htmlentities($newheader);
			echo '

'; echo '
'; echo '
After retrieving the file put it into place as the header.inc.php, then click continue.
'; echo ''; echo ''; echo '
'; echo ''; break; case 'write config': check_form_values(); $header_template = new Template('../'); if(is_writeable ('../header.inc.php')|| (!file_exists ('../header.inc.php') && is_writeable ('../'))) { $newheader = $phpgw_setup->generate_header(); $fsetup = fopen('../header.inc.php','wb'); fwrite($fsetup,$newheader); fclose($fsetup); $phpgw_setup->show_header('Saved header.inc.php', False, 'header'); echo '
'; echo '
Created header.inc.php! '; echo ''; echo ''; echo '
'; echo ''; break; } else { $phpgw_setup->show_header('Error generating header.inc.php', False, 'header'); echo 'Could not open header.inc.php for writing!
' . "\n"; echo 'Please check read/write permissions on directories or back up and use another option.
'; echo ''; } break; default: $phpgw_setup->show_header($phpgw_info['setup']['HeaderFormMSG'], False, 'header'); echo $phpgw_info['setup']['PageMSG']; /* echo ''; echo ' '; echo '
Analysis
'; */ echo ''; echo '
Analysis
'; // Hardly try to find what DB-support is compiled in // this dont work with PHP 3.0.10 and lower ! $supported_db = array(); if (extension_loaded('mysql') || function_exists('mysql_connect')) { echo 'You appear to have MySQL support enabled
' . "\n"; $supported_db[] = 'mysql'; } else { echo 'No MySQL support found. Disabling
' . "\n"; } if (extension_loaded('pgsql') || function_exists('pg_connect')) { echo 'You appear to have Postgres-DB support enabled
' . "\n"; $supported_db[] = 'pgsql'; } else { echo 'No Postgres-DB support found. Disabling
' . "\n"; } if (extension_loaded('mssql') || function_exists('mssql_connect')) { echo 'You appear to have Microsoft SQL Server support enabled
' . "\n"; $supported_db[] = 'mssql'; } else { echo 'No Microsoft SQL Server support found. Disabling
' . "\n"; } if (extension_loaded('oci8')) { echo 'You appear to have Oracle V8 (OCI) support enabled
' . "\n"; $supported_db[] = 'oracle'; } else { if(extension_loaded('oracle')) { echo 'You appear to have Oracle support enabled
' . "\n"; $supported_db[] = 'oracle'; } else { echo 'No Oracle-DB support found. Disabling
' . "\n"; } } if(!count($supported_db)) { echo '

did not found any valid DB support !
try to configure your php to support one of the above mentioned dbs or install phpgroupware by hand

'; exit; } $no_guess = false; if(file_exists('../header.inc.php') && is_file('../header.inc.php')) { echo 'Found existing configuration file. Loading settings from the file...
' . "\n"; $phpgw_info['flags']['noapi'] = True; 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...
' . "\n"; echo 'Importing old settings into the new format....
' . "\n"; } else { if ($phpgw_info['server']['header_version'] != $phpgw_info['server']['current_header_version']) { echo 'Your using an old header.inc.php version...
' . "\n"; echo 'Importing old settings into the new format....
' . "\n"; } reset($phpgw_domain); $default_domain = each($phpgw_domain); $phpgw_info['server']['default_domain'] = $default_domain[0]; unset ($default_domain); // we kill this for security reasons $phpgw_info['server']['db_host'] = $phpgw_domain[$phpgw_info['server']['default_domain']]['db_host']; $phpgw_info['server']['db_name'] = $phpgw_domain[$phpgw_info['server']['default_domain']]['db_name']; $phpgw_info['server']['db_user'] = $phpgw_domain[$phpgw_info['server']['default_domain']]['db_user']; $phpgw_info['server']['db_pass'] = $phpgw_domain[$phpgw_info['server']['default_domain']]['db_pass']; $phpgw_info['server']['db_type'] = $phpgw_domain[$phpgw_info['server']['default_domain']]['db_type']; $phpgw_info['server']['config_passwd'] = $phpgw_domain[$phpgw_info['server']['default_domain']]['config_passwd']; } if (defined('PHPGW_SERVER_ROOT')) { $phpgw_info['server']['server_root'] = PHPGW_SERVER_ROOT; $phpgw_info['server']['include_root'] = PHPGW_INCLUDE_ROOT; } elseif (!isset($phpgw_info['server']['include_root']) && $phpgw_info['server']['header_version'] <= 1.6) { $phpgw_info['server']['include_root'] = $phpgw_info['server']['server_root']; } elseif (!isset($phpgw_info['server']['header_version']) && $phpgw_info['server']['header_version'] <= 1.6) { $phpgw_info['server']['include_root'] = $phpgw_info['server']['server_root']; } } else { echo 'sample configuration not found. using built in defaults
' . "\n"; $phpgw_info['server']['server_root'] = '/path/to/phpgroupware'; $phpgw_info['server']['include_root'] = '/path/to/phpgroupware'; /* This is the basic include needed on each page for phpGroupWare application compliance */ $phpgw_info['flags']['htmlcompliant'] = True; /* These are the settings for the database system */ $phpgw_info['server']['db_host'] = 'localhost'; $phpgw_info['server']['db_name'] = 'phpgroupware'; $phpgw_info['server']['db_user'] = 'phpgroupware'; $phpgw_info['server']['db_pass'] = 'your_password'; $phpgw_info['server']['db_type'] = 'mysql'; //mysql, pgsql (for postgresql), or oracle /* These are a few of the advanced settings */ $phpgw_info['server']['db_persistent'] = True; $phpgw_info['server']['config_passwd'] = 'changeme'; $phpgw_info['server']['mcrypt_enabled'] = False; $phpgw_info['server']['mcrypt_version'] = '2.6.3'; srand((double)microtime()*1000000); $random_char = array( '0','1','2','3','4','5','6','7','8','9','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','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'); for ($i=0; $i<30; $i++) { $phpgw_info['server']['mcrypt_iv'] .= $random_char[rand(1,count($random_char))]; } } // now guessing better settings then the default ones if(!$no_guess) { echo 'Now guessing better values for defaults
' . "\n"; $this_dir = dirname($SCRIPT_FILENAME); $updir = ereg_replace('/setup','',$this_dir); $phpgw_info['server']['server_root'] = $updir; $phpgw_info['server']['include_root'] = $updir; } ?> Settings
Server Root
Include Root (this should be the same as Server Root unless you know what you are doing)
Admin password to header manager


DB Host
Hostname/IP of Databaseserver DB Name
Name of Database DB User
Name of DB User as phpgroupware has to connect as DB Password
Password of DB User DB Type
What Database do you want to use with PHPGroupWare? Configuration Password
Password needed for configuration Persistent connection
Do you want persistent connections (higher performance, but eats memory) Enable MCrypt
MCrypt version
Set this to "old" for versions < 2.4, otherwise the exact mcrypt version you use MCrypt initilazation vector
It should be around 30 bytes in length.
Note: The default has been randomly generated. Domain select box on login
  Warning!
The db_type in defaults ('.$phpgw_info['server']['db_type'].') is not supported on this server. using first supported type.
'; } echo "
"; if(is_writeable ('../header.inc.php')|| (!file_exists ('../header.inc.php') && is_writeable ('../'))) { echo ''; echo ' or or the file.
'; } else { echo 'Cannot create the header.inc.php due to file permission restrictions.
Instead you can '; echo 'or the file.'; } echo '
'; echo '
After retrieving the file put it into place as the header.inc.php, then click continue.
'; echo ''; //echo ''; //echo ''; //echo ''; //echo ''; echo ''; echo '
'; echo ''; echo ''; break; // ending the switch default } ?>