EngineGP/system/sections/web/csbans/free/manage.php
Sergei Solovev 276ec7f3eb Updating the server name reference in code
This change replaces the use of $_SERVER['SERVER_NAME'] with $_SERVER['HTTP_HOST'] throughout the codebase. The modification ensures consistency and compliance with best practices, since $_SERVER['HTTP_HOST'] is often used to extract the host header from an HTTP request. This update may improve compatibility and security, especially in scenarios where the Host header plays a key role in proper server configuration and routing. Please review and test the changes carefully to ensure smooth functionality in different environments.
2023-12-23 04:50:14 +03:00

56 lines
2.3 KiB
PHP

<?php
if (!DEFINED('EGP'))
exit(header('Refresh: 0; URL=http://' . $_SERVER['HTTP_HOST'] . '/404'));
$options = '';
switch ($aWebInstall[$server['game']][$url['subsection']]) {
case 'server':
$sql->query('SELECT `domain`, `passwd`, `config`, `date` FROM `web` WHERE `type`="' . $url['subsection'] . '" AND `server`="' . $id . '" LIMIT 1');
$options = '<option value="' . $id . '">#' . $id . ' ' . $server['name'] . ' (' . $server['address'] . ')</option>';
break;
case 'user':
$sql->query('SELECT `id`, `address`, `name` FROM `servers` WHERE `user`="' . $server['user'] . '" AND `game`="cs" AND (`status`!="overdue" OR `status`!="block")');
while ($sers = $sql->get())
$options .= '<option value="' . $sers['id'] . '">#' . $sers['id'] . ' ' . $sers['name'] . ' (' . $sers['address'] . ')</option>';
$sql->query('SELECT `domain`, `passwd`, `config`, `date` FROM `web` WHERE `type`="' . $url['subsection'] . '" AND `user`="' . $server['user'] . '" LIMIT 1');
break;
case 'unit':
$sql->query('SELECT `id`, `address`, `name` FROM `servers` WHERE `unit`="' . $server['unit'] . '" AND `user`="' . $server['user'] . '" AND `game`="cs" AND (`status`!="overdue" OR `status`!="block")');
while ($sers = $sql->get())
$options .= '<option value="' . $sers['id'] . '">#' . $sers['id'] . ' ' . $sers['name'] . ' (' . $sers['address'] . ')</option>';
$sql->query('SELECT `domain`, `passwd`, `config`, `date` FROM `web` WHERE `type`="' . $url['subsection'] . '" AND `user`="' . $server['user'] . '" AND `unit`="' . $server['unit'] . '" LIMIT 1');
break;
}
if (!$sql->num())
sys::back($cfg['http'] . 'servers/id/' . $id . '/section/web/subsection/' . $url['subsection'] . '/action/install');
$web = $sql->get();
$html->nav('Управление ' . $aWebname[$url['subsection']]);
$html->get('manage', 'sections/web/' . $url['subsection'] . '/free');
$html->set('id', $id);
$html->set('url', $web['domain']);
$html->set('passwd', $web['passwd']);
$html->set('config', base64_decode($web['config']));
$html->set('servers', $options);
if (in_array('update', $aAction[$url['subsection']]))
$html->unit('update', 1);
else
$html->unit('update');
$html->pack('main');
?>