Delete extend_expiry settings

This commit is contained in:
iBNu Maksum 2024-10-31 13:15:36 +07:00
parent 80e0dc6485
commit c740820731
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
4 changed files with 31 additions and 44 deletions

View File

@ -172,30 +172,28 @@ class Package
if ($b) { if ($b) {
$lastExpired = Lang::dateAndTimeFormat($b['expiration'], $b['time']); $lastExpired = Lang::dateAndTimeFormat($b['expiration'], $b['time']);
$isChangePlan = false; $isChangePlan = false;
if ($config['extend_expiry'] != 'no') { if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') {
if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') { // if it same internet plan, expired will extend
// if it same internet plan, expired will extend if ($p['validity_unit'] == 'Months') {
if ($p['validity_unit'] == 'Months') { $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months')); $time = $b['time'];
$time = $b['time']; } else if ($p['validity_unit'] == 'Period') {
} else if ($p['validity_unit'] == 'Period') { $date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
$date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months')); $time = date("23:59:00");
$time = date("23:59:00"); } else if ($p['validity_unit'] == 'Days') {
} else if ($p['validity_unit'] == 'Days') { $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days')); $time = $b['time'];
$time = $b['time']; } else if ($p['validity_unit'] == 'Hrs') {
} else if ($p['validity_unit'] == 'Hrs') { $datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours')));
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours'))); $date_exp = $datetime[0];
$date_exp = $datetime[0]; $time = $datetime[1];
$time = $datetime[1]; } else if ($p['validity_unit'] == 'Mins') {
} else if ($p['validity_unit'] == 'Mins') { $datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' minutes')));
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' minutes'))); $date_exp = $datetime[0];
$date_exp = $datetime[0]; $time = $datetime[1];
$time = $datetime[1];
}
} else {
$isChangePlan = true;
} }
} else {
$isChangePlan = true;
} }
//if ($b['status'] == 'on') { //if ($b['status'] == 'on') {

View File

@ -341,12 +341,11 @@ class Radius
// expired user // expired user
if ($expired != '') { if ($expired != '') {
//extend session time only if the plan are the same //extend session time only if the plan are the same
if ($plan['plan_id'] == $p['plan_id'] && $config['extend_expiry'] != 'no') { // session timeout [it reset everyday, am still making my research] we can use it for something like 1H/Day - since it reset daily, and Max-All-Session clear everything
// session timeout [it reset everyday, am still making my research] we can use it for something like 1H/Day - since it reset daily, and Max-All-Session clear everything //$this->upsertCustomer($customer['username'], 'Session-Timeout', 3600); // 3600 = 1 hour
//$this->upsertCustomer($customer['username'], 'Session-Timeout', 3600); // 3600 = 1 hour $this->upsertCustomer($customer['username'], 'Max-All-Session', strtotime($expired) - time());
$this->upsertCustomer($customer['username'], 'Max-All-Session', strtotime($expired) - time()); $this->upsertCustomer($customer['username'], 'Expiration', date('d M Y H:i:s', strtotime($expired)));
$this->upsertCustomer($customer['username'], 'Expiration', date('d M Y H:i:s', strtotime($expired)));
}
// Mikrotik Spesific // Mikrotik Spesific
$this->upsertCustomer( $this->upsertCustomer(
$customer['username'], $customer['username'],

View File

@ -762,5 +762,8 @@
"just_now": "baru saja", "just_now": "baru saja",
"Face_Detection": "Deteksi Wajah", "Face_Detection": "Deteksi Wajah",
"Password_should_be_minimum_6_characters": "Kata sandi minimal harus 6 karakter", "Password_should_be_minimum_6_characters": "Kata sandi minimal harus 6 karakter",
"Username_should_be_between_3_to_45_characters": "Nama pengguna harus terdiri dari 3 hingga 45 karakter" "Username_should_be_between_3_to_45_characters": "Nama pengguna harus terdiri dari 3 hingga 45 karakter",
"Single_session_Admin": "Sesi Tunggal Admin",
"Admin_can_only_have_single_session_login__it_will_logout_another_session": "Admin hanya dapat memiliki login satu sesi, maka akan keluar dari sesi berikutnya",
"For_Registration_and_Update_Phone_Number": "Untuk Registrasi dan Update Nomor Telepon"
} }

View File

@ -130,19 +130,6 @@
{Lang::T('OTP is required when user want to change Email Address')} {Lang::T('OTP is required when user want to change Email Address')}
</p> </p>
</div> </div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Extend Package Expiry')}</label>
<div class="col-md-6">
<select name="extend_expiry" id="extend_expiry" class="form-control">
<option value="yes" {if $_c['extend_expiry']!='no' }selected="selected" {/if}>
{Lang::T('Yes')}</option>
<option value="no" {if $_c['extend_expiry']=='no' }selected="selected" {/if}>
{Lang::T('No')}</option>
</select>
</div>
<p class="help-block col-md-4">
{Lang::T('If user buy same internet plan, expiry date will extend')}</p>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Show Bandwidth Plan')}</label> <label class="col-md-2 control-label">{Lang::T('Show Bandwidth Plan')}</label>
<div class="col-md-6"> <div class="col-md-6">