Файл: cron.php
Строк: 44
<?
$title = 'Выполнение CRON задачи';
require_once 'api_core/apicms_system.php';
require_once 'api_core/head.php';
if($cron_passwd==''.$_GET['paswd'].''){
$q = mysql_query("SELECT `id`, `wmr`, `login`, `isp_hdd`, `isp_login`, `isp_paswd`, `isp_akt` FROM `users` WHERE `isp_akt` != '0'");
while ($us = mysql_fetch_array($q)){
if($us['isp_akt'] != 0){
$minusbalance = ($us['isp_hdd']/1024)*$info_1gb;
$newbalance = $us['wmr']-$minusbalance;
mysql_query("update `users` set `wmr`='".$newbalance."' WHERE `id`='".$us['id']."'");
echo '<div class="subhead"><b>'.$us['login'].'</b> ('.$us['wmr'].'-'.$minusbalance.'='.$newbalance.') ';
$dolgif = ($us['isp_hdd']/1024*$info_1gb)*3;
$dolgifok = -$dolgif;
if($newbalance <= $dolgifok){
echo'- <font color=red>Удалён</font> </div>';
$requestAddressxmffl = "https://".$server."/manager/ispmgr?func=user.delete&elid=".$us['isp_login']."&out=xml&authinfo=" . $isprootlogin . ":" . $isprootpaswd."";
$xml_strxmffl = file_get_contents($requestAddressxmffl,0);
if(ereg('<ok/>',$xml_strxmffl)){ }
$reguserisp = file_get_contents("https://".$server."/manager/ispmgr?func=user.edit&out=xml&authinfo=".$isprootlogin.":".$isprootpaswd."&sok=yes&name=".$us['isp_login']."&passwd=".$us['isp_paswd']."&confirm=".$us['isp_paswd']."&ip=".$server."&domain=".$us['login'].".".$siteisp."&preset=".$presetapi."&disklimit=512");
if(ereg('<ok/>',$reguserisp)){ }
mysql_query("update `users` set `wmr`='0' WHERE `id`='".$us['id']."'");
mysql_query("update `users` set `isp_akt`='0' WHERE `id`='".$us['id']."'");
mysql_query("update `users` set `isp_hdd`='512' WHERE `id`='".$us['id']."'");
mysql_query("INSERT INTO `api_system` SET
`read` = '0',
`id_user` = '".$us['id']."',
`text` = 'Ваш аккаунт был обнулён из-за высокого долга.',
`ot` = 'Система',
`time` = '".time()."',
`img` = 'robot'");
}else{
echo '</div>';
}
}
}
}else{
header ('Location: /err.php');
}
apicms_foot();
?>