<?php
/*
Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
@version $Id: config_global_connector.php,v 1.2 2004/02/09 18:16:10 ordnas Exp $
@copyright Copyright © 2001-2004 ZZ/OSS GbR, http://www.zzoss.com
@license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
*/
// execute init file
require_once 'inc/init.php';
function zi_process()
{
global $ZZOSS_INSTALLER;
// save the parameters for later installations
$file = $ZZOSS_INSTALLER["application_path"].'config_global_connector.reg';
$fp = fopen($file, "w");
fputs( $fp, serialize( $_REQUEST ));
fclose( $fp );
}
// assign default values
function zi_default()
{
global $ZZOSS_INSTALLER;
// if we had a previous installation, we get those values
$file = $ZZOSS_INSTALLER["application_path"].'config_global_connector.reg';
if(file_exists($file)){
$fp = fopen($file,"r");
$ser = fread ($fp, filesize ($file));
fclose($fp);
return unserialize($ser);
} else {
// default values
$_REQUEST['ZI_VALUES']['default_dsn'] = "mysql://root:@127.0.0.1/zzoss";
$_REQUEST['ZI_VALUES']['default_api'] = "ZZOSS::Repository::PEAR::DB";
return $_REQUEST;
}
}
// we ask for a new installer admin username and password
include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
// initialise widget class of installer
require_once 'ZZOSS_Installer/Widget.php';
$zi_widget = new ZZOSS_InstallerWidget;
if(isset($zi_errors)){
$zi_widget->setErrors($zi_errors);
}
?>
<h1>Global Connector</h1>
<p>Please define the default connector parameters, which will be used in the next page where you can define the parameters for each component.</p>
<table width="600" border="0" cellspacing="0" cellpadding="8" align="center">
<?php
echo $zi_widget->add('dsn', 'Default', 'default');
echo $zi_widget->add('api', 'Default', 'default');
?>
</table>
<?php
include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>