home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / install.php < prev    next >
PHP Script  |  2004-03-08  |  53KB  |  1,803 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11.  
  12. This function creates a Group-Office.php file from the template Group-Office.tpl and fills it with values from a $GO_CONFIG object
  13. */
  14.  
  15. function save_config($config)
  16. {
  17.     $fp = fopen($config->root_path.'Group-Office.tpl', 'r');
  18.     $config_data = fread($fp, filesize($config->root_path.'Group-Office.tpl'));
  19.     fclose($fp);
  20.  
  21.     $config_data = str_replace('%title%', $config->title, $config_data);
  22.     $config_data = str_replace('%slash%', $config->slash, $config_data);
  23.     $config_data = str_replace('%host%', $config->host, $config_data);
  24.     $config_data = str_replace('%full_url%', $config->full_url, $config_data);
  25.     $config_data = str_replace('%root_path%', $config->root_path, $config_data);
  26.     $config_data = str_replace('%language%', $config->language, $config_data);
  27.     $timezone = (isset($config->timezone_offset) && $config->timezone_offset != '') ? $config->timezone_offset : '0';
  28.     $config_data = str_replace('%timezone_offset%', $timezone, $config_data);
  29.     $first_weekday = (isset($config->first_weekday) && $config->first_weekday != '') ? $config->first_weekday : '0';
  30.     $config_data = str_replace('%first_weekday%', $first_weekday, $config_data);
  31.     $config_data = str_replace('%tmpdir%', $config->tmpdir, $config_data);
  32.     $config_data = str_replace('%theme%', $config->theme, $config_data);
  33.  
  34.     $allow_themes = ($config->allow_themes === true) ? 'true' : 'false';
  35.     $config_data = str_replace('%allow_themes%', $allow_themes, $config_data);
  36.  
  37.     $allow_password_change = ($config->allow_password_change === true) ? 'true' : 'false';
  38.     $config_data = str_replace('%allow_password_change%', $allow_password_change, $config_data);
  39.  
  40.     $enable_system_accounts = ($config->enable_system_accounts === true) ? 'true' : 'false';
  41.     $config_data = str_replace('%enable_system_accounts%', $enable_system_accounts, $config_data);
  42.  
  43.     $enable_samba_accounts = ($config->enable_samba_accounts === true) ? 'true' : 'false';
  44.     $config_data = str_replace('%enable_samba_accounts%', $enable_samba_accounts, $config_data);
  45.     $config_data = str_replace('%smtp_server%', $config->smtp_server, $config_data);
  46.     $config_data = str_replace('%smtp_port%', $config->smtp_port, $config_data);
  47.     $config_data = str_replace('%max_attachment_size%', $config->max_attachment_size, $config_data);
  48.     $config_data = str_replace('%inmail_host%', $config->inmail_host, $config_data);
  49.     $config_data = str_replace('%inmail_port%', $config->inmail_port, $config_data);
  50.     $config_data = str_replace('%inmail_type%', $config->inmail_type, $config_data);
  51.     $config_data = str_replace('%inmail_root%', $config->inmail_root, $config_data);
  52.     $config_data = str_replace('%local_email_host%', $config->local_email_host, $config_data);
  53.     $config_data = str_replace('%file_storage_path%', $config->file_storage_path, $config_data);
  54.     $config_data = str_replace('%email_connectstring_options%', $config->email_connectstring_options, $config_data);
  55.  
  56.     if (!is_string($config->create_mode))
  57.     {
  58.         $config->create_mode = decoct((string)$config->create_mode);
  59.     }
  60.     if (strlen($config->create_mode) == 3)
  61.     {
  62.         $config->create_mode = '0'.$config->create_mode;
  63.     }
  64.     $config_data = str_replace('%create_mode%', $config->create_mode, $config_data);
  65.     $config_data = str_replace('%max_file_size%', $config->max_file_size, $config_data);
  66.     $config_data = str_replace('%webmaster_email%', $config->webmaster_email, $config_data);
  67.     $config_data = str_replace('%db_type%', $config->db_type, $config_data);
  68.     $config_data = str_replace('%db_host%', $config->db_host, $config_data);
  69.     $config_data = str_replace('%db_name%', $config->db_name, $config_data);
  70.     $config_data = str_replace('%db_user%', $config->db_user, $config_data);
  71.     $config_data = str_replace('%db_pass%', $config->db_pass, $config_data);
  72.  
  73.     $config_data = str_replace('%auth_db_type%', $config->auth_db_type, $config_data);
  74.     $config_data = str_replace('%auth_db_host%', $config->auth_db_host, $config_data);
  75.     $config_data = str_replace('%auth_db_user%', $config->auth_db_user, $config_data);
  76.     $config_data = str_replace('%auth_db_pass%', $config->auth_db_pass, $config_data);
  77.     $config_data = str_replace('%auth_db_ldap_um%', $config->auth_db_ldap_um, $config_data);
  78.     $config_data = str_replace('%auth_db_ldap_basedn%', $config->auth_db_ldap_basedn, $config_data);
  79.     $config_data = str_replace('%auth_db_ldap_peopledn%', $config->auth_db_ldap_peopledn, $config_data);
  80.     $config_data = str_replace('%auth_db_ldap_groupsdn%', $config->auth_db_ldap_groupsdn, $config_data);
  81.  
  82.     if (!$fp = fopen($config->root_path.'Group-Office.php', 'w+'))
  83.     {
  84.         exit("Failed to open config file");
  85.     }elseif(!fwrite($fp, $config_data))
  86.     {
  87.         exit("Failed to write to config file");
  88.     }else
  89.     {
  90.         return fclose($fp);
  91.     }
  92.  
  93. }
  94. /*
  95. This function gets all queries from an SQL dump file in an array
  96. */
  97.  
  98. function get_sql_queries($file)
  99. {
  100.     $sql ='';
  101.     $queries=array();
  102.     if($handle = fopen ($file, "r"))
  103.     {
  104.         while (!feof ($handle))
  105.         {
  106.             $buffer = trim(fgets($handle, 4096));
  107.             if($buffer != '' && strpos($buffer, '#') === false)
  108.             {
  109.                    $sql .= $buffer;
  110.             }
  111.         }
  112.         fclose ($handle);
  113.     }else
  114.     {
  115.         die("could not read SQL dump file $file!");
  116.     }
  117.     $length = strlen($sql);
  118.     $in_string=false;
  119.     $start = 0;
  120.     $escaped = false;
  121.     for ($i=0;$i<$length;$i++)
  122.     {
  123.         $char = $sql[$i];
  124.         if ($char == '\'' && !$escaped)
  125.         {
  126.             $in_string = !$in_string;
  127.         }
  128.         if ($char == ';' && !$in_string)
  129.         {
  130.             $offset = $i - $start;
  131.             $queries[] = substr($sql, $start, $offset);
  132.             $start = $i+1;
  133.         }
  134.         if ($char == '\\')
  135.         {
  136.             $escaped = true;
  137.         }else
  138.         {
  139.             $escaped = false;
  140.         }
  141.  
  142.     }
  143.     return $queries;
  144. }
  145.  
  146. function print_head()
  147. {
  148.     echo '<html><head><title>Group-Office Installation</title></head><body style="font-family: Arial,Helvetica">';
  149.     echo '<form method="post" action="install.php">';
  150.     echo '<table style="background: buttonface;border-width: 1px;border-color: black;border-style: solid;font-family: Arial,Helvetica; font-size: 12px; width: 500px;"><tr><td>';
  151.     echo '<table style="border-width: 0px;padding: 20px;font-family: Arial,Helvetica; width: 500px;font-weight: normal; font-size: 12px;"><tr><td><b><h2>Group-Office installation</h2>';
  152. }
  153.  
  154. function print_foot()
  155. {
  156.     echo '</td></tr></table></td></tr></table></form>
  157.  
  158.     <script type="text/javascript">
  159.     function delete_database()
  160.     {
  161.         if (confirm("Are you sure you want to delete all Group-Office users and data?"))
  162.         {
  163.             document.forms[0].upgrade.value="false";
  164.             document.forms[0].submit();
  165.         }
  166.  
  167.     }
  168.     function change_port()
  169.     {
  170.         if (document.forms[0].inmail_type.value == "imap")
  171.         {
  172.             document.forms[0].inmail_port.value = "143";
  173.         }else
  174.         {
  175.             document.forms[0].inmail_port.value = "110";
  176.         }
  177.     }
  178.     </script>
  179.  
  180.     </body></html>';
  181. }
  182.  
  183. //destroy session when user closes browser
  184. ini_set('session.cookie_lifetime','0');
  185.  
  186. //@session_start();
  187.  
  188. //get the path of this script
  189. if ($_SERVER['SCRIPT_FILENAME'] != '')
  190. {
  191.     $script_path = stripslashes($_SERVER['SCRIPT_FILENAME']);
  192. }else
  193. {
  194.     $script_path = stripslashes($_SERVER['PATH_TRANSLATED']);
  195. }
  196. if ($script_path == '')
  197. {
  198.     print_head();
  199.     echo '<b>Fatal error:</b> Could not get the path of the this script. The server variable \'SCRIPT_FILENAME\' and \'PATH_TRANSLATED\' are not set.';
  200.     echo '<br /><br />Correct this and refresh this page. If you are not able to correct this try the manual installation described in the file \'INSTALL\'';
  201.     print_foot();
  202.     exit();
  203. }
  204.  
  205. //the root_path of Group-Office is the path of this script without install.php
  206. $root_path = str_replace('install.php', '',$script_path);
  207.  
  208. //check ifconfig exists and if the config file is writable
  209. $config_exists = file_exists('Group-Office.php');
  210. if ($config_exists && !is_writable('Group-Office.php'))
  211. {
  212.     print_head();
  213.     echo 'The configuration file Group-Office.php exists in '.$root_path.' but is not writable. If you wish to make changes then you have to make Group-Office.php writable during the configuration process.';
  214.     echo '<br /><br />Correct this and refresh this page.';
  215.     echo '<br /><br /><font color="#003399"><i>$ chmod 777 '.$root_path.'Group-Office.php<br /></i></font>';
  216.     print_foot();
  217.     exit();
  218. }elseif(!$config_exists && !is_writable($root_path))
  219. {
  220.     print_head();
  221.     echo 'Can\'t create configuration file in '.$root_path.'. If you wish to install Group-Office you have to make '.$root_path.' temporarily writable.';
  222.     echo '<br /><br />Correct this and refresh this page.';
  223.     echo '<br /><br /><font color="#003399"><i>$ chmod 777 '.$root_path.'<br /></i></font>';
  224.     print_foot();
  225.     exit();
  226. }
  227.  
  228. //if we can write and config file doesn't exist create a default config file
  229. if (!$config_exists)
  230. {
  231.     $tpl_file = str_replace('install.php', 'Group-Office.tpl',$script_path);
  232.     $GO_CONFIG_file = str_replace('install.php', 'Group-Office.php',$script_path);
  233.     $fp = fopen($tpl_file, 'r');
  234.     $config_data = fread($fp, filesize($tpl_file));
  235.     fclose($fp);
  236.  
  237.     $config_data = str_replace('%title%', 'Group-Office', $config_data);
  238.     $config_data = str_replace('%slash%', '/', $config_data);
  239.  
  240.     $host= substr(str_replace($_SERVER['DOCUMENT_ROOT'],"",$root_path),0,-1);
  241.     $full_url = 'http://'.$_SERVER['HTTP_HOST'].$host;
  242.  
  243.     $config_data = str_replace('%host%', $host, $config_data);
  244.     $config_data = str_replace('%full_url%', $full_url, $config_data);
  245.     $config_data = str_replace('%root_path%', addslashes($root_path), $config_data);
  246.     $config_data = str_replace('%language%', 'Nederlands', $config_data);
  247.     $timezone_offset = "0";
  248.     $config_data = str_replace('%timezone_offset%', $timezone_offset, $config_data);
  249.     $config_data = str_replace('%first_weekday%', '1', $config_data);
  250.     $config_data = str_replace('%tmpdir%', '/tmp/', $config_data);
  251.     $config_data = str_replace('%theme%', 'crystal', $config_data);
  252.     $config_data = str_replace('%allow_themes%', 'true', $config_data);
  253.     $config_data = str_replace('%allow_password_change%', 'true', $config_data);
  254.     $config_data = str_replace('%enable_system_accounts%', 'false', $config_data);
  255.     $config_data = str_replace('%enable_samba_accounts%', 'false', $config_data);
  256.     $config_data = str_replace('%smtp_server%', '', $config_data);
  257.     $config_data = str_replace('%smtp_port%', '', $config_data);
  258.     $config_data = str_replace('%max_attachment_size%', '10000000', $config_data);
  259.     $config_data = str_replace('%inmail_host%', 'example.com', $config_data);
  260.     $config_data = str_replace('%inmail_port%', '143', $config_data);
  261.     $config_data = str_replace('%inmail_type%', 'imap', $config_data);
  262.     $config_data = str_replace('%inmail_root%', '', $config_data);
  263.     $config_data = str_replace('%local_email_host%', 'localhost', $config_data);
  264.     $config_data = str_replace('%email_connectstring_options%', '', $config_data);
  265.  
  266.     $config_data = str_replace('%file_storage_path%', '/home/groupoffice', $config_data);
  267.     $config_data = str_replace('%create_mode%', '0755', $config_data);
  268.     $config_data = str_replace('%max_file_size%', '100000000', $config_data);
  269.     $config_data = str_replace('%webmaster_email%', 'webmaster@example.com', $config_data);
  270.     $config_data = str_replace('%db_type%', 'mysql', $config_data);
  271.     $config_data = str_replace('%db_host%', 'localhost', $config_data);
  272.     $config_data = str_replace('%db_name%', 'groupoffice', $config_data);
  273.     $config_data = str_replace('%db_user%', 'groupoffice', $config_data);
  274.     $config_data = str_replace('%db_pass%', '', $config_data);
  275.  
  276.     $config_data = str_replace('%auth_db_type%', 'sql', $config_data);
  277.     $config_data = str_replace('%auth_db_host%', 'localhost', $config_data);
  278.     $config_data = str_replace('%auth_db_user%', 'groupoffice', $config_data);
  279.     $config_data = str_replace('%auth_db_pass%', 'groupoffice', $config_data);
  280.     $config_data = str_replace('%auth_db_ldap_um%', '0', $config_data);
  281.     $config_data = str_replace('%auth_db_ldap_basedn%', 'dc=group-office,dc=sourceforge,dc=net', $config_data);
  282.     $config_data = str_replace('%auth_db_ldap_peopledn%', 'ou=People,dc=group-office,dc=sourceforge,dc=net', $config_data);
  283.     $config_data = str_replace('%auth_db_ldap_groupsdn%', 'ou=Groups,dc=group-office,dc=sourceforge,dc=net', $config_data);
  284.  
  285.     if (!$fp = fopen($GO_CONFIG_file, 'w+'))
  286.     {
  287.         exit("Failed to open config file");
  288.     }elseif(!fwrite($fp, $config_data))
  289.     {
  290.         exit("Failed to write to config file");
  291.     }else
  292.     {
  293.         fclose($fp);
  294.     }
  295. }
  296.  
  297. //config file exists now so require it to get the properies.
  298. require('Group-Office.php');
  299.  
  300. @session_start();
  301.  
  302. if ($_SERVER['REQUEST_METHOD'] =='POST')
  303. {
  304.     switch($_POST['task'])
  305.     {
  306.         case 'administrator':
  307.         $pass1=trim($_POST['pass1']);
  308.         $pass2=trim($_POST['pass2']);
  309.         $email=trim($_POST['email']);
  310.  
  311.         if ($pass1 == '')
  312.         {
  313.             $feedback = '<font color="red">Please enter a password!</font>';
  314.         }elseif( strlen($pass1) < 4)
  315.         {
  316.             $feedback = '<font color="red">Password can\'t be shorter then 4 characters!</font>';
  317.         }elseif($pass1 != $pass2)
  318.         {
  319.             $feedback = '<font color="red">Passwords did not match!</font>';
  320.         }elseif(!eregi("^([a-z0-9]+)([._-]([a-z0-9]+))*[@]([a-z0-9]+)([._-]([a-z0-9]+))*[.]([a-z0-9]){2}([a-z0-9])?$", $email))
  321.         {
  322.             $feedback = '<font color="red">Invalid E-mail address!</font>';
  323.         }else
  324.         {
  325.             require_once($GO_CONFIG->class_path.'users.class.inc');
  326.             $users = new users();
  327.  
  328.             $users->get_users();
  329.  
  330.             $acl_id = $GO_SECURITY->get_new_acl($email);
  331.             if ($acl_id != -1)
  332.             {
  333.                 $authcode = $users->random_password();
  334.                 $new_user_id = $users->add_user(
  335.                     'administrator',    // Username
  336.                     $pass1,            // Password
  337.                     '',    // First Name
  338.                     '',            // Middle Name
  339.                     '',            // Last Name
  340.                     '',            // Initials
  341.                     '',            // Title
  342.                     'M',            // Sex
  343.                     '',            // Birthday
  344.                     $email,            // eMail Address
  345.                     $authcode,        // Authcode
  346.                     '',            // Work Phone
  347.                     '',            // Home Phone
  348.                     '',            // Fax
  349.                     '',            // Cellular
  350.                     '',            // Country
  351.                     '',            // State
  352.                     '',            // City
  353.                     '',            // ZIP
  354.                     '',            // Address
  355.                     '',            // Company
  356.                     '',            // Work Country
  357.                     '',            // Work State
  358.                     '',            // Work City
  359.                     '',            // Work ZIP
  360.                     '',            // Work Address
  361.                     '',            // Work Fax
  362.                     '',            // Homepage
  363.                     '',            // Department
  364.                     '',            // Function
  365.                     '',            // Language
  366.                     '',            // Theme
  367.                     $acl_id            // ACL-ID
  368.                     );
  369.                 $old_umask = umask(000);
  370.                 mkdir($GO_CONFIG->file_storage_path.'administrator', $GO_CONFIG->create_mode);
  371.                 umask($old_umask);
  372.  
  373.                 require_once($GO_CONFIG->class_path."groups.class.inc");
  374.                 $groups = new groups();
  375.                 $groups->query("DELETE FROM db_sequence WHERE seq_name='groups'");
  376.                 $groups->query("DELETE FROM groups");
  377.  
  378.                 $group_id = $groups->add_group($new_user_id, 'Admins');
  379.                 $groups->add_user_to_group($new_user_id,$group_id);
  380.                 $group_id = $groups->add_group($new_user_id, 'Everyone');
  381.                 $groups->add_user_to_group($new_user_id,$group_id);
  382.                 $GO_SECURITY->add_group_to_acl($group_id, $acl_id);
  383.                 $_SESSION['completed']['administrator'] = true;
  384.  
  385.             }else
  386.             {
  387.                 $feedback = '<p><font color="red">Error while creating administrator</font></p>';
  388.             }
  389.         }
  390.         break;
  391.  
  392.         case 'license':
  393.             $_SESSION['completed']['license'] = true;
  394.         break;
  395.  
  396.         case 'release_notes':
  397.             $_SESSION['completed']['release_notes'] = true;
  398.         break;
  399.  
  400.         case 'database_connection':
  401.             $db = new db();
  402.             $db->Halt_On_Error = 'no';
  403.             if(@$db->connect($_POST['db_name'], $_POST['db_host'], $_POST['db_user'], $_POST['db_pass']))
  404.             {
  405.                 $GO_CONFIG->db_host = $_POST['db_host'];
  406.                 $GO_CONFIG->db_name = $_POST['db_name'];
  407.                 $GO_CONFIG->db_user = $_POST['db_user'];
  408.                 $GO_CONFIG->db_pass = $_POST['db_pass'];
  409.                 if (save_config($GO_CONFIG))
  410.                 {
  411.                     $_SESSION['completed']['database_connection'] = true;
  412.                 }
  413.  
  414.             }else
  415.             {
  416.                 $feedback ='<font color="red">Failed to connect to database</font>';
  417.             }
  418.         break;
  419.  
  420.         case 'database_structure':
  421.             $db = new db();
  422.             $db->Halt_On_Error = 'no';
  423.             if (!$db->connect($GO_CONFIG->db_name, $GO_CONFIG->db_host, $GO_CONFIG->db_user, $GO_CONFIG->db_pass))
  424.             {
  425.                 print_head();
  426.                 echo 'Can\'t connect to database!';
  427.                 echo '<br /><br />Correct this and refresh this page.';
  428.                 print_foot();
  429.                 exit();
  430.             }else
  431.             {
  432.                 if($_POST['upgrade'] == 'true')
  433.                 {
  434.                     $old_version = intval(str_replace('.', '', $_POST['db_version']));
  435.                     $new_version = intval(str_replace('.', '', $GO_CONFIG->version));
  436.                     require('lib/updates.inc');
  437.                     if (!isset($updates[$old_version]))
  438.                     {
  439.                         //invalid version, abort upgrade
  440.                         $feedback = '<font color="red">The version number you entered is invalid</font>';
  441.                     }else
  442.                     {
  443.                         for ($cur_ver=$old_version;$cur_ver<$new_version;$cur_ver++)
  444.                         {
  445.                             if (isset($updates[$cur_ver]))
  446.                             {
  447.                                 while($query = array_shift($updates[$cur_ver]))
  448.                                 {
  449.                                     //echo $query.'<br />';
  450.                                     @$db->query($query);
  451.                                 }
  452.                             }
  453.  
  454.                             if (file_exists($GO_CONFIG->root_path.'lib/scripts/'.$cur_ver.'.inc'))
  455.                             {
  456.                                 echo 'Running special update script for version '.$cur_ver.'...<br>';
  457.                                 require_once($GO_CONFIG->root_path.'lib/scripts/'.$cur_ver.'.inc');
  458.                             }
  459.                         }
  460.                         $db_version = $GO_CONFIG->version;
  461.                         $_SESSION['completed']['database_structure'] = true;
  462.                         //store the version number for future upgrades
  463.                         $GO_CONFIG->save_setting('version', $GO_CONFIG->version);
  464.                         //Upgrade completed
  465.                     }
  466.                 }else
  467.                 {
  468.                     //delete all existing users
  469.                     require_once($GO_CONFIG->class_path.'users.class.inc');
  470.                     $users = new users();
  471.                     $delete=new users();
  472.                     $users->get_users();
  473.                     while($users->next_record())
  474.                     {
  475.                         $delete->delete_user($users->f('id'));
  476.                     }
  477.  
  478.                     //create new empty database
  479.                     //table is empty create the structure
  480.                     $queries = get_sql_queries("lib/sql/groupoffice.sql");
  481.                     while ($query = array_shift($queries))
  482.                     {
  483.                         $db->query($query);
  484.                     }
  485.                     $queries = get_sql_queries("lib/sql/filetypes.sql");
  486.                     while ($query = array_shift($queries))
  487.                     {
  488.                         $db->query($query);
  489.                     }
  490.                     $queries = get_sql_queries("lib/sql/settings.sql");
  491.                     while ($query = array_shift($queries))
  492.                     {
  493.                         $db->query($query);
  494.                     }
  495.                     $queries = get_sql_queries("lib/sql/wiki.sql");
  496.  
  497.                     while ($query = array_shift($queries))
  498.                     {
  499.                         $db->query($query);
  500.                     }
  501.                     //store the version number for future upgrades
  502.                     $GO_CONFIG->save_setting('version', $GO_CONFIG->version);
  503.                     $db_version = $GO_CONFIG->version;
  504.                     $_SESSION['completed']['database_structure'] = true;
  505.                 }
  506.             }
  507.         break;
  508.  
  509.         case 'userdir':
  510.         if (!is_writable($_POST['userdir']))
  511.         {
  512.             $feedback = '<font color="red">The path you entered is not writable.<br />Please correct this and try again.</font>';
  513.         }else
  514.         {
  515.             if (substr($_POST['userdir'], -1) != '/') $_POST['userdir'] = $_POST['userdir'].'/';
  516.             $GO_CONFIG->file_storage_path=$_POST['userdir'];
  517.             $GO_CONFIG->create_mode=$_POST['create_mode'];
  518.             $GO_CONFIG->max_file_size=$_POST['max_file_size'];
  519.  
  520.             if (save_config($GO_CONFIG))
  521.             {
  522.                 $_SESSION['completed']['userdir'] = true;
  523.             }
  524.         }
  525.  
  526.         break;
  527.  
  528.         case 'tmpdir':
  529.         $tmpdir=$_POST['tmpdir'];
  530.         if (!is_writable($tmpdir))
  531.         {
  532.             $feedback = '<font color="red">The path you entered is not writable.<br />Please correct this and try again.</font>';
  533.         }else
  534.         {
  535.             if (substr($tmpdir, -1) != '/') $tmpdir = $tmpdir.'/';
  536.             $GO_CONFIG->tmpdir=$tmpdir;
  537.             if (save_config($GO_CONFIG))
  538.             {
  539.                 $_SESSION['completed']['tmpdir'] = true;
  540.             }
  541.         }
  542.  
  543.         break;
  544.  
  545.         case 'title':
  546.             if ($_POST['title'] == '')
  547.             {
  548.                 $feedback = 'You dind\'t enter a title.';
  549.  
  550.             }elseif(!eregi("^([a-z0-9]+)([._-]([a-z0-9]+))*[@]([a-z0-9]+)([._-]([a-z0-9]+))*[.]([a-z0-9]){2}([a-z0-9])?$", $_POST['webmaster_email']))
  551.             {
  552.                 $feedback = 'You entered an invalid e-mail address.';
  553.             }else
  554.             {
  555.                 $GO_CONFIG->webmaster_email = $_POST['webmaster_email'];
  556.                 $GO_CONFIG->title = $_POST['title'];
  557.                 if (save_config($GO_CONFIG))
  558.                 {
  559.                     $_SESSION['completed']['title'] = true;
  560.                 }
  561.             }
  562.         break;
  563.  
  564.         case 'url':
  565.             $host = trim($_POST['host']);
  566.             $full_url = trim($_POST['full_url']);
  567.             if ($host != '' && $full_url != '')
  568.             {
  569.                 if ($_POST['host'] != '/')
  570.                 {
  571.                     if (substr($_POST['host'] , -1) != '/') $_POST['host']  = $_POST['host'].'/';
  572.                     if (substr($_POST['host'] , 0, 1) != '/') $_POST['host']  = '/'.$_POST['host'];
  573.                 }
  574.  
  575.                 $GO_CONFIG->host = $_POST['host'];
  576.                 $GO_CONFIG->full_url = $_POST['full_url'];
  577.                 if (save_config($GO_CONFIG))
  578.                 {
  579.                     $_SESSION['completed']['url'] = true;
  580.                 }
  581.  
  582.             }else
  583.             {
  584.                 $feedback = '<font color="red">You dind\'t enter both fields.</font>';
  585.             }
  586.         break;
  587.  
  588.         case 'theme':
  589.             $GO_CONFIG->theme = $_POST['theme'];
  590.             $GO_CONFIG->allow_themes = ($_POST['allow_themes'] == 'true') ? true : false;
  591.             if (save_config($GO_CONFIG))
  592.             {
  593.                 $_SESSION['completed']['theme'] = true;
  594.             }
  595.         break;
  596.  
  597.         case 'language':
  598.  
  599.             $GO_CONFIG->language = $_POST['language'];
  600.             $GO_CONFIG->timezone_offset = $_POST['timezone_offset'];
  601.             $GO_CONFIG->first_weekday = $_POST['first_weekday'];
  602.             if (save_config($GO_CONFIG))
  603.             {
  604.                 $_SESSION['completed']['language'] = true;
  605.             }
  606.         break;
  607.  
  608.         case 'authentication_type':
  609.             $GO_CONFIG->auth_db_type = $_POST['auth_db_type'];
  610.             $GO_CONFIG->allow_password_change = ($_POST['allow_password_change'] == 'true') ? true : false;
  611.  
  612.             if ($GO_CONFIG->auth_db_type != "ldap" )
  613.             {
  614.                 $GO_CONFIG->auth_db_host = $GO_CONFIG->db_host;
  615.                 $GO_CONFIG->auth_db_user = $GO_CONFIG->db_user;
  616.                 $GO_CONFIG->auth_db_pass = $GO_CONFIG->db_pass;
  617.                 if (save_config($GO_CONFIG))
  618.                 {
  619.                     $_SESSION['completed']['authentication_type'] = true;
  620.                     $_SESSION['completed']['authentication_ldap'] = true;
  621.                 }
  622.             }else
  623.             {
  624.                 if (save_config($GO_CONFIG))
  625.                 {
  626.                     $_SESSION['completed']['authentication_type'] = true;
  627.                 }
  628.             }
  629.         break;
  630.  
  631.         case 'authentication_ldap':
  632.             $ldap = @ldap_connect($_POST['auth_db_host']);
  633.             if($ldap)
  634.             {
  635.                 $bind = @ldap_bind( $ldap, $_POST['auth_db_user'], $_POST['auth_db_pass']);
  636.                 if( $bind )
  637.                 {
  638.                     @ldap_unbind($bind);
  639.                     $GO_CONFIG->auth_db_host = $_POST['auth_db_host'];
  640.                     $GO_CONFIG->auth_db_user = $_POST['auth_db_user'];
  641.                     $GO_CONFIG->auth_db_pass = $_POST['auth_db_pass'];
  642.                     $GO_CONFIG->auth_db_ldap_um = $_POST['auth_db_ldap_um'];
  643.                     $GO_CONFIG->auth_db_ldap_basedn = $_POST['auth_db_ldap_basedn'];
  644.                     $GO_CONFIG->auth_db_ldap_peopledn = $_POST['auth_db_ldap_peopledn'];
  645.                     $GO_CONFIG->auth_db_ldap_groupsdn = $_POST['auth_db_ldap_groupsdn'];
  646.                     if (save_config($GO_CONFIG))
  647.                     {
  648.                         $_SESSION['completed']['authentication_ldap'] = true;
  649.                     }
  650.                 }else
  651.                 {
  652.                 $feedback ='<font color="red">Failed to bind to LDAP server</font>';
  653.                 }
  654.                 @ldap_close( $ldap );
  655.             }else
  656.             {
  657.                 $feedback ='<font color="red">Failed to connect to LDAP directory</font>';
  658.             }
  659.         break;
  660.  
  661.         case 'system_accounts':
  662.             $GO_CONFIG->enable_system_accounts = ($_POST['enable_system_accounts'] == 'true') ? true : false;
  663.  
  664.             if (!$GO_CONFIG->enable_system_accounts)
  665.             {
  666.                 //these options don't apply without system accounts and should be set
  667.                 //to false. They are skipped by the installer now
  668.                 $GO_CONFIG->enable_samba_accounts = false;
  669.                 $GO_CONFIG->enable_system_control = false;
  670.             }
  671.             if (save_config($GO_CONFIG))
  672.             {
  673.                 $_SESSION['completed']['system_accounts'] = true;
  674.             }
  675.         break;
  676.  
  677.         case 'samba_accounts':
  678.  
  679.             $GO_CONFIG->enable_samba_accounts = ($_POST['enable_samba_accounts'] == 'true') ? true : false;
  680.             if (save_config($GO_CONFIG))
  681.             {
  682.                 $_SESSION['completed']['samba_accounts'] = true;
  683.             }
  684.         break;
  685.  
  686.         case 'smtp':
  687.             $GO_CONFIG->smtp_port = $_POST['smtp_port'];
  688.             $GO_CONFIG->smtp_server= $_POST['smtp_server'];
  689.             $GO_CONFIG->max_attachment_size= $_POST['max_attachment_size'];
  690.             $GO_CONFIG->email_connectstring_options = $_POST['email_connectstring_options'];
  691.             if (save_config($GO_CONFIG))
  692.             {
  693.                 $_SESSION['completed']['smtp'] = true;
  694.             }
  695.         break;
  696.  
  697.         case 'local_email':
  698.             $GO_CONFIG->inmail_host = $_POST['inmail_host'];
  699.             $GO_CONFIG->inmail_port = $_POST['inmail_port'];
  700.             $GO_CONFIG->inmail_root = $_POST['inmail_root'];
  701.             $GO_CONFIG->local_email_host = $_POST['local_email_host'];
  702.             $GO_CONFIG->inmail_type = $_POST['inmail_type'];
  703.             if (save_config($GO_CONFIG))
  704.             {
  705.                 $_SESSION['completed']['local_email'] = true;
  706.             }
  707.         break;
  708.  
  709.         case 'send_info':
  710.             if ($_REQUEST['info'] != 'no')
  711.             {
  712.                 $body = "Group-Office title: ".$GO_CONFIG->title."\r\n";
  713.                 $body .= "Usage: ".$_REQUEST['info']."\r\n";
  714.                 $body .= "Users: ".$_REQUEST['users']."\r\n";
  715.                 $body .= "Host: ".$GO_CONFIG->full_url."\r\n";
  716.                 $body .= "Webmaster: ".$GO_CONFIG->webmaster_email."\r\n";
  717.                 if ($_REQUEST['email'] != '')
  718.                 {
  719.                     $body .= "Contact about Group-Office Professional at: ".$_REQUEST['email']."\r\n";
  720.                     $body .= "Name: ".$_REQUEST['name']."\r\n";
  721.                 }
  722.  
  723.                 sendmail('notify@intermesh.nl', $GO_CONFIG->webmaster_email, $GO_CONFIG->title, "Group-Office usage information", $body);
  724.             }
  725.             $_SESSION['completed']['send_info'] = true;
  726.         break;
  727.  
  728.     }
  729. }else
  730. {
  731.     unset($_SESSION);
  732. }
  733.  
  734. //Store all options in config array during install
  735. $_SESSION['completed'] = isset($_SESSION['completed']) ? $_SESSION['completed'] : array();
  736.  
  737. if (!isset($_SESSION['completed']['license']))
  738. {
  739.     if(file_exists('LICENSE.GPL'))
  740.     {
  741.         $license = 'LICENSE.GPL';
  742.     }else
  743.     {
  744.         $license = 'LICENSE.PRO';
  745.     }
  746.  
  747.     print_head();
  748.     echo '<input type="hidden" name="task" value="license" />';
  749.     echo 'Do you agree to the terms of the license agreement?<br /><br />';
  750.     echo '<iframe style="width: 670; height: 250; background: #ffffff;" src="'.$license.'"></iframe>';
  751.     echo '<br /><br /><input type="submit" value="I agree to these terms" />';
  752.     print_foot();
  753.     exit();
  754. }
  755.  
  756.  
  757. if (!isset($_SESSION['completed']['release_notes']))
  758. {
  759.     print_head();
  760.     echo '<input type="hidden" name="task" value="release_notes" />';
  761.     echo 'Please read the release notes<br /><br />';
  762.     echo '<iframe style="width: 670; height: 250; background: #ffffff;" src="RELEASE"></iframe>';
  763.     echo '<br /><br /><input type="submit" value="Continue" />';
  764.     print_foot();
  765.     exit();
  766. }
  767.  
  768.  
  769. //Get the database parameters first
  770. //if option database_connection is set then we have succesfully set up database
  771. if (!isset($_SESSION['completed']['database_connection']))
  772. {
  773.     print_head();
  774.     if (isset($feedback))
  775.     {
  776.         echo $feedback.'<br /><br />';
  777.     }
  778.     ?>
  779.     <input type="hidden" name="task" value="database_connection" />
  780.     Create a database now and fill in the values to connect to your database.<br />
  781.     The database user should have permission to perform select-, insert-, update- and delete queries. It must also be able to lock tables.
  782.  
  783.     <br /><br /><font color="#003399"><i>
  784.     $ mysql -u root -p<br />
  785.     $ mysql> CREATE DATABASE 'groupoffice';
  786.     </i></font>
  787.     <br /><br />
  788.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  789.     <tr>
  790.         <td>
  791.         Host:
  792.         </td>
  793.         <td>
  794.         <input type="text" size="40" name="db_host" value="<?php echo $GO_CONFIG->db_host; ?>" />
  795.         </td>
  796.     </tr>
  797.     <tr>
  798.         <td>
  799.         Database:
  800.         </td>
  801.         <td>
  802.         <input type="text" size="40" name="db_name" value="<?php echo $GO_CONFIG->db_name; ?>" />
  803.         </td>
  804.     </tr>
  805.  
  806.     <tr>
  807.         <td>
  808.         Username:
  809.         </td>
  810.         <td>
  811.         <input type="text" size="40" name="db_user" value="<?php echo $GO_CONFIG->db_user; ?>"  />
  812.         </td>
  813.     </tr>
  814.     <tr>
  815.         <td>
  816.         Password:
  817.         </td>
  818.         <td>
  819.         <input type="password" size="40" name="db_pass" value="<?php echo $GO_CONFIG->db_pass; ?>"  />
  820.         </td>
  821.     </tr>
  822.     <tr>
  823.         <td colspan="2">
  824.         <br />
  825.         <input type="submit" value="Continue" />
  826.         </td>
  827.     </tr>
  828.     </table>
  829.  
  830.     <?php
  831.     print_foot();
  832.     exit();
  833. }
  834.  
  835. //database connection is setup now
  836. //next step isto check if the table structure is present.
  837.  
  838. if(!isset($_SESSION['completed']['database_structure']))
  839. {
  840.     $db = new db();
  841.     $db->Halt_On_Error = 'no';
  842.     if (!@$db->connect($GO_CONFIG->db_name, $GO_CONFIG->db_host, $GO_CONFIG->db_user, $GO_CONFIG->db_pass))
  843.     {
  844.         print_head();
  845.         echo 'Can\'t connect to database!';
  846.         echo '<br /><br />Correct this and refresh this page.';
  847.         print_foot();
  848.         exit();
  849.     }else
  850.     {
  851.         $db->query("SHOW TABLES");
  852.         if ($db->num_rows() > 0)
  853.         {
  854.             //structure exists see if the settings table exists
  855.             $settings_exist = false;
  856.             while ($db->next_record())
  857.             {
  858.                 if ($db->f(0) == 'settings')
  859.                 {
  860.                     $settings_exist = true;
  861.                     break;
  862.                 }
  863.             }
  864.             if ($settings_exist)
  865.             {
  866.                 $db->query("SELECT value FROM settings WHERE name='version'");
  867.                 if ($db->next_record())
  868.                 {
  869.                     $db_version=str_replace('.','', $db->f('value'));
  870.                     require('lib/updates.inc');
  871.                     if (!isset($updates[$db_version]))
  872.                     {
  873.                         $db_version = false;
  874.                     }
  875.                 }else
  876.                 {
  877.                     $db_version = false;
  878.                 }
  879.             }
  880.  
  881.             print_head();
  882.             if (isset($feedback))
  883.             {
  884.                 echo $feedback.'<br /><br />';
  885.             }
  886.             ?>
  887.             <input type="hidden" name="task" value="database_structure" />
  888.             <input type="hidden" name="upgrade" value="true" />
  889.  
  890.             Group-Office has detected a previous installation of Group-Office. Do you wish to keep the existing data and perform an upgrade?
  891.             <?php
  892.             if (!$db_version)
  893.             {
  894.                 echo '<br /><br />Group-Office was unable to detect your old Group-Office version. The installer needs you old version number to determine updates that might apply.<br />';
  895.                 echo 'Please enter the version number below if you wish to perform an upgrade.';
  896.             }
  897.             ?>
  898.             <br /><br />
  899.             <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  900.             <?php
  901.             if (!$db_version)
  902.             {
  903.                 echo '<tr><td>Version:</td><td>';
  904.                 $db_version = isset($db_version) ? $db_version : $GO_CONFIG->db_version;
  905.                 echo '<input type="text" size="4" maxlength="4" name="db_version" value="'.$db_version.'" /></td></tr>';
  906.             }else
  907.             {
  908.                 echo '<input type="hidden" name="db_version" value="'.$db_version.'" />';
  909.             }
  910.             ?>
  911.             <tr>
  912.                 <td colspan="2">
  913.                 <input type="submit" value="Yes" />
  914.                   
  915.                 <input type="button" onclick="delete_database()" value="No" />
  916.                 </td>
  917.             </tr>
  918.             </table>
  919.             <?php
  920.             print_foot();
  921.             exit();
  922.         }else
  923.         {
  924.             //table is empty create the structure
  925.             $queries = get_sql_queries("lib/sql/groupoffice.sql");
  926.             while ($query = array_shift($queries))
  927.             {
  928.                 $db->query($query);
  929.             }
  930.             $queries = get_sql_queries("lib/sql/filetypes.sql");
  931.             while ($query = array_shift($queries))
  932.             {
  933.                 $db->query($query);
  934.             }
  935.             $queries = get_sql_queries("lib/sql/settings.sql");
  936.             while ($query = array_shift($queries))
  937.             {
  938.                 $db->query($query);
  939.             }
  940.             $_SESSION['completed']['database_structure'] = true;
  941.         }
  942.     }
  943. }
  944.  
  945. //database structure exists now and is up to date
  946. //now we get the userdir
  947.  
  948. if (!isset($_SESSION['completed']['userdir']))
  949. {
  950.     print_head();
  951.     if (isset($feedback))
  952.     {
  953.         echo $feedback.'<br /><br />';
  954.     }
  955.     ?>
  956.     <input type="hidden" name="task" value="userdir" />
  957.     Group-Office needs a place to store user data. Create a writable path for this purpose now and enter it in the box below.<br />
  958.     The path should be have 0777 permissions or should be owned by the webserver user. You probably need to be root to do the last.
  959.     <br />Also enter a maximum number of bytes to upload and a valid ocatal value for the file permissions.
  960.     <br /><br />
  961.     <font color="#003399"><i>
  962.     $ su<br />
  963.     $ mkdir /home/groupoffice<br />
  964.     $ chown apache:apache /home/groupoffice<br />
  965.     </i></font>
  966.  
  967.     <br /><br />
  968.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  969.     <tr>
  970.         <td colspan="2">User home directory:</td>
  971.     </tr>
  972.     <tr>
  973.     <?php
  974.         $userdir = isset($_POST['userdir']) ? $_POST['userdir'] : $GO_CONFIG->file_storage_path;
  975.         ?>
  976.         <td colspan="2"><input type="text" size="50" name="userdir" value="<?php echo $userdir; ?>" /></td>
  977.     </tr>
  978.     <tr>
  979.         <td>
  980.         Maximum upload size:
  981.         </td>
  982.     </tr>
  983.         <td>
  984.         <input type="text" size="50" name="max_file_size" value="<?php echo $GO_CONFIG->max_file_size; ?>"  />
  985.         </td>
  986.     </tr>
  987.     <tr>
  988.         <td>
  989.         Create mode:
  990.         </td>
  991.     </tr>
  992.     <tr>
  993.         <td>
  994.         <?php
  995.         $create_mode_string = decoct((string)$GO_CONFIG->create_mode);
  996.         if (strlen($create_mode_string) == 3)
  997.         {
  998.             $create_mode_string = '0'.$create_mode_string;
  999.         }
  1000.         ?>
  1001.         <input type="text" size="4" name="create_mode" value="<?php echo $create_mode_string; ?>" />
  1002.         </td>
  1003.     </tr>
  1004.     <tr>
  1005.         <td colspan="2">
  1006.         <br />
  1007.         <input type="submit" value="Continue" />
  1008.         </td>
  1009.     </tr>
  1010.     </table>
  1011.     <?php
  1012.     print_foot();
  1013.     exit();
  1014. }
  1015.  
  1016. //database structure exists now and is up to date
  1017. //now we get the tempdir
  1018.  
  1019. if (!isset($_SESSION['completed']['tmpdir']))
  1020. {
  1021.     print_head();
  1022.     if (isset($feedback))
  1023.     {
  1024.         echo $feedback.'<br /><br />';
  1025.     }
  1026.     ?>
  1027.     <input type="hidden" name="task" value="tmpdir" />
  1028.     Group-Office needs a place to store temporarily data such as session data or file uploads. Create a writable path for this purpose now and enter it in the box below.<br />
  1029.     The /tmp directory is a good option.
  1030.     <br /><br />
  1031.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1032.     <tr>
  1033.         <td>Temporarily files directory:</td>
  1034.     </tr>
  1035.     <tr>
  1036.     <?php
  1037.         $tmpdir = isset($_POST['tmpdir']) ? $_POST['tmpdir'] : $GO_CONFIG->tmpdir;
  1038.         ?>
  1039.         <td><input type="text" size="50" name="tmpdir" value="<?php echo $tmpdir; ?>" /></td>
  1040.     </tr>
  1041.     <tr>
  1042.         <td>
  1043.         <br />
  1044.         <input type="submit" value="Continue" />
  1045.         </td>
  1046.     </tr>
  1047.     </table>
  1048.     <?php
  1049.     print_foot();
  1050.     exit();
  1051. }
  1052.  
  1053. if (!isset($_SESSION['completed']['url']))
  1054. {
  1055.     print_head();
  1056.     if (isset($feedback))
  1057.     {
  1058.         echo $feedback.'<br /><br />';
  1059.     }
  1060.     ?>
  1061.     <input type="hidden" name="task" value="url" />
  1062.     Enter a relative and an absolute url.<br /><br />
  1063.     <font color="#003399"><i>
  1064.     Example:<br />
  1065.     Relative URL: /groupoffice/<br />
  1066.     Absolute URL: http://www.intermesh.nl/groupoffice/</i>
  1067.     </font>
  1068.     <br /><br />
  1069.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1070.     <tr>
  1071.         <td>
  1072.         Relative URL:
  1073.         </td>
  1074.         <td>
  1075.         <?php
  1076.         $host = isset($_POST['host']) ? $_POST['host'] : $GO_CONFIG->host;
  1077.         ?>
  1078.         <input type="text" size="40" name="host" value="<?php echo $host; ?>" />
  1079.         </td>
  1080.     </tr>
  1081.     <tr>
  1082.         <td>Absolute URL:</td>
  1083.         <td>
  1084.         <?php
  1085.         $full_url = isset($_POST['full_url']) ? $_POST['full_url'] : $GO_CONFIG->full_url;
  1086.         ?>
  1087.         <input type="text" size="40" name="full_url" value="<?php echo $full_url; ?>" />
  1088.         </td>
  1089.     </tr>
  1090.     <tr>
  1091.         <td colspan="2">
  1092.         <br />
  1093.         <input type="submit" value="Continue" />
  1094.         </td>
  1095.     </tr>
  1096.     </table>
  1097.     <?php
  1098.     print_foot();
  1099.     exit();
  1100. }
  1101.  
  1102.  
  1103. //the title of Group-Office
  1104. if (!isset($_SESSION['completed']['title']))
  1105. {
  1106.     print_head();
  1107.     if (isset($feedback))
  1108.     {
  1109.         echo $feedback.'<br /><br />';
  1110.     }
  1111.     ?>
  1112.     <input type="hidden" name="task" value="title" />
  1113.     Enter a title for your Group-Office and webmaster email address for your application.<br />
  1114.     The email address will recieve information about new registered users.
  1115.     <br /><br />
  1116.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1117.     <tr>
  1118.         <td>Title:</td>
  1119.     </tr>
  1120.     <tr>
  1121.     <?php
  1122.         $title = isset($_POST['title']) ? $_POST['title'] : $GO_CONFIG->title;
  1123.         $webmaster_email = isset($_POST['webmaster_email']) ? $_POST['webmaster_email'] : $GO_CONFIG->webmaster_email;
  1124.         ?>
  1125.         <td><input type="text" size="50" name="title" value="<?php echo $title; ?>" /></td>
  1126.     </tr>
  1127.     <tr>
  1128.         <td>
  1129.         Webmaster E-mail:
  1130.         </td>
  1131.     </tr>
  1132.     <tr>
  1133.         <td>
  1134.         <input type="text" size="50" name="webmaster_email" value="<?php echo $webmaster_email; ?>" />
  1135.         </td>
  1136.     </tr>
  1137.     <tr>
  1138.         <td>
  1139.         <br />
  1140.         <input type="submit" value="Continue" />
  1141.         </td>
  1142.     </tr>
  1143.     </table>
  1144.     <?php
  1145.     print_foot();
  1146.     exit();
  1147. }
  1148.  
  1149. //theme
  1150. if (!isset($_SESSION['completed']['theme']))
  1151. {
  1152.     print_head();
  1153.     if (isset($feedback))
  1154.     {
  1155.         echo $feedback.'<br /><br />';
  1156.     }
  1157.     ?>
  1158.     <input type="hidden" name="task" value="theme" />
  1159.     Select the default theme for Group-Office and whether users are allowed to change the theme or not.
  1160.     <br /><br />
  1161.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1162.     <tr>
  1163.         <td>Default theme:</td>
  1164.         <td>
  1165.             <?php
  1166.             $themes = $GO_THEME->get_themes();
  1167.             $dropbox = new dropbox();
  1168.             $dropbox->add_arrays($themes, $themes);
  1169.             $dropbox->print_dropbox("theme", $GO_CONFIG->theme);
  1170.             ?>
  1171.         </td>
  1172.     </tr>
  1173.     <tr>
  1174.         <td>Allow:</td>
  1175.         <td>
  1176.         <?php
  1177.         $allow_themes = isset($allow_themes) ? $allow_themes : $GO_CONFIG->allow_themes;
  1178.         $allow_themes = $allow_themes ? 'true' : 'false';
  1179.         $dropbox = new dropbox();
  1180.         $dropbox->add_value('true', 'yes');
  1181.         $dropbox->add_value('false', 'no');
  1182.         $dropbox->print_dropbox('allow_themes', $allow_themes);
  1183.         ?>
  1184.         </td>
  1185.     </tr>
  1186.     <tr>
  1187.         <td>
  1188.         <br />
  1189.         <input type="submit" value="Continue" />
  1190.         </td>
  1191.     </tr>
  1192.     </table>
  1193.     <?php
  1194.     print_foot();
  1195.     exit();
  1196. }
  1197. //language
  1198. if (!isset($_SESSION['completed']['language']))
  1199. {
  1200.     print_head();
  1201.     if (isset($feedback))
  1202.     {
  1203.         echo $feedback.'<br /><br />';
  1204.     }
  1205.     ?>
  1206.     <input type="hidden" name="task" value="language" />
  1207.     Select the default language for Group-Office. This language will be selected when autodetection fails.
  1208.     <br /><br />
  1209.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1210.     <tr>
  1211.         <td>Default language:</td>
  1212.         <td>
  1213.             <?php
  1214.             $languages = $GO_LANGUAGE->get_languages();
  1215.             $dropbox = new dropbox();
  1216.             $dropbox->add_arrays($languages, $languages);
  1217.             $dropbox->print_dropbox("language", $GO_CONFIG->language);
  1218.             ?>
  1219.         </td>
  1220.     </tr>
  1221.     <tr>
  1222.         <td>Default timezone offset:</td>
  1223.         <td>
  1224.         <?php
  1225.         $dropbox = new dropbox();
  1226.         $dropbox->add_value('8','+8 GMT');
  1227.         $dropbox->add_value('7','+7 GMT');
  1228.         $dropbox->add_value('6','+6 GMT');
  1229.         $dropbox->add_value('5','+5 GMT');
  1230.         $dropbox->add_value('4','+4 GMT');
  1231.         $dropbox->add_value('3','+3 GMT');
  1232.         $dropbox->add_value('2','+2 GMT');
  1233.         $dropbox->add_value('1','+1 GMT');
  1234.         $dropbox->add_value('0','GMT');
  1235.         $dropbox->add_value('-1','-1 GMT');
  1236.         $dropbox->add_value('-2','-2 GMT');
  1237.         $dropbox->add_value('-3','-3 GMT');
  1238.         $dropbox->add_value('-4','-4 GMT');
  1239.         $dropbox->add_value('-5','-5 GMT');
  1240.         $dropbox->add_value('-6','-6 GMT');
  1241.         $dropbox->add_value('-7','-7 GMT');
  1242.         $dropbox->add_value('-8','-8 GMT');
  1243.         $dropbox->print_dropbox("timezone_offset", $GO_CONFIG->timezone_offset);
  1244.         ?>
  1245.         </td>
  1246.     </tr>
  1247.     <tr>
  1248.         <td>First day of the week:</td>
  1249.         <td>
  1250.         <?php
  1251.         $dropbox = new dropbox();
  1252.         $dropbox->add_value('0','Sunday');
  1253.         $dropbox->add_value('1','Monday');
  1254.         $dropbox->print_dropbox("first_weekday", $GO_CONFIG->first_weekday);
  1255.         ?>
  1256.         </td>
  1257.     </tr>
  1258.  
  1259.     <tr>
  1260.         <td>
  1261.         <br />
  1262.         <input type="submit" value="Continue" />
  1263.         </td>
  1264.     </tr>
  1265.     </table>
  1266.     <?php
  1267.     print_foot();
  1268.     exit();
  1269. }
  1270.  
  1271. //Find out if we use Group-Office database or LDAP for Authentication...
  1272. //if option authentication is set then we have succesfully set it up
  1273. if (!isset($_SESSION['completed']['authentication_type']))
  1274. {
  1275.     print_head();
  1276.     if (isset($feedback))
  1277.     {
  1278.         echo $feedback.'<br /><br />';
  1279.     }
  1280.     ?>
  1281.     <input type="hidden" name="task" value="authentication_type" />
  1282.     You can select if you want to use the Group-Office database or an LDAP directory server as authentication source.<br />
  1283.     Please note that if Group-Office fails to authenticate the user at the LDAP or mail server it will fall back on the Group-Office database.<br />
  1284.     If you are going to use authentication on a mail server you will have to specify the mail servers Group-Office is allowed to use in the file 'auth_mail_servers.inc'.
  1285.     <br /><br />
  1286.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1287.     <tr>
  1288.         <td>
  1289.         Source:
  1290.         </td>
  1291.         <td>
  1292.         <?php
  1293.         $dropbox = new dropbox();
  1294.         $dropbox->add_value('sql', 'Group-Office');
  1295.         $dropbox->add_value('ldap', 'LDAP (Experimental)');
  1296.         $dropbox->add_value('mail', 'Mail server (Experimental)');
  1297.         $dropbox->print_dropbox('auth_db_type', $GO_CONFIG->auth_db_type);
  1298.         ?>
  1299.         </td>
  1300.     </tr>
  1301.     <tr>
  1302.         <td colspan="2">Allow users to change thier password? (Only applies Group-Office authentication):</td>
  1303.         <td>
  1304.         <?php
  1305.         $allow_password_change = $GO_CONFIG->allow_password_change ? 'true' : 'false';
  1306.         $dropbox = new dropbox();
  1307.         $dropbox->add_value('true', 'Yes');
  1308.         $dropbox->add_value('false', 'No');
  1309.         $dropbox->print_dropbox('allow_password_change', $allow_password_change);
  1310.         ?>
  1311.         </td>
  1312.     </tr>
  1313.     <tr>
  1314.         <td colspan="2">
  1315.         <br />
  1316.         <input type="submit" value="Continue" />
  1317.         </td>
  1318.     </tr>
  1319.     </table>
  1320.  
  1321.     <?php
  1322.     print_foot();
  1323.     exit();
  1324. }
  1325.  
  1326. if (!isset($_SESSION['completed']['authentication_ldap']))
  1327. {
  1328.     print_head();
  1329.     if (isset($feedback))
  1330.     {
  1331.         echo $feedback.'<br /><br />';
  1332.     }
  1333.     ?>
  1334.     <input type="hidden" name="task" value="authentication_ldap" />
  1335.     Please specify your LDAP database.<br />
  1336.     <br /><br />
  1337.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1338.     <tr>
  1339.         <td>
  1340.         Host:
  1341.         </td>
  1342.         <td>
  1343.         <input type="text" size="40" name="auth_db_host" value="<?php echo $GO_CONFIG->auth_db_host; ?>" />
  1344.         </td>
  1345.     </tr>
  1346.     <tr>
  1347.         <td>
  1348.         Username:
  1349.         </td>
  1350.         <td>
  1351.         <input type="text" size="40" name="auth_db_user" value="<?php echo $GO_CONFIG->auth_db_user; ?>"  />
  1352.         </td>
  1353.     </tr>
  1354.     <tr>
  1355.         <td>
  1356.         Password:
  1357.         </td>
  1358.         <td>
  1359.         <input type="password" size="40" name="auth_db_pass" value="<?php echo $GO_CONFIG->auth_db_pass; ?>"  />
  1360.         </td>
  1361.     </tr>
  1362.     <tr>
  1363.         <td>
  1364.         Base-DN:
  1365.         </td>
  1366.         <td>
  1367.         <input type="text" size="40" name="auth_db_ldap_basedn" value="<?php echo $GO_CONFIG->auth_db_ldap_basedn; ?>"  />
  1368.         </td>
  1369.     </tr>
  1370.     <tr>
  1371.         <td>
  1372.         User-DN:
  1373.         </td>
  1374.         <td>
  1375.         <input type="text" size="40" name="auth_db_ldap_peopledn" value="<?php echo $GO_CONFIG->auth_db_ldap_peopledn; ?>"  />
  1376.         </td>
  1377.     </tr>
  1378.     <tr>
  1379.         <td>
  1380.         Group-DN:
  1381.         </td>
  1382.         <td>
  1383.         <input type="text" size="40" name="auth_db_ldap_groupsdn" value="<?php echo $GO_CONFIG->auth_db_ldap_groupsdn; ?>"  />
  1384.         </td>
  1385.     </tr>
  1386.     <tr>
  1387.         <td>
  1388.         enable LDAP User Management (not finished yet):
  1389.         </td>
  1390.         <td>
  1391.         <?php
  1392.         $dropbox = new dropbox();
  1393.                 $dropbox->add_value('true', 'yes');
  1394.                 $dropbox->add_value('false', 'no');
  1395.                 $dropbox->print_dropbox('auth_db_ldap_um', $auth_db_ldap_um);
  1396.         ?>
  1397.         </td>
  1398.     </tr>
  1399.     <tr>
  1400.         <td colspan="2">
  1401.         <br />
  1402.         <input type="submit" value="Continue" />
  1403.         </td>
  1404.     </tr>
  1405.     </table>
  1406.  
  1407.     <?php
  1408.     print_foot();
  1409.     exit();
  1410. }
  1411.  
  1412.  
  1413. if (!isset($_SESSION['completed']['system_accounts']))
  1414. {
  1415.     print_head();
  1416.     if (isset($feedback))
  1417.     {
  1418.         echo $feedback.'<br /><br />';
  1419.     }
  1420.     ?>
  1421.     <input type="hidden" name="task" value="system_accounts" />
  1422.     When this option is selected a system user will be created identical to the Group-Office users.<br />
  1423.     If you wish to enable this you need  <a href="http://www.courtesan.com/sudo/" target="_blank">Sudo</a> to be installed and enter the data from 'lib/sudoers' into '/etc/sudoers'.<br />
  1424.     Keep in mind that if you do this the webserver can now:
  1425.     <ul>
  1426.         <li>add/remove users</li>
  1427.         <li>change passwords</li>
  1428.         <li>reboot and halt the machine</li>
  1429.     </ul>
  1430.     So this is genaraly a BAD idea on a public webserver
  1431.     <br /><br />
  1432.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1433.     <tr>
  1434.         <td>Enable system accounts:</td>
  1435.         <td>
  1436.         <?php
  1437.         $enable_system_accounts = isset($enable_system_accounts) ? $enable_system_accounts : $GO_CONFIG->enable_system_accounts;
  1438.         $enable_system_accounts = $enable_system_accounts ? 'true' : 'false';
  1439.         $dropbox = new dropbox();
  1440.         $dropbox->add_value('true', 'yes');
  1441.         $dropbox->add_value('false', 'no');
  1442.         $dropbox->print_dropbox('enable_system_accounts', $enable_system_accounts);
  1443.         ?>
  1444.         </td>
  1445.     </tr>
  1446.     <tr>
  1447.         <td>
  1448.         <br />
  1449.         <input type="submit" value="Continue" />
  1450.         </td>
  1451.     </tr>
  1452.     </table>
  1453.     <?php
  1454.     print_foot();
  1455.     exit();
  1456. }
  1457.  
  1458. if (!isset($_SESSION['completed']['samba_accounts']) && ($GO_CONFIG->enable_system_accounts == true))
  1459. {
  1460.     print_head();
  1461.     if (isset($feedback))
  1462.     {
  1463.         echo $feedback.'<br /><br />';
  1464.     }
  1465.     ?>
  1466.     <input type="hidden" name="task" value="samba_accounts" />
  1467.     With system accounts enabled Group-Office can synchronise Samba users. <br />
  1468.     Make sure <a target="_blank" href="http://expect.nist.gov/">Expect</a> is installed  and
  1469.     copy 'lib/auto_smbadduser.exp' and lib/auto_smbpasswd.exp' to folder '/usr/sbin'.<br />
  1470.     Do you wish to use Samba accounts?
  1471.     <br />
  1472.     <br />
  1473.     <font color="#003399"><i>
  1474.     $ cp lib/scripts/auto_smbadduser.exp lib/scripts/auto_smbadduser.exp /usr/sbin/<br />
  1475.     $ chown root:root /usr/sbin/auto_smbadduser.exp /usr/sbin/auto_smbadduser.exp<br />
  1476.     $ chmod 0440 /usr/sbin/auto_smbadduser.exp /usr/sbin/auto_smbadduser.exp<br />
  1477.     </i></font>
  1478.     <br /><br />
  1479.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1480.     <tr>
  1481.         <td>Enable Samba accounts:</td>
  1482.         <td>
  1483.         <?php
  1484.         $enable_samba_accounts = isset($enable_samba_accounts) ? $enable_samba_accounts : $GO_CONFIG->enable_samba_accounts;
  1485.         $enable_samba_accounts = $enable_samba_accounts ? 'true' : 'false';
  1486.         $dropbox = new dropbox();
  1487.         $dropbox->add_value('true', 'yes');
  1488.         $dropbox->add_value('false', 'no');
  1489.         $dropbox->print_dropbox('enable_samba_accounts', $enable_samba_accounts);
  1490.         ?>
  1491.         </td>
  1492.     </tr>
  1493.     <tr>
  1494.         <td>
  1495.         <br />
  1496.         <input type="submit" value="Continue" />
  1497.         </td>
  1498.     </tr>
  1499.     </table>
  1500.     <?php
  1501.     print_foot();
  1502.     exit();
  1503. }
  1504.  
  1505.  
  1506. if (!isset($_SESSION['completed']['smtp']))
  1507. {
  1508.     print_head();
  1509.     if (isset($feedback))
  1510.     {
  1511.         echo $feedback.'<br /><br />';
  1512.     }
  1513.     ?>
  1514.     <input type="hidden" name="task" value="smtp" />
  1515.     Group-Office has the ability to send and recieve e-mail. Please configure your SMTP server. <br />
  1516.     Leave this blank to use local sendmail.
  1517.     <br />
  1518.     <br />
  1519.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1520.     <tr>
  1521.         <td>
  1522.         SMTP server:
  1523.         </td>
  1524.         <td>
  1525.         <input type="text" size="40" name="smtp_server" value="<?php echo $GO_CONFIG->smtp_server; ?>"  />
  1526.         </td>
  1527.     </tr>
  1528.     <tr>
  1529.         <td>
  1530.         SMTP port:
  1531.         </td>
  1532.         <td>
  1533.         <input type="text" size="40" name="smtp_port" value="<?php echo $GO_CONFIG->smtp_port; ?>" />
  1534.         </td>
  1535.     </tr>
  1536.     <tr>
  1537.         <td>
  1538.         Maximum size of attachments:
  1539.         </td>
  1540.         <td>
  1541.         <input type="text" size="40" name="max_attachment_size" value="<?php echo $GO_CONFIG->max_attachment_size; ?>" />
  1542.         </td>
  1543.     </tr>
  1544.     <tr>
  1545.         <td colspan="2">
  1546.         <br />
  1547.         <b>
  1548.         Some servers require some connection string options when connecting
  1549.         to an IMAP or POP-3 server using the PHP IMAP extension. For example most Redhat systems
  1550.         require '/notls' or '/novalidate-cert'.
  1551.         If you are not sure then leave this field blank.
  1552.         </b>
  1553.         <br /><br />
  1554.         </td>
  1555.     </tr>
  1556.     <tr>
  1557.         <td>
  1558.         Connection options:
  1559.         </td>
  1560.         <td>
  1561.         <input type="text" size="40" name="email_connectstring_options" value="<?php echo $GO_CONFIG->email_connectstring_options; ?>" />
  1562.         </td>
  1563.     </tr>
  1564.     <tr>
  1565.         <td colspan="2">
  1566.         <br />
  1567.         <input type="submit" value="Continue" />
  1568.         </td>
  1569.     </tr>
  1570.     </table>
  1571.     <?php
  1572.     print_foot();
  1573.     exit();
  1574. }
  1575.  
  1576. if (!isset($_SESSION['completed']['local_email']) && ($GO_CONFIG->enable_system_accounts === true))
  1577. {
  1578.     print_head();
  1579.     if (isset($feedback))
  1580.     {
  1581.         echo $feedback.'<br /><br />';
  1582.     }
  1583.     ?>
  1584.     <input type="hidden" name="task" value="local_email" />
  1585.     With system accounts enabled Group-Office can create automatically add accounts if local IMAP or POP3 is enabled. <br />
  1586.     The local hostname is the name of this machine and optionally you can add the same options as you can add to the PHP imap_open function like /notls for a Redhat bug.<br />
  1587.     Leave blank if you wish to disable automatic email creation.
  1588.     <br /><br />
  1589.     <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1590.     <tr>
  1591.         <td>Local e-mail domain name:</td>
  1592.         <td>
  1593.         <input type="text" size="30" name="inmail_host" value="<?php echo $GO_CONFIG->inmail_host; ?>" />
  1594.         </td>
  1595.     </tr>
  1596.     <tr>
  1597.         <td>Local hostname:</td>
  1598.         <td>
  1599.         <input type="text" size="30" name="local_email_host" value="<?php echo $GO_CONFIG->local_email_host; ?>" />
  1600.         </td>
  1601.     </tr>
  1602.     <tr>
  1603.         <td>Local server protocol:</td>
  1604.         <td>
  1605.         <?php
  1606.         $imap = ($GO_CONFIG->inmail_type == "imap") ? 'selected' : '';
  1607.         ?>
  1608.         <select name="inmail_type" onchange="change_port()">
  1609.             <option value="pop3">POP3</option>
  1610.             <option value="imap" <?php echo $imap; ?>>IMAP</option>
  1611.         </select>
  1612.         </td>
  1613.     </tr>
  1614.     <tr>
  1615.         <td>Local server port:</td>
  1616.         <td>
  1617.         <input type="text" size="4" name="inmail_port" value="<?php echo $GO_CONFIG->inmail_port; ?>" />
  1618.         </td>
  1619.     </tr>
  1620.     <tr>
  1621.         <td>Local root folder:</td>
  1622.         <td>
  1623.         <input type="text" size="30" name="inmail_root" value="<?php echo $GO_CONFIG->inmail_root; ?>" />
  1624.         </td>
  1625.     </tr>
  1626.     <tr>
  1627.         <td colspan="2">
  1628.         <br />
  1629.         <input type="submit" value="Continue" />
  1630.         </td>
  1631.     </tr>
  1632.     </table>
  1633.     <?php
  1634.     print_foot();
  1635.     exit();
  1636. }
  1637.  
  1638. //check if we need to add the administrator account
  1639.  
  1640. if(!isset($_SESSION['completed']['administrator']))
  1641. {
  1642.     require_once($GO_CONFIG->class_path.'users.class.inc');
  1643.     $users = new users();
  1644.  
  1645.     if (!$users->get_user(1))
  1646.     {
  1647.         print_head();
  1648.         if (isset($feedback))
  1649.         {
  1650.             echo $feedback.'<br /><br />';
  1651.         }
  1652.         ?>
  1653.         <input type="hidden" name="task" value="administrator" />
  1654.         Group-Office needs an administrator account. The username will be 'administrator'. Please create a password for 'administrator'.
  1655.         <br /><br />
  1656.         <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1657.         <tr>
  1658.             <td>
  1659.             Password:
  1660.             </td>
  1661.             <td>
  1662.             <input type="password" name="pass1" />
  1663.             </td>
  1664.         </tr>
  1665.         <tr>
  1666.             <td>
  1667.             Confirm password:
  1668.             </td>
  1669.             <td>
  1670.             <input type="password" name="pass2" />
  1671.             </td>
  1672.         </tr>
  1673.         <tr>
  1674.             <td>
  1675.             E-mail:
  1676.             </td>
  1677.             <td>
  1678.             <?php $email = isset($email)? $email : $GO_CONFIG->webmaster_email;?>
  1679.             <input type="text" size="40" name="email" value="<?php echo $email; ?>" />
  1680.             </td>
  1681.         </tr>
  1682.         <tr>
  1683.             <td colspan="2">
  1684.             <input type="submit" value="Continue" />
  1685.             </td>
  1686.         </tr>
  1687.         </table>
  1688.         <?php
  1689.         print_foot();
  1690.         exit();
  1691.     }
  1692. }
  1693.  
  1694. if(!isset($_SESSION['completed']['send_info']))
  1695. {
  1696.     print_head();
  1697.     if (isset($feedback))
  1698.     {
  1699.         echo $feedback.'<br /><br />';
  1700.     }
  1701.     ?>
  1702.     <input type="hidden" name="task" value="send_info" />
  1703.     Intermesh would like to know that you are using Group-Office to find out how many people are
  1704.     using Group-Office. Please select an Option. (If you already sent information before, please select 'No').
  1705.     <br /><br />
  1706.     <table cellpadding="10" style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1707.     <tr>
  1708.         <td>
  1709.         <?php
  1710.         $info = isset($_REQUEST['info']) ? $_REQUEST['info'] : 'no';
  1711.         $users = isset($_REQUEST['users']) ? $_REQUEST['users'] : '< 5';
  1712.  
  1713.         $radio_list = new radio_list('info', $info);
  1714.         $radio_list->add_option('no', 'no', "");
  1715.         echo "No, Don't send information to Intermesh <br />";
  1716.         $radio_list->add_option('business', 'business', "");
  1717.         echo "Yes, tell Intermesh that I'm using Group-Office for business purpose.<br />";
  1718.         $radio_list->add_option('personal', 'personal', "");
  1719.         echo "Yes, tell Intermesh that I'm using Group-Office for personal use or I'm just testing.";
  1720.         ?>
  1721.         </td>
  1722.     </tr>
  1723.     <tr>
  1724.         <td>
  1725.         How many users do you have in Group-Office?
  1726.         <?php
  1727.         $dropbox = new dropbox();
  1728.         $dropbox->add_value('< 5', '< 5');
  1729.         $dropbox->add_value('20-30', '20-30');
  1730.         $dropbox->add_value('30-50', '30-50');
  1731.         $dropbox->add_value('50-75', '50-75');
  1732.         $dropbox->add_value('75-100', '75-100');
  1733.         $dropbox->add_value('100-150', '100-150');
  1734.         $dropbox->add_value('150-200', '150-200');
  1735.         $dropbox->add_value('300-400', '300-400');
  1736.         $dropbox->add_value('> 400', '> 400');
  1737.         $dropbox->print_dropbox('users', $users);
  1738.         ?>
  1739.         </td>
  1740.     </tr>
  1741.     <tr>
  1742.         <td>
  1743.         If you would like to recieve information about Group-Office Professional
  1744.         please fill in a name and an e-mail address where Intermesh may contact you:<br />
  1745.         <?php
  1746.         $email = isset($email)? $email : $GO_CONFIG->webmaster_email;
  1747.         $name = isset($name)? $name : '';
  1748.          ?>
  1749.         <table style="border-width: 0px;font-family: Arial,Helvetica; font-size: 12px;">
  1750.         <tr>
  1751.             <td>E-mail:</td>
  1752.             <td><input type="text" size="50" name="email" value="<?php echo $email; ?>" /></td>
  1753.         </tr>
  1754.         <tr>
  1755.             <td>Name:</td>
  1756.             <td><input type="text" size="50" name="name" value="<?php echo $name; ?>" /></td>
  1757.         </tr>
  1758.         </table>
  1759.         </td>
  1760.     </tr>
  1761.     <tr>
  1762.         <td>
  1763.         <input type="submit" value="Continue" />
  1764.         </td>
  1765.     </tr>
  1766.     </table>
  1767.     <?php
  1768.     print_foot();
  1769.     exit();
  1770. }
  1771.  
  1772. print_head();
  1773.  
  1774. ?>
  1775. Installation complete!<br />
  1776. <br />
  1777. Please make sure Group-Office.php is not writable anymore now.<br />
  1778. <br />
  1779. <font color="#003399"><i>
  1780. $ chown -R someuser:someuser <?php echo $GO_CONFIG->root_path; ?><br />
  1781. $ chmod -R 755 <?php echo $GO_CONFIG->root_path; ?>
  1782. </i></font>
  1783. <br />
  1784. <br />
  1785. You may want to edit /etc/php.ini to configure file uploads.<br />
  1786.  
  1787. When you are done log in to Group-Office with the administrator account.<br />
  1788. <ul>
  1789.     <li>Navigate to the menu: administrator -> configuration -> modules, select the modules you wish to use and click at the 'save' button</li>
  1790.     <li>Navigate to the menu: administrator -> configuration -> menu's, select the menu's you wish to use and click at the 'save' button</li>
  1791.     <li>Navigate to the menu: administrator -> users and add new users.</li>
  1792. </ul>
  1793. <br />
  1794. <br />
  1795. For further troubleshooting please consult the <a target="_blank" href="FAQ">FAQ</a> included with the package. If that doesn't help post on the <a target="_blank" href="http://sourceforge.net/forum/?group_id=76359">forums</a>.<br />
  1796. Developers should take a look at modules/example/index.php
  1797. <br /><br />
  1798. <a href="<?php echo $GO_CONFIG->host; ?>">Click here to start Group-Office!</a>
  1799. <?php
  1800. print_foot();
  1801. session_destroy();
  1802. ?>
  1803.