diff --git a/cronjobs/findblock.php b/cronjobs/findblock.php index 5baca289..b7f2393a 100755 --- a/cronjobs/findblock.php +++ b/cronjobs/findblock.php @@ -148,7 +148,7 @@ if (empty($aAllBlocks)) { $log->logError('Failed to create Bonus transaction in database for user ' . $user->getUserName($iAccountId) . ' for block ' . $aBlock['height'] . ': ' . $transaction->getCronError()); } - if ($setting->getValue('disable_notifications') != 1) { + if ($setting->getValue('disable_notifications') != 1 && $setting->getValue('notifications_disable_block') != 1) { // Notify users $aAccounts = $notification->getNotificationAccountIdByType('new_block'); if (is_array($aAccounts)) { diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index c89eb99f..8033cf42 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -271,13 +271,6 @@ $aSettings['system'][] = array( 'name' => 'disable_auto_payouts', 'value' => $setting->getValue('disable_auto_payouts'), 'tooltip' => 'Enable or Disable the payout cronjob. Users will not be able to withdraw any funds automatically if disabled. Will NOT be logged in monitoring page.' ); -$aSettings['system'][] = array( - 'display' => 'Disable notifications', 'type' => 'select', - 'options' => array( 0 => 'No', 1 => 'Yes' ), - 'default' => 0, - 'name' => 'disable_notifications', 'value' => $setting->getValue('disable_notifications'), - 'tooltip' => 'Enable or Disable system notifications. This includes new found blocks, monitoring and all other notifications.' -); $aSettings['system'][] = array( 'display' => 'Disable API', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), @@ -397,4 +390,17 @@ $aSettings['monitoring'][] = array( 'name' => 'monitoring_uptimerobot_api_keys', 'value' => $setting->getValue('monitoring_uptimerobot_api_keys'), 'tooltip' => 'Create per-monitor API keys and save them here to propagate your uptime statistics.' ); - +$aSettings['notifications'][] = array( + 'display' => 'Disable notifications', 'type' => 'select', + 'options' => array( 0 => 'No', 1 => 'Yes' ), + 'default' => 0, + 'name' => 'disable_notifications', 'value' => $setting->getValue('disable_notifications'), + 'tooltip' => 'Enable or Disable system notifications. This includes new found blocks, monitoring and all other notifications.' +); +$aSettings['notifications'][] = array( + 'display' => 'Disable Block Notifications', 'type' => 'select', + 'options' => array( 0 => 'No', 1 => 'Yes'), + 'default' => 0, + 'name' => 'notifications_disable_block', 'value' => $setting->getValue('notifications_disable_block'), + 'tooltip' => 'Enable/Disable block notifications globally. Will remove the user option too.' +); diff --git a/public/include/pages/account/notifications.inc.php b/public/include/pages/account/notifications.inc.php index 4b180f02..09d6b911 100644 --- a/public/include/pages/account/notifications.inc.php +++ b/public/include/pages/account/notifications.inc.php @@ -22,13 +22,16 @@ if ($user->isAuthenticated()) { $aNotifications = $notification->getNofifications($_SESSION['USERDATA']['id']); if (!$aNotifications) $_SESSION['POPUP'][] = array('CONTENT' => 'Could not find any notifications', 'TYPE' => 'errormsg'); + // Fetch global settings + $smarty->assign('DISABLE_BLOCKNOTIFICATIONS', $setting->getValue('notifications_disable_block')); + // Fetch user notification settings $aSettings = $notification->getNotificationSettings($_SESSION['USERDATA']['id']); - + $smarty->assign('NOTIFICATIONS', $aNotifications); $smarty->assign('SETTINGS', $aSettings); $smarty->assign('CONTENT', 'default.tpl'); } } -?> \ No newline at end of file +?> diff --git a/public/templates/mpos/account/notifications/default.tpl b/public/templates/mpos/account/notifications/default.tpl index a8fb4b59..82e80a6d 100644 --- a/public/templates/mpos/account/notifications/default.tpl +++ b/public/templates/mpos/account/notifications/default.tpl @@ -25,6 +25,7 @@ + {if $DISABLE_BLOCKNOTIFICATIONS|default:"" != 1}