Restoring important functionality

This change covers many files necessary for the normal functioning of the control panel. They mainly affect access to an array element.
This commit is contained in:
Sergei Solovev 2023-11-13 01:39:35 +03:00
parent b59003e559
commit 815b67b8fe
17 changed files with 48 additions and 48 deletions

View file

@ -18,7 +18,7 @@ while ($cb = $sql->get($cbs)) {
$html->set('mail', $us['mail']);
$html->set('money', $cb['money'] . ' ' . $cfg['currency']);
$html->set('cashback', ($cb['money'] - ($cb['money'] / 100 * $cfg['part_output_proc'])) . ' ' . $cfg['currency']);
$html->set('type', $cb['purse']{0} == 'R' ? '<span class="text-blue">WebMoney</span>' : '<span class="text-orange">Qiwi</span>');
$html->set('type', $cb['purse'][0] == 'R' ? '<span class="text-blue">WebMoney</span>' : '<span class="text-orange">Qiwi</span>');
$html->set('purse', $cb['purse']);
$html->set('gateway', empty($cfg['part_gateway']) ? 'mm' : 'auto');
$html->set('date', sys::today($cb['date']));

View file

@ -180,7 +180,7 @@ if ($go) {
foreach ($aPacks as $packs)
$spacks .= trim($packs) . ':';
$spacks = isset($spacks{0}) ? substr($spacks, 0, -1) : '';
$spacks = isset($spacks[0]) ? substr($spacks, 0, -1) : '';
$aData['packs'] = $spacks == '' ? 'all' : $spacks;
@ -197,7 +197,7 @@ if ($go) {
$incoms .= intval($incom) . ':';
}
$incoms = isset($incoms{0}) ? substr($incoms, 0, -1) : '';
$incoms = isset($incoms[0]) ? substr($incoms, 0, -1) : '';
$aData['incompatible'] = $incoms;
@ -220,7 +220,7 @@ if ($go) {
$choice .= ' ';
}
$choice = isset($choice{0}) ? substr(trim($choice), 0, -1) : '';
$choice = isset($choice[0]) ? substr(trim($choice), 0, -1) : '';
$aData['choice'] = $choice;
@ -237,7 +237,7 @@ if ($go) {
$requis .= intval($requi) . ':';
}
$requis = isset($requis{0}) ? substr($requis, 0, -1) : '';
$requis = isset($requis[0]) ? substr($requis, 0, -1) : '';
$aData['required'] = $requis;

View file

@ -132,7 +132,7 @@ if ($go) {
$ips .= $ip . ':';
}
$ips = isset($ips{0}) ? substr($ips, 0, -1) : '';
$ips = isset($ips[0]) ? substr($ips, 0, -1) : '';
$aData['ip'] = $ips;
@ -164,7 +164,7 @@ if ($go) {
$list .= intval($pid) . ',';
}
$list = isset($list{0}) ? substr($list, 0, -1) : '';
$list = isset($list[0]) ? substr($list, 0, -1) : '';
if ($list == '')
continue;
@ -190,7 +190,7 @@ if ($go) {
$cores .= intval($core) . ',';
}
$cores = isset($cores{0}) ? substr($cores, 0, -1) : '';
$cores = isset($cores[0]) ? substr($cores, 0, -1) : '';
$aData['core_fix'] = $cores;
@ -207,7 +207,7 @@ if ($go) {
$times .= intval($time) . ':';
}
$times = isset($times{0}) ? substr($times, 0, -1) : '';
$times = isset($times[0]) ? substr($times, 0, -1) : '';
$aData['time'] = $times;
@ -224,7 +224,7 @@ if ($go) {
$timexts .= intval($timext) . ':';
}
$timexts = isset($timexts{0}) ? substr($timexts, 0, -1) : '';
$timexts = isset($timexts[0]) ? substr($timexts, 0, -1) : '';
$aData['timext'] = $timexts;
@ -241,7 +241,7 @@ if ($go) {
$sfps .= intval($fps) . ':';
}
$sfps = isset($sfps{0}) ? substr($sfps, 0, -1) : '';
$sfps = isset($sfps[0]) ? substr($sfps, 0, -1) : '';
$aData['fps'] = $sfps;
@ -258,7 +258,7 @@ if ($go) {
$stick .= intval($tick) . ':';
}
$stick = isset($stick{0}) ? substr($stick, 0, -1) : '';
$stick = isset($stick[0]) ? substr($stick, 0, -1) : '';
$aData['tickrate'] = $stick;
@ -275,7 +275,7 @@ if ($go) {
$sram .= intval($ram) . ':';
}
$sram = isset($sram{0}) ? substr($sram, 0, -1) : '';
$sram = isset($sram[0]) ? substr($sram, 0, -1) : '';
$aData['ram'] = $sram;
@ -292,7 +292,7 @@ if ($go) {
$sprice .= $price . ':';
}
$sprice = isset($sprice{0}) ? substr($sprice, 0, -1) : '';
$sprice = isset($sprice[0]) ? substr($sprice, 0, -1) : '';
$aData['price'] = $sprice;

View file

@ -135,7 +135,7 @@ if ($go) {
$ips .= $ip . ':';
}
$ips = isset($ips{0}) ? substr($ips, 0, -1) : '';
$ips = isset($ips[0]) ? substr($ips, 0, -1) : '';
$aData['ip'] = $ips;
@ -167,7 +167,7 @@ if ($go) {
$list .= intval($pid) . ',';
}
$list = isset($list{0}) ? substr($list, 0, -1) : '';
$list = isset($list[0]) ? substr($list, 0, -1) : '';
if ($list == '')
continue;
@ -193,7 +193,7 @@ if ($go) {
$cores .= intval($core) . ',';
}
$cores = isset($cores{0}) ? substr($cores, 0, -1) : '';
$cores = isset($cores[0]) ? substr($cores, 0, -1) : '';
$aData['core_fix'] = $cores;
@ -210,7 +210,7 @@ if ($go) {
$times .= intval($time) . ':';
}
$times = isset($times{0}) ? substr($times, 0, -1) : '';
$times = isset($times[0]) ? substr($times, 0, -1) : '';
$aData['time'] = $times;
@ -227,7 +227,7 @@ if ($go) {
$timexts .= intval($timext) . ':';
}
$timexts = isset($timexts{0}) ? substr($timexts, 0, -1) : '';
$timexts = isset($timexts[0]) ? substr($timexts, 0, -1) : '';
$aData['timext'] = $timexts;
@ -244,7 +244,7 @@ if ($go) {
$sfps .= intval($fps) . ':';
}
$sfps = isset($sfps{0}) ? substr($sfps, 0, -1) : '';
$sfps = isset($sfps[0]) ? substr($sfps, 0, -1) : '';
$aData['fps'] = $sfps;
@ -261,7 +261,7 @@ if ($go) {
$stick .= intval($tick) . ':';
}
$stick = isset($stick{0}) ? substr($stick, 0, -1) : '';
$stick = isset($stick[0]) ? substr($stick, 0, -1) : '';
$aData['tickrate'] = $stick;
@ -278,7 +278,7 @@ if ($go) {
$sram .= intval($ram) . ':';
}
$sram = isset($sram{0}) ? substr($sram, 0, -1) : '';
$sram = isset($sram[0]) ? substr($sram, 0, -1) : '';
$aData['ram'] = $sram;
@ -295,7 +295,7 @@ if ($go) {
$sprice .= $price . ':';
}
$sprice = isset($sprice{0}) ? substr($sprice, 0, -1) : '';
$sprice = isset($sprice[0]) ? substr($sprice, 0, -1) : '';
$aData['price'] = $sprice;
@ -418,7 +418,7 @@ if ($tarif['game'] == 'cssold') {
foreach ($aPrice as $price)
$sprice .= $price . ':';
$sprice = isset($sprice{0}) ? substr($sprice, 0, -1) : '';
$sprice = isset($sprice[0]) ? substr($sprice, 0, -1) : '';
$tarif['price'] = $sprice;
}
@ -448,7 +448,7 @@ $aPacks = sys::b64djs($tarif['packs']);
foreach ($aPacks as $name => $fullname)
$packs .= '"' . $name . '":"' . $fullname . '",';
$packs = isset($packs{0}) ? substr($packs, 0, -1) : '';
$packs = isset($packs[0]) ? substr($packs, 0, -1) : '';
$html->set('packs', $packs);
@ -459,7 +459,7 @@ $aPlugins = sys::b64djs($tarif['plugins_install']);
foreach ($aPlugins as $pack => $list)
$plugins .= '"' . $pack . '":"' . $list . '",';
$plugins = isset($plugins{0}) ? substr($plugins, 0, -1) : '';
$plugins = isset($plugins[0]) ? substr($plugins, 0, -1) : '';
$html->set('plugins_install', $plugins);

View file

@ -438,7 +438,7 @@ class sys
fclose($stack);
return isset($subnetwork{0}) ? $subnetwork : 'не определена';
return isset($subnetwork[0]) ? $subnetwork : 'не определена';
}
public static function uptime_load($time)

View file

@ -114,10 +114,10 @@ class ftp
}
foreach ($rawlist as $name => $data) {
if ($data['chmod']{0} == 'd')
if ($data['chmod'][0] == 'd')
$aDir[$name] = $data;
elseif ($data['chmod']{0} == '-')
elseif ($data['chmod'][0] == '-')
$aFile[$name] = $data;
}
@ -154,7 +154,7 @@ class ftp
$path = $view['path'];
if ($path{0} != '/') $path = '/' . $path;
if ($path[0] != '/') $path = '/' . $path;
if ($path != '/') $path = $path . '/';
@ -379,7 +379,7 @@ class ftp
$path = $data['dir'];
if ($path{0} != '/') $path = '/' . $path;
if ($path[0] != '/') $path = '/' . $path;
if ($path != '/') $path = $path . '/';
@ -388,7 +388,7 @@ class ftp
$html->set('owner', $info[2]);
$html->set('group', $info[3]);
if ($info[0]{0} == 'd') {
if ($info[0][0] == 'd') {
$html->unit('folder', 1);
$html->unit('file');
$html->set('size', '');

View file

@ -173,7 +173,7 @@ class games
else {
$weeks = $week[1] . ',' . $week[2] . ',' . $week[3] . ',' . $week[4] . ',' . $week[5] . ',' . $week[6] . ',' . $week[7];
$weeks = str_replace(array(',0', '0'), '', $weeks);
$week = $weeks{0} == ',' ? substr($weeks, 1) : $weeks;
$week = $weeks[0] == ',' ? substr($weeks, 1) : $weeks;
}
$cron_task = $time . $week . ' screen -dmS s' . $id . ' bash -c \'cd /var/enginegp && php cron.php ' . $cfg['cron_key'] . ' server_cron ' . $id . ' ' . $cid . '\'';

View file

@ -255,7 +255,7 @@ class SxGeo
foreach ($pack as $p) {
list($type, $name) = explode(':', $p);
$type0 = $type{0};
$type0 = $type[0];
if ($empty) {
$unpacked[$name] = $type0 == 'b' || $type0 == 'c' ? '' : 0;
@ -306,7 +306,7 @@ class SxGeo
$v = unpack('S', $val);
break;
case 'm':
$v = unpack('l', $val . (ord($val{2}) >> 7 ? "\xff" : "\0"));
$v = unpack('l', $val . (ord($val[2]) >> 7 ? "\xff" : "\0"));
break;
case 'M':
$v = unpack('L', $val . "\0");
@ -325,10 +325,10 @@ class SxGeo
break;
case 'n':
$v = current(unpack('s', $val)) / pow(10, $type{1});
$v = current(unpack('s', $val)) / pow(10, $type[1]);
break;
case 'N':
$v = current(unpack('l', $val)) / pow(10, $type{1});
$v = current(unpack('l', $val)) / pow(10, $type[1]);
break;
case 'c':

View file

@ -1024,7 +1024,7 @@ class sys
fclose($stack);
return isset($subnetwork{0}) ? $subnetwork : 'не определена';
return isset($subnetwork[0]) ? $subnetwork : 'не определена';
}
public static function rep_act($name, $time = 20)
@ -1375,7 +1375,7 @@ class sys
foreach ($aTags as $tag)
$text .= '<strong>' . trim($tag) . '</strong>, ';
return isset($text{0}) ? substr($text, 0, -2) : 'отсутствуют';
return isset($text[0]) ? substr($text, 0, -2) : 'отсутствуют';
}
public static function benefitblock($id, $nmch = false)

View file

@ -36,7 +36,7 @@ if ($id) {
$read_now .= '<a href="#' . $reader . '" target="_blank">#' . $reader . ' (' . $aGroup[$group] . ')</a>, ';
}
if (isset($read_now{1}))
if (isset($read_now[1]))
$read_now = substr($read_now, 0, -2);
sys::out($read_now);

View file

@ -44,7 +44,7 @@ if ($id) {
$write_now .= '<a href="#' . $writer . '" target="_blank">#' . $writer . ' (' . $aGroup[$group] . ')</a>, ';
}
if (isset($write_now{1}))
if (isset($write_now[1]))
$write_now = substr($write_now, 0, -2);
sys::out($write_now);

View file

@ -52,7 +52,7 @@ if (isset($url['subsection']) and in_array($url['subsection'], $aSub)) {
$i = 0;
foreach ($aMaps as $index => $map) {
if (!isset($map{3}))
if (!isset($map[3]))
continue;
$mapjs = str_replace('$', '-_-', $map);

View file

@ -51,7 +51,7 @@ if (isset($url['subsection']) and in_array($url['subsection'], $aSub)) {
$i = 0;
foreach ($aMaps as $index => $map) {
if (!isset($map{3}))
if (!isset($map[3]))
continue;
$map = str_replace('./', '', $map);

View file

@ -51,7 +51,7 @@ if (isset($url['subsection']) and in_array($url['subsection'], $aSub)) {
$i = 0;
foreach ($aMaps as $index => $map) {
if (!isset($map{3}))
if (!isset($map[3]))
continue;
$mapjs = str_replace('$', '-_-', $map);

View file

@ -51,7 +51,7 @@ if (isset($url['subsection']) and in_array($url['subsection'], $aSub)) {
$i = 0;
foreach ($aMaps as $index => $map) {
if (!isset($map{3}))
if (!isset($map[3]))
continue;
$mapjs = str_replace('$', '-_-', $map);

View file

@ -92,7 +92,7 @@ else {
$bytes = $server['hdd'] * 1048576;
$server['ftp_passwd'] = isset($server['ftp_passwd']{1}) ? $server['ftp_passwd'] : sys::passwd(8);
$server['ftp_passwd'] = isset($server['ftp_passwd'][1]) ? $server['ftp_passwd'] : sys::passwd(8);
$qSql = 'DELETE FROM users WHERE username=\'' . $server['uid'] . '\';'
. 'DELETE FROM quotalimits WHERE name=\'' . $server['uid'] . '\';'
@ -165,7 +165,7 @@ else {
case 'search':
$text = isset($_POST['find']) ? sys::first(explode('.', json_decode($_POST['find']))) : sys::out();
if (!isset($text{2}))
if (!isset($text[2]))
sys::out('Для выполнения поиска, необходимо больше данных');
$ftp->search($text, $id);

View file

@ -71,7 +71,7 @@ if ($user['patronymic']) $html->unit('patronymic', true); else $html->unit('patr
if ($user['name'] || $user['lastname'] || $user['patronymic']) $html->unit('nlp', true); else $html->unit('nlp');
if (isset($user['wmr']{0}) and in_array($user['wmr']{0}, array('R', 'Z', 'U')))
if (isset($user['wmr'][0]) and in_array($user['wmr'][0], array('R', 'Z', 'U')))
$html->unit('wmr', true, true);
else
$html->unit('wmr', false, true);