}
/**
 * HTML for email section end
 * @return void
 */
function get_section_end_for_email()
{
    echo '</tbody></table></div><br />' . "\n";
}
html_page_top(lang_get('manage_email_config'));
print_manage_menu('adm_permissions_report.php');
print_manage_config_menu('manage_config_email_page.php');
$t_access = current_user_get_access_level();
$t_project = helper_get_current_project();
# build a list of all of the actions
$t_actions = email_get_actions();
# build a composite of the status flags, exploding the defaults
$t_global_default_notify_flags = config_get('default_notify_flags', null, ALL_USERS, ALL_PROJECTS);
$g_global_notify_flags = array();
foreach ($t_global_default_notify_flags as $t_flag => $t_value) {
    foreach ($t_actions as $t_action) {
        $g_global_notify_flags[$t_action][$t_flag] = $t_value;
    }
}
$g_global_notify_flags = array_merge_recursive2($g_global_notify_flags, config_get('notify_flags', null, ALL_USERS, ALL_PROJECTS));
$t_file_default_notify_flags = config_get_global('default_notify_flags');
$g_file_notify_flags = array();
foreach ($t_file_default_notify_flags as $t_flag => $t_value) {
    foreach ($t_actions as $t_action) {
        $g_file_notify_flags[$t_action][$t_flag] = $t_value;
    }
require_api('print_api.php');
form_security_validate('manage_config_email_set');
auth_reauthenticate();
$t_can_change_level = min(config_get_access('notify_flags'), config_get_access('default_notify_flags'));
access_ensure_project_level($t_can_change_level);
$t_redirect_url = 'manage_config_email_page.php';
$t_project = helper_get_current_project();
$f_flags = gpc_get('flag', array());
$f_thresholds = gpc_get('flag_threshold', array());
$f_actions_access = gpc_get_int('notify_actions_access');
html_page_top(lang_get('manage_email_config'), $t_redirect_url);
$t_access = current_user_get_access_level();
$t_can_change_flags = $t_access >= config_get_access('notify_flags');
$t_can_change_defaults = $t_access >= config_get_access('default_notify_flags');
# build a list of the possible actions and flags
$t_valid_actions = email_get_actions();
$t_valid_flags = array('reporter', 'handler', 'monitor', 'bugnotes', 'category');
# initialize the thresholds
foreach ($t_valid_actions as $t_action) {
    $t_thresholds_min[$t_action] = NOBODY;
    $t_thresholds_max[$t_action] = ANYBODY;
}
# parse flags and thresholds
foreach ($f_flags as $t_flag_value) {
    list($t_action, $t_flag) = explode(':', $t_flag_value);
    $t_flags[$t_action][$t_flag] = ON;
}
foreach ($f_thresholds as $t_threshold_value) {
    list($t_action, $t_threshold) = explode(':', $t_threshold_value);
    if ($t_threshold < $t_thresholds_min[$t_action]) {
        $t_thresholds_min[$t_action] = $t_threshold;