276ec7f3eb
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.
18 lines
729 B
PHP
18 lines
729 B
PHP
<?php
|
||
if (!DEFINED('EGP'))
|
||
exit(header('Refresh: 0; URL=http://' . $_SERVER['HTTP_HOST'] . '/404'));
|
||
|
||
if ($user['group'] == 'support' and $user['level'] < 2)
|
||
sys::outjs(array('e' => 'У вас нет доступа к данному действию.'));
|
||
|
||
if ($id) {
|
||
if (in_array($user['group'], array('admin', 'support')))
|
||
$sql->query('UPDATE `help` set `close`="0", `time`="' . $start_point . '" WHERE `id`="' . $id . '" LIMIT 1');
|
||
else
|
||
$sql->query('UPDATE `help` set `close`="0", `time`="' . $start_point . '" WHERE `id`="' . $id . '" AND `user`="' . $user['id'] . '" LIMIT 1');
|
||
|
||
sys::outjs(array('s' => 'ok'));
|
||
}
|
||
|
||
sys::outjs(array('e' => 'Вопрос не найден в базе.'));
|
||
?>
|