<commit_before><?php

include "./common.php";

if (Config::getSafe('enable_internal_billing', false)){
    $ids = Mysql::getInstance()->from("`users`")
        ->where(array(
            "(TO_DAYS(`expire_billing_date`) - TO_DAYS(NOW())) < 0 AND CAST(`expire_billing_date` AS CHAR) <> '0000-00-00 00:00:00' AND 1=" => 1,
            'status'=>0))
        ->get()->all('id');
    Mysql::getInstance()->update("`users`", array('status'=>1), array(" `id` IN ('" . implode("', '", $ids) . "') AND 1=" => 1, 'status'=>0));
    $online = Middleware::getOnlineUsersId();
    $event = new SysEvent();
    $event->setUserListById(array_intersect($ids, $online));
    $event->sendMsgAndReboot(_('Time of your account is expired'));
}
?><commit_msg>Does not work automatically turn off STB on cron (issue #5555)<commit_after><?php

include "./common.php";

if (Config::getSafe('enable_internal_billing', false)){
    $ids = Mysql::getInstance()->from("`users`")
        ->where(array(
            "(TO_DAYS(`expire_billing_date`) - TO_DAYS(NOW()) - 1) < 0 AND CAST(`expire_billing_date` AS CHAR) <> '0000-00-00 00:00:00' AND 1=" => 1,
            'status'=>0))
        ->get()->all('id');
    Mysql::getInstance()->update("`users`", array('status'=>1), array(" `id` IN ('" . implode("', '", $ids) . "') AND 1=" => 1, 'status'=>0));
    $online = Middleware::getOnlineUsersId();
    $event = new SysEvent();
    $event->setUserListById(array_intersect($ids, $online));
    $event->sendCutOff();
}
?>
{'fraction_non_alphanumeric': 0.23402824478816409, 'fraction_numerical': 0.03295225285810356, 'mean_word_length': 4.078498293515358, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4925086', 'n_tokens_mistral': 556, 'n_tokens_neox': 512, 'n_words': 100}