Possible admin tool to use current setup config.inc.php files

This commit is contained in:
Miles Lott 2001-06-01 01:57:51 +00:00
parent 609b3b8fad
commit 76693ae37b
4 changed files with 113 additions and 0 deletions

76
admin/config.php Normal file
View File

@ -0,0 +1,76 @@
<?php
/**************************************************************************\
* phpGroupWare - Admin config *
* Written by Miles Lott <milosch@phpgroupware.org> *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_info['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => "admin",
);
include('../header.inc.php');
$t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$t->set_file(array(
'header' => 'config_head.tpl',
'footer' => 'config_footer.tpl'
));
$c = CreateObject('phpgwapi.config',$appname);
$c->read_repository();
if ($c->config_data)
{
$current_config = $c->config_data;
}
else
{
$c->appname = 'phpgwapi';
$c->read_repository();
$current_config = $c->config_data;
}
//echo print_r($current_config); exit;
if ($cancel)
{
Header('Location: '.$phpgw->link('/admin/index.php'));
}
if ($submit)
{
while (list($key,$config) = each($newsettings))
{
//echo '<br>' . $key . ' = "' . $config . '"';
$c->config_data[$key] = $config;
}
$c->save_repository(True);
Header('Location: '.$phpgw->link('/admin/index.php'));
$phpgw->common->phpgw_exit();
}
$phpgw->common->phpgw_header();
echo parse_navbar();
$t->set_var('title',lang('Site Configuration'));
$t->set_var('action_url',$phpgw->link('/admin/config.php'));
$t->pparse('out','header');
include(PHPGW_SERVER_ROOT . SEP . $appname . SEP . 'setup' . SEP . 'config.inc.php');
if ($appname == 'admin')
{
include(PHPGW_SERVER_ROOT . SEP . 'preferences' . SEP . 'setup' . SEP . 'config.inc.php');
}
$t->pparse('out','footer');
$phpgw->common->phpgw_footer();
?>

View File

@ -0,0 +1,15 @@
<!-- begin config_post_script.tpl -->
<tr bgcolor="FFFFFF">
<td colspan="2">
&nbsp;
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="Submit">
<input type="submit" name="cancel" value="Cancel">
</td>
</tr>
</table>
</form>
<!-- end config_post_script.tpl -->

View File

@ -0,0 +1,15 @@
<!-- BEGIN footer -->
<tr bgcolor="FFFFFF">
<td colspan="2">
&nbsp;
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="Submit">
<input type="submit" name="cancel" value="Cancel">
</td>
</tr>
</table>
</form>
<!-- END footer -->

View File

@ -0,0 +1,7 @@
<!-- BEGIN head -->
<form method="POST" action="{action_url}">
<table border="0" align="center">
<tr bgcolor="486591">
<td colspan="2"><font color="fefefe">&nbsp;<b>{title}</b></font></td>
</tr>
<!-- END head -->