From 185c36cdfe466a0dfcbfb633846d3548952bf24d Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Mon, 7 Aug 2023 09:24:07 +0200 Subject: [PATCH] [Web] catch update_sogo exceptions --- data/web/inc/functions.mailbox.inc.php | 46 ++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index d76b8fa50..457b53d60 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -1325,8 +1325,16 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { 'rl_value' => $_data['rl_value'] ), $_extra); } - - update_sogo_static_view($username); + + try { + update_sogo_static_view($username); + }catch (PDOException $e) { + $_SESSION['return'][] = array( + 'type' => 'success', + 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), + 'msg' => $e->getMessage() + ); + } $_SESSION['return'][] = array( 'type' => 'success', 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), @@ -3247,7 +3255,15 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { 'msg' => array('mailbox_modified', $username) ); - update_sogo_static_view($username); + try { + update_sogo_static_view($username); + }catch (PDOException $e) { + $_SESSION['return'][] = array( + 'type' => 'success', + 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), + 'msg' => $e->getMessage() + ); + } } return true; break; @@ -5467,8 +5483,16 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); continue; } - - update_sogo_static_view($username); + + try { + update_sogo_static_view($username); + }catch (PDOException $e) { + $_SESSION['return'][] = array( + 'type' => 'success', + 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), + 'msg' => $e->getMessage() + ); + } $_SESSION['return'][] = array( 'type' => 'success', 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), @@ -5681,8 +5705,16 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { } break; } - if ($_action != 'get' && in_array($_type, array('domain', 'alias', 'alias_domain', 'resource')) && getenv('SKIP_SOGO') != "y") { - update_sogo_static_view(); + if ($_action != 'get' && in_array($_type, array('domain', 'alias', 'alias_domain', 'resource')) && getenv('SKIP_SOGO') != "y") { + try { + update_sogo_static_view(); + }catch (PDOException $e) { + $_SESSION['return'][] = array( + 'type' => 'success', + 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), + 'msg' => $e->getMessage() + ); + } } return true;