$id) { $id = (int)$id; if ($id <= 0 || !isset($selected_set[$id])) continue; $f_dnsname = trim($s_aliases[$i] ?? ''); if ($f_dnsname !== '') { // Удаляем доменную зону из конца $escaped_zone = preg_quote($domain_zone, '/'); $f_dnsname = preg_replace('/\.' . $escaped_zone . '$/i', '', $f_dnsname); $f_dnsname = preg_replace('/\s+/', '-', $f_dnsname); } // Валидация if ( $f_dnsname === '' || !checkValidHostname($f_dnsname) || !checkUniqHostname($db_link, $id, $f_dnsname) ) { continue; } $new = [ 'alias' => $f_dnsname, 'description' => trim($s_descriptions[$i] ?? '') ]; update_record($db_link, "user_auth_alias", "id = ?", $new, [$id]); } } header("Location: " . $page_url); exit; } // Создание нового алиаса if (getPOST("s_create") !== null) { $new_alias = trim(getPOST("s_create_alias", null, '')); if ($new_alias !== '') { $domain_zone = ltrim(get_option($db_link, 33), '.'); $f_dnsname = $new_alias; if ($f_dnsname !== '') { $escaped_zone = preg_quote($domain_zone, '/'); $f_dnsname = preg_replace('/\.' . $escaped_zone . '$/i', '', $f_dnsname); $f_dnsname = preg_replace('/\s+/', '-', $f_dnsname); } if ( $f_dnsname === '' || !checkValidHostname($f_dnsname) || !checkUniqHostname($db_link, $id, $f_dnsname) ) { $msg_error = "DNS $f_dnsname already exists at: " . searchHostname($db_link, $id, $f_dnsname) . " Discard changes!"; $_SESSION[$page_url]['msg'] = $msg_error; LOG_ERROR($db_link, $msg_error); header("Location: " . $_SERVER["REQUEST_URI"]); exit; } $new_rec = [ 'alias' => $f_dnsname, 'auth_id' => $id ]; LOG_INFO($db_link, "Create new alias $new_alias"); insert_record($db_link, "user_auth_alias", $new_rec); } header("Location: " . $page_url); exit; } require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php"); ?>
' . $_SESSION[$page_url]['msg'] . '
'; unset($_SESSION[$page_url]['msg']); } ?>

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } } ?>
id
{$row['id']}
: