try to cope silently with removed app felamimail set as default_app; improve condition

This commit is contained in:
Klaus Leithoff 2014-06-13 10:04:08 +00:00
parent e0cf9c169d
commit 31ab1c7d7f

View File

@ -96,6 +96,18 @@ if(@file_exists($tpl_info))
} }
} }
// try to switch to mail on startup, if felamimail was called
if ($GLOBALS['egw_info']['user']['preferences']['common']['default_app']=='felamimail' && !isset($GLOBALS['egw_info']['user']['apps']['felamimail']) && isset($GLOBALS['egw_info']['user']['apps']['mail']))
{
$GLOBALS['egw_info']['user']['preferences']['common']['default_app'] ='mail';
if (isset($GLOBALS['egw']->preferences))
{
$GLOBALS['egw']->preferences->add('common','default_app','mail','user');
// save prefs
$GLOBALS['egw']->preferences->save_repository(true);
}
}
// until home works again, we redirect to default_app from prefs (if set and not home) or calendar, if allowed, or first app found // until home works again, we redirect to default_app from prefs (if set and not home) or calendar, if allowed, or first app found
if ($app == 'home' && !$api_requested && !($GLOBALS['egw']->framework instanceof jdots_framework)) if ($app == 'home' && !$api_requested && !($GLOBALS['egw']->framework instanceof jdots_framework))
{ {
@ -114,17 +126,6 @@ if($app == 'home' && !$api_requested && !($windowed && $_GET['cd'] == 'yes' && !
} }
if($GLOBALS['egw_info']['user']['preferences']['common']['default_app'] && !$hasupdates) if($GLOBALS['egw_info']['user']['preferences']['common']['default_app'] && !$hasupdates)
{ {
// try to switch to mail on startup, if felamimail was called
if ($GLOBALS['egw_info']['user']['preferences']['common']['default_app']=='felamimail' && !isset($GLOBALS['egw_info']['user']['apps']['felamimail']) && isset($GLOBALS['egw_info']['user']['apps']['mail']))
{
$GLOBALS['egw_info']['user']['preferences']['common']['default_app'] ='mail';
if (isset($GLOBALS['egw']->preferences))
{
$GLOBALS['egw']->preferences->add('common','default_app','mail','user');
// save prefs
$GLOBALS['egw']->preferences->save_repository(true);
}
}
egw::redirect(egw_framework::index($GLOBALS['egw_info']['user']['preferences']['common']['default_app']),$GLOBALS['egw_info']['user']['preferences']['common']['default_app']); egw::redirect(egw_framework::index($GLOBALS['egw_info']['user']['preferences']['common']['default_app']),$GLOBALS['egw_info']['user']['preferences']['common']['default_app']);
} }
else else