From aa1dc9eb33b87417d14d92ab87cc3ed6ec6b0760 Mon Sep 17 00:00:00 2001 From: ceb Date: Tue, 29 Oct 2002 23:11:21 +0000 Subject: [PATCH] update --- home.php | 80 +++++++++++++++---------------- phpgwapi/inc/class.common.inc.php | 5 +- 2 files changed, 41 insertions(+), 44 deletions(-) diff --git a/home.php b/home.php index f0be05bc8d..9cb762c95e 100755 --- a/home.php +++ b/home.php @@ -27,14 +27,27 @@ exit; } + if ($GLOBALS['phpgw_info']['server']['force_default_app'] && $GLOBALS['phpgw_info']['server']['force_default_app'] != 'user_choice') + { + $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] = $GLOBALS['phpgw_info']['server']['force_default_app']; + } + + if ($GLOBALS['HTTP_GET_VARS']['cd']=='yes' && $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] + && $GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']]) + { + //$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' . 'index.php')); + Header('Location: ' . $GLOBALS['phpgw']->link('/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' . 'index.php')); + } + else + { $GLOBALS['phpgw_info']['flags'] = array ( - 'noheader' => True, - 'nonavbar' => True, - 'currentapp' => 'home', - 'enable_network_class' => True, - 'enable_contacts_class' => True, - 'enable_nextmatchs_class' => True + 'noheader' => True, + 'nonavbar' => True, + 'currentapp' => 'home', + 'enable_network_class' => True, + 'enable_contacts_class' => True, + 'enable_nextmatchs_class' => True ); include('header.inc.php'); @@ -50,45 +63,34 @@ $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link($GLOBALS['phpgw_forward'],$extra_vars)); } - if ($GLOBALS['phpgw_info']['server']['force_default_app'] && $GLOBALS['phpgw_info']['server']['force_default_app'] != 'user_choice') + $GLOBALS['phpgw']->translation->add_app('mainscreen'); + if (lang('mainscreen_message') != 'mainscreen_message'.lang_char()) { - $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] = $GLOBALS['phpgw_info']['server']['force_default_app']; + echo '
' . stripslashes(lang('mainscreen_message')) . '
'; } - if ($GLOBALS['HTTP_GET_VARS']['cd']=='yes' && $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] - && $GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']]) + if ((isset($GLOBALS['phpgw_info']['user']['apps']['admin']) && + $GLOBALS['phpgw_info']['user']['apps']['admin']) && + (isset($GLOBALS['phpgw_info']['server']['checkfornewversion']) && + $GLOBALS['phpgw_info']['server']['checkfornewversion'])) + { + $GLOBALS['phpgw']->network->set_addcrlf(False); + $lines = $GLOBALS['phpgw']->network->gethttpsocketfile('http://www.phpgroupware.org/currentversion'); + for ($i=0; $iredirect($GLOBALS['phpgw']->link('/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' . 'index.php')); - } - - $GLOBALS['phpgw']->translation->add_app('mainscreen'); - if (lang('mainscreen_message') != 'mainscreen_message'.lang_char()) - { - echo '
' . stripslashes(lang('mainscreen_message')) . '
'; - } - - if ((isset($GLOBALS['phpgw_info']['user']['apps']['admin']) && - $GLOBALS['phpgw_info']['user']['apps']['admin']) && - (isset($GLOBALS['phpgw_info']['server']['checkfornewversion']) && - $GLOBALS['phpgw_info']['server']['checkfornewversion'])) - { - $GLOBALS['phpgw']->network->set_addcrlf(False); - $lines = $GLOBALS['phpgw']->network->gethttpsocketfile('http://www.phpgroupware.org/currentversion'); - for ($i=0; $icommon->cmp_version($GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],$line_found[1])) - { - $message = '

There is a new version of phpGroupWare available. http://www.phpgroupware.org'; - $GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=True; - } + $GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=True; + } - $_found = False; + $_found = False; $GLOBALS['phpgw']->db->query("select app_name,app_version from phpgw_applications",__LINE__,__FILE__); while($GLOBALS['phpgw']->db->next_record()) { @@ -211,8 +213,6 @@ $GLOBALS['phpgw']->preferences->save_repository(); } - if (!$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']) - { - $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->portalbox->output); + $GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->portalbox->output); } ?> diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index 3a8e1fbb25..832e62a594 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -1240,10 +1240,7 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info' switch($GLOBALS['phpgw_info']['flags']['currentapp']) { case 'home': - if (!$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']) - { - $var['home'] = True; - } + $var['home'] = True; break; case 'about': $var['about'] = True;