<?php
// +----------------------------------------------------------------+
// | step3.php														|
// |																|
// | Function: Setup Calendar Server			                    |
// +----------------------------------------------------------------+
// | Source-code (C) CalaCode.com 1998-2009 . All rights reserved	|
// | See http://calacode.com/license.ehtml for license agreement	|
// +----------------------------------------------------------------+
// | Date: May 2009													|
// +----------------------------------------------------------------+


// Make sure we are included from install/index.php, exit if not
if (!defined('ATMAIL_INSTALL_SCRIPT')) {
	// link to installer
	die("You cannot request this file directly, please use <a href=\"index.php\">the installer</a>");
}

$vars['allow_Push_check'] = false;
$vars['calendar_error'] = false;
$errors = array();

// If the form from Step 3 has been submitted
// we need to process it
if (isset($_POST['submit'])) 
{

    unset($errors);
	
	$_SESSION['pref']['allow_Push'] = $_POST['allow_Push'];

	if (!isset($errors) || (isset($errors) && !count($errors)))
	{
	    gotoStep(4);
	}
	
}

// Create some default values
//get supported OS version
Zend_Loader::loadFile('Atmail/General.php', null, true);

$vars['hostOperatingSystemInfo'] = getOperatingSystemInfo();

// merge any pref values into $vars so if we are
// returning from a latter step the values are auto
// completed
if (isset($_SESSION['pref']['CalDavUrl']) && !count($errors))
	$vars = array_merge($vars, $_SESSION['pref']);

$vars['calserver_dir'] = dirname(dirname(dirname(__FILE__))) . '/server_source/calendar_server';
$vars['output'] = parse("$htmlPath/step3.phtml", array_merge($vars, $errors));
