Отказ авторизации при статусе "Отключено из-за вирусов"

Модуль организации Diulup и VPN доступа
Ответить
antoman
Сообщения: 39
Зарегистрирован: Пт май 22, 2015 6:49 am

Отказ авторизации при статусе "Отключено из-за вирусов"

Сообщение antoman »

Поделился myth

В Auth.pm, функция dv_auth() в SQL-запрос добавить:

Код: Выделить всё

AND dv.disable < '6'
Запрос после этого выглядит:

Код: Выделить всё

  $self->query2("SELECT  if (dv.logins=0, if(tp.logins is null, 0, tp.logins), dv.logins) AS logins,
  if(dv.filter_id != '', dv.filter_id, if(tp.filter_id is null, '', tp.filter_id)) AS filter,
  if(dv.ip>0, INET_NTOA(dv.ip), 0) AS ip,
  INET_NTOA(dv.netmask) AS netmask,
  dv.tp_id AS tp_num,
  dv.speed AS user_speed,
  dv.cid,
  
  tp.total_time_limit,
  tp.day_time_limit,
  tp.week_time_limit,
  tp.month_time_limit,
  UNIX_TIMESTAMP(DATE_FORMAT(DATE_ADD(curdate(), INTERVAL 1 MONTH), '%Y-%m-01')) - UNIX_TIMESTAMP() AS time_limit,

  tp.total_traf_limit,
  tp.day_traf_limit,
  tp.week_traf_limit,
  tp.month_traf_limit,
  tp.octets_direction,

  if (count(un.uid) + count(tp_nas.tp_id) = 0, 0,
    if (count(un.uid)>0, 1, 2)) AS nas,

  UNIX_TIMESTAMP() AS session_start,
  UNIX_TIMESTAMP(DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP()), '%Y-%m-%d')) AS day_begin,
  DAYOFWEEK(FROM_UNIXTIME(UNIX_TIMESTAMP())) AS day_of_week,
  DAYOFYEAR(FROM_UNIXTIME(UNIX_TIMESTAMP())) AS day_of_year,
  dv.disable,
  tp.max_session_duration,
  tp.payment_type,
  tp.credit_tresshold,
  tp.rad_pairs AS tp_rad_pairs,
  count(i.id) AS intervals,
  tp.age AS account_age,
  dv.callback,
  dv.port,
  tp.traffic_transfer_period,
  tp.neg_deposit_filter_id,
  tp.ext_bill_account,
  tp.credit AS tp_credit,
  tp.ippool as tp_ippool,
  dv.join_service,
  tp.tp_id,
  tp.active_day_fee,
  tp.neg_deposit_ippool AS neg_deposit_ip_pool,
  dv.expire AS dv_expire
     FROM (dv_main dv)
     LEFT JOIN tarif_plans tp ON (dv.tp_id=tp.id $DOMAIN_ID)
     LEFT JOIN users_nas un ON (un.uid = dv.uid)
     LEFT JOIN tp_nas ON (tp_nas.tp_id = tp.tp_id)
     LEFT JOIN intervals i ON (tp.tp_id = i.tp_id)
     WHERE dv.uid='$self->{UID}'
     AND (dv.expire='0000-00-00' or dv.expire > CURDATE())
     AND dv.disable < '6'
     GROUP BY dv.uid;",
  undef,
  { INFO => 1 }
  );
  

Ответить