|
62 | 62 | $array_config_global['two_step_verification'] = $nv_Request->get_int('two_step_verification', 'post', 0);
|
63 | 63 | $array_config_global['admin_2step_opt'] = $nv_Request->get_typed_array('admin_2step_opt', 'post', 'title', []);
|
64 | 64 | $array_config_global['admin_2step_default'] = $nv_Request->get_title('admin_2step_default', 'post', '');
|
| 65 | + $array_config_global['domains_restrict'] = (int) $nv_Request->get_bool('domains_restrict', 'post', false); |
| 66 | + |
| 67 | + $domains = $nv_Request->get_textarea('domains_whitelist', '', NV_ALLOWED_HTML_TAGS, true); |
| 68 | + $domains = explode('<br />', strip_tags($domains, '<br>')); |
| 69 | + |
| 70 | + $array_config_global['domains_whitelist'] = []; |
| 71 | + foreach ($domains as $domain) { |
| 72 | + if (!empty($domain)) { |
| 73 | + $domain = parse_url($domain); |
| 74 | + if (is_array($domain)) { |
| 75 | + if (sizeof($domain) == 1 and !empty($domain['path'])) { |
| 76 | + $domain['host'] = $domain['path']; |
| 77 | + } |
| 78 | + if (!isset($domain['scheme'])) { |
| 79 | + $domain['scheme'] = 'http'; |
| 80 | + } |
| 81 | + $domain_name = nv_check_domain($domain['host']); |
| 82 | + if (!empty($domain_name)) { |
| 83 | + $array_config_global['domains_whitelist'][] = $domain_name; |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | + $array_config_global['domains_whitelist'] = empty($array_config_global['domains_whitelist']) ? '' : json_encode(array_unique($array_config_global['domains_whitelist'])); |
65 | 89 |
|
66 | 90 | if ($array_config_global['login_number_tracking'] < 1) {
|
67 | 91 | $array_config_global['login_number_tracking'] = 5;
|
|
126 | 150 | $array_config_define['nv_anti_iframe'] = NV_ANTI_IFRAME;
|
127 | 151 | $array_config_define['nv_allowed_html_tags'] = NV_ALLOWED_HTML_TAGS;
|
128 | 152 | $array_config_global['admin_2step_opt'] = empty($global_config['admin_2step_opt']) ? [] : explode(',', $global_config['admin_2step_opt']);
|
| 153 | + $array_config_global['domains_whitelist'] = empty($global_config['domains_whitelist']) ? '' : implode("\n", $global_config['domains_whitelist']); |
129 | 154 | }
|
130 | 155 |
|
131 | 156 | $array_config_flood = [];
|
|
556 | 581 | $xtpl->assign('ANTI_IFRAME', $array_config_define['nv_anti_iframe'] ? ' checked="checked"' : '');
|
557 | 582 |
|
558 | 583 | $xtpl->assign('IS_LOGIN_BLOCKER', ($array_config_global['is_login_blocker']) ? ' checked="checked"' : '');
|
| 584 | +$xtpl->assign('DOMAINS_RESTRICT', ($array_config_global['domains_restrict']) ? ' checked="checked"' : ''); |
559 | 585 | $xtpl->assign('LOGIN_NUMBER_TRACKING', $array_config_global['login_number_tracking']);
|
560 | 586 | $xtpl->assign('LOGIN_TIME_TRACKING', $array_config_global['login_time_tracking']);
|
561 | 587 | $xtpl->assign('LOGIN_TIME_BAN', $array_config_global['login_time_ban']);
|
| 588 | +$xtpl->assign('DOMAINS_WHITELIST', $array_config_global['domains_whitelist']); |
562 | 589 |
|
563 | 590 | foreach ($captcha_array as $gfx_chk_i => $gfx_chk_lang) {
|
564 | 591 | $array = array(
|
|
0 commit comments