2000-09-06 23:54:20 +02:00
|
|
|
<?php
|
2000-08-18 05:24:22 +02:00
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* The file written by Joseph Engo <jengo@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$ */
|
|
|
|
|
2001-06-06 18:50:44 +02:00
|
|
|
if (!is_file('header.inc.php'))
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
|
|
|
echo '<center>It appears that phpGroupWare is not setup yet, please click <a href="setup/index.php">'
|
|
|
|
. 'here</a>.</center>';
|
|
|
|
exit;
|
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2001-04-08 08:54:42 +02:00
|
|
|
if (!isset($sessionid) || !$sessionid)
|
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
Header('Location: login.php');
|
2001-04-08 08:54:42 +02:00
|
|
|
exit;
|
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2001-05-02 09:52:31 +02:00
|
|
|
$phpgw_info['flags'] = array(
|
|
|
|
'noheader' => True,
|
|
|
|
'nonavbar' => True,
|
|
|
|
'currentapp' => 'home',
|
|
|
|
'enable_network_class' => True,
|
|
|
|
'enable_contacts_class' => True,
|
|
|
|
'enable_nextmatchs_class' => True
|
2001-04-08 08:54:42 +02:00
|
|
|
);
|
2001-06-06 18:50:44 +02:00
|
|
|
include('header.inc.php');
|
2001-04-08 08:54:42 +02:00
|
|
|
// Note: I need to add checks to make sure these apps are installed.
|
2001-02-04 10:19:07 +01:00
|
|
|
|
2001-04-08 08:54:42 +02:00
|
|
|
if ($phpgw_forward)
|
|
|
|
{
|
|
|
|
// Why again?
|
|
|
|
if ($phpgw_forward)
|
|
|
|
{
|
|
|
|
while (list($name,$value) = each($HTTP_GET_VARS))
|
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
if (ereg('phpgw_',$name))
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
$extra_vars .= '&' . $name . '=' . urlencode($value);
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$phpgw->redirect($phpgw->link($phpgw_forward,$extra_vars));
|
|
|
|
}
|
2000-12-11 10:18:09 +01:00
|
|
|
|
2001-06-06 18:50:44 +02:00
|
|
|
if (($phpgw_info['user']['preferences']['common']['useframes'] &&
|
|
|
|
$phpgw_info['server']['useframes'] == 'allowed') ||
|
|
|
|
($phpgw_info['server']['useframes'] == 'always'))
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
if ($cd == 'yes')
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
|
|
|
if (! $navbarframe && ! $framebody)
|
|
|
|
{
|
2001-06-27 07:17:42 +02:00
|
|
|
$tpl = new Template(PHPGW_TEMPLATE_DIR);
|
2001-04-08 08:54:42 +02:00
|
|
|
$tpl->set_file(array(
|
2001-06-06 18:50:44 +02:00
|
|
|
'frames' => 'frames.tpl',
|
|
|
|
'frame_body' => 'frames_body.tpl',
|
|
|
|
'frame_navbar' => 'frames_navbar.tpl'
|
2001-04-08 08:54:42 +02:00
|
|
|
));
|
2001-06-06 18:50:44 +02:00
|
|
|
$tpl->set_var('navbar_link',$phpgw->link('index.php','navbarframe=True&cd=yes'));
|
2001-04-08 08:54:42 +02:00
|
|
|
if ($forward)
|
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
$tpl->set_var('body_link',$phpgw->link($forward));
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
$tpl->set_var('body_link',$phpgw->link('index.php','framebody=True&cd=yes'));
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
2000-12-11 10:18:09 +01:00
|
|
|
|
2001-06-06 18:50:44 +02:00
|
|
|
if ($phpgw_info['user']['preferences']['common']['frame_navbar_location'] == 'bottom')
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
$tpl->set_var('frame_size','*,60');
|
|
|
|
$tpl->parse('frames_','frame_body',True);
|
|
|
|
$tpl->parse('frames_','frame_navbar',True);
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
$tpl->set_var('frame_size','60,*');
|
|
|
|
$tpl->parse('frames_','frame_navbar',True);
|
|
|
|
$tpl->parse('frames_','frame_body',True);
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
2001-06-06 18:50:44 +02:00
|
|
|
$tpl->pparse('out','frames');
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
|
|
|
if ($navbarframe)
|
|
|
|
{
|
|
|
|
$phpgw->common->phpgw_header();
|
|
|
|
echo parse_navbar();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-06-06 18:50:44 +02:00
|
|
|
elseif ($cd=='yes' && $phpgw_info['user']['preferences']['common']['default_app']
|
|
|
|
&& $phpgw_info['user']['apps'][$phpgw_info['user']['preferences']['common']['default_app']])
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
$phpgw->redirect($phpgw->link('/' . $phpgw_info['user']['preferences']['common']['default_app'] . '/' . 'index.php'));
|
2001-04-08 08:54:42 +02:00
|
|
|
$phpgw->common->phpgw_exit();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$phpgw->common->phpgw_header();
|
2001-05-01 11:15:40 +02:00
|
|
|
echo parse_navbar();
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
2001-05-01 11:15:40 +02:00
|
|
|
|
2001-04-08 08:54:42 +02:00
|
|
|
// $phpgw->hooks->proccess("location","mainscreen");
|
|
|
|
// $phpgw->preferences->read_preferences("addressbook");
|
|
|
|
// $phpgw->preferences->read_preferences("email");
|
|
|
|
// $phpgw->preferences->read_preferences("calendar");
|
|
|
|
// $phpgw->preferences->read_preferences("stocks");
|
2001-05-01 11:15:40 +02:00
|
|
|
|
2001-06-06 18:50:44 +02:00
|
|
|
$phpgw->db->query("select app_version from phpgw_applications where app_name='phpgwapi'",__LINE__,__FILE__);
|
|
|
|
if($phpgw->db->next_record())
|
|
|
|
{
|
|
|
|
$apiversion = $phpgw->db->f('app_version');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$phpgw->db->query("select app_version from phpgw_applications where app_name='admin'",__LINE__,__FILE__);
|
|
|
|
$phpgw->db->next_record();
|
|
|
|
$apiversion = $phpgw->db->f('app_version');
|
|
|
|
}
|
2000-11-02 09:52:10 +01:00
|
|
|
|
2001-06-06 18:50:44 +02:00
|
|
|
if ($phpgw_info['server']['versions']['phpgwapi'] > $apiversion)
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
2001-06-06 18:53:37 +02:00
|
|
|
echo '<p><b>' . lang('You are running a newer version of phpGroupWare than your database is setup for') . '.'
|
|
|
|
. '<br>' . lang('It is recommended that you run setup to upgrade your tables to the current version') . '.'
|
2001-06-06 18:50:44 +02:00
|
|
|
. '</b>';
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
2000-11-28 20:54:10 +01:00
|
|
|
|
2001-06-06 18:50:44 +02:00
|
|
|
$phpgw->translation->add_app('mainscreen');
|
|
|
|
if (lang('mainscreen_message') != 'mainscreen_message*')
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
echo '<center>' . stripslashes(lang('mainscreen_message')) . '</center>';
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2001-06-06 18:50:44 +02:00
|
|
|
if ((isset($phpgw_info['user']['apps']['admin']) &&
|
|
|
|
$phpgw_info['user']['apps']['admin']) &&
|
|
|
|
(isset($phpgw_info['server']['checkfornewversion']) &&
|
|
|
|
$phpgw_info['server']['checkfornewversion']))
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
|
|
|
$phpgw->network->set_addcrlf(False);
|
2001-06-06 18:50:44 +02:00
|
|
|
$lines = $phpgw->network->gethttpsocketfile('http://www.phpgroupware.org/currentversion');
|
2001-04-08 08:54:42 +02:00
|
|
|
for ($i=0; $i<count($lines); $i++)
|
|
|
|
{
|
|
|
|
if (ereg("currentversion",$lines[$i]))
|
|
|
|
{
|
|
|
|
$line_found = explode(":",chop($lines[$i]));
|
|
|
|
}
|
|
|
|
}
|
2001-06-06 18:50:44 +02:00
|
|
|
if($phpgw->common->cmp_version($phpgw_info['server']['versions']['phpgwapi'],$line_found[1]))
|
2001-04-08 08:54:42 +02:00
|
|
|
{
|
2001-06-06 18:50:44 +02:00
|
|
|
echo '<p>There is a new version of phpGroupWare available. <a href="'
|
|
|
|
. 'http://www.phpgroupware.org">http://www.phpgroupware.org</a>';
|
2001-04-08 08:54:42 +02:00
|
|
|
}
|
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
?>
|
2001-02-16 05:01:40 +01:00
|
|
|
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
|
|
|
|
var NotifyWindow;
|
|
|
|
|
|
|
|
function opennotifywindow()
|
|
|
|
{
|
|
|
|
if (NotifyWindow)
|
|
|
|
{
|
|
|
|
if (NotifyWindow.closed)
|
|
|
|
{
|
|
|
|
NotifyWindow.stop();
|
|
|
|
NotifyWindow.close();
|
|
|
|
}
|
|
|
|
}
|
2001-06-06 18:50:44 +02:00
|
|
|
NotifyWindow = window.open("<?php echo $phpgw->link('/notify.php')?>", "NotifyWindow", "width=300,height=35,location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=yes");
|
2001-02-16 05:01:40 +01:00
|
|
|
if (NotifyWindow.opener == null)
|
|
|
|
{
|
|
|
|
NotifyWindow.opener = window;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</SCRIPT>
|
2000-08-18 05:24:22 +02:00
|
|
|
|
|
|
|
<?php
|
2001-04-08 08:54:42 +02:00
|
|
|
echo '<p><table border="0" width="100%" align="center">';
|
|
|
|
//Uncomment the next line to enable the notify window. It will not work until a notifywindow app is added.
|
2001-06-13 09:48:20 +02:00
|
|
|
echo '<a href="javascript:opennotifywindow()">' . lang('Open notify window') . '</a>';
|
2001-04-08 08:54:42 +02:00
|
|
|
|
2001-06-07 03:46:12 +02:00
|
|
|
$phpgw->common->hook('home',array('email','calendar','news','addressbook'));
|
2001-04-08 08:54:42 +02:00
|
|
|
|
|
|
|
//$phpgw->common->debug_phpgw_info();
|
|
|
|
//$phpgw->common->debug_list_core_functions();
|
2000-08-18 05:24:22 +02:00
|
|
|
?>
|
|
|
|
<TR><TD></TD></TR>
|
|
|
|
</TABLE>
|
|
|
|
<?php
|
2001-04-08 08:54:42 +02:00
|
|
|
$phpgw->common->phpgw_footer();
|
2001-01-10 06:01:36 +01:00
|
|
|
?>
|