Example #1
0
 for ($i = 0; $i < count($times_d); ++$i) {
     $end = $i < count($times_d) - 1 ? "," : "";
     $logintime .= $times_d[$i] . addlzeroes($times_hf[$i]) . addlzeroes($times_mf[$i]) . "-" . addlzeroes($times_ht[$i]) . addlzeroes($times_mt[$i]) . $end;
 }
 //if($vars[1]!=$vars[2])$error.="<br><b>Ошибка!</b> Введённые пароли не совпадают!!!<br>";
 $data = array();
 $data['packet'] = addslashes($vars[0]);
 $data['blocked'] = "" . !$activated;
 $data['total_time_limit'] = timeinsec($time_vals[0], $time_vals[1], $time_vals[2]);
 $data['month_time_limit'] = timeinsec($time_vals[3], $time_vals[4], $time_vals[5]);
 $data['week_time_limit'] = timeinsec($time_vals[6], $time_vals[7], $time_vals[8]);
 $data['day_time_limit'] = timeinsec($time_vals[9], $time_vals[10], $time_vals[11]);
 $data['total_traffic_limit'] = mb2bytes($vars[1]);
 $data['month_traffic_limit'] = mb2bytes($vars[2]);
 $data['week_traffic_limit'] = mb2bytes($vars[3]);
 $data['day_traffic_limit'] = mb2bytes($vars[4]);
 $data['login_time'] = $logintime;
 $data['simultaneous_use'] = (int) $vars[6];
 $data['port_limit'] = (int) $vars[5];
 $data['session_timeout'] = timeinsec($time_vals[12], $time_vals[13], $time_vals[14]);
 $data['idle_timeout'] = (int) $vars[7];
 $data['level'] = (int) $vars[8];
 $data['prim'] = addslashes($FLTR->DirectProcessText($vars[9], 1, 1));
 $data['rang'] = (int) $vars[10];
 $data['exceed_times'] = (int) $vars[11];
 if ($data['blocked'] != 1) {
     $data['blocked'] = "0";
 }
 if (!$data['packet']) {
     $error .= "<br><b>Ошибка!</b> Необходимо ввести название тарифа!!!<br>";
 }
Example #2
0
<?php

if ($BILLEVEL < 5) {
    return;
}
$BILL = new CBilling($GV["dbhost"], $GV["dbname"], $GV["dblogin"], $GV["dbpassword"]);
$BILL->KillInactiveUsers();
$list = $BILL->GetOnlineUsersData();
if (!isset($action)) {
    $action = "";
}
if ($action == "save") {
    $error = "";
    $GV['max_month_traffic'] = mb2bytes($max_month_traffic);
    $GV['start_year'] = $start_year;
    $res = "<?php\r\n";
    $res .= "\$GV['start_year']=" . $GV['start_year'] . ";\r\n";
    $res .= "\$GV['max_month_traffic']=" . $GV['max_month_traffic'] . ";\r\n";
    $res .= "\$GV['max_month_time']=" . $GV['max_month_time'] . ";\r\n";
    $res .= "?>";
    $fp = fopen($GV["modules_conf_dir"] . "/smadbisext.conf.php", "w+");
    if (!$fp) {
        $error .= "<b>Ошибка:</b> Невозможно открыть файл!";
    }
    if (!$error) {
        fwrite($fp, $res);
        fclose($fp);
    }
    if (!$error) {
        OUT("<div align=center>Сохранено!</div><br><div align=center><a href=\"?p={$p}&act={$act}\">назад</a></div>");
    } else {