<?php
/**************************************************************************
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.
@Authors: Ryan Thompson(hide@address.com)
***************************************************************************/
/*$Id: upgrade_config.php,v 1.5 2003/12/11 21:24:57 rthomp Exp $*/
$service['no_session'] = TRUE;
include('../config.inc.php');
if(isset($_POST['upgrade']))
{
header("Location: add_tables.php");
} elseif(isset($_POST['continue']))
{
//For security reasons lets get rid of this cookie now that we don't need it
setCookie(o_config, NULL, time()-3600);
$O->redirect('/index.php');
}
if(isset($_POST['edit_config']))
{
if($_POST['cfg_password'] == $access_pass)
{
$setup->config_access($db);
header("Location: {$_SERVER['PHP_SELF']}");
}
} elseif(!isset($_COOKIE['o_config']))
{
echo $_COOKIE['o_config'];
?>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<input type="password" name="cfg_password" value="">
<input type="submit" name="edit_config" value="Edit Config">
</form>
<?php
} else {
//We got this far. Lets make sure it's a valid config session
$sql = "SELECT * FROM o_sessions WHERE session_id='{$_COOKIE['o_config']}'";
$db->query($sql);
if($db->num_rows != 1)
{
die('You have tried accessing o config through an invalid session');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>OpenSource GroupWare Setup</title>
<link rel="stylesheet" type="text/css" href="config.css">
<script type="text/javascript">
function openhelp(popurl){
winpops=window.open(popurl,"","width=400,height=338,resizable,")
}
</script>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<table style="padding:0px" cellspacing="0" align="center">
<tr>
<td class="header"><img src="<?php echo "http://{$O->url}/osgw/graphics/o.png"?>"></td>
<td colspan="4" class="header">
OpenSource GroupWare Upgrade
</td>
</tr>
<tr>
<td class="caption">Current Running Version:</td>
<td class="input">
<?php
$db->query("SELECT value FROM o_info WHERE name='version'");
$db->fetch_results();
echo $db->record['value'];
?>
</td>
<td class="caption">Upgrade Version:</td>
<td class="input"><?php echo VERSION?></td>
</tr>
<tr>
<td colspan="4">
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<input type="submit" name="upgrade" value="Upgrade" class="button">
<?php
if(VERSION == $db->record['value'])
{
?>
<input type="submit" name="continue" value="Finish" class="button">
<?php
}
?>
</form>
</td>
</tr>
</table>
<?php
}
?>