fix log that beed IP, that make plugin CLI error

This commit is contained in:
iBNu Maksum 2024-10-24 14:11:10 +07:00
parent 6ffa396b05
commit e8a800bbd6
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
2 changed files with 21 additions and 9 deletions

View File

@ -233,8 +233,12 @@ function _log($description, $type = '', $userid = '0')
} elseif (!empty($_SERVER['HTTP_CLIENT_IP'])) //to check ip from share internet } elseif (!empty($_SERVER['HTTP_CLIENT_IP'])) //to check ip from share internet
{ {
$d->ip = $_SERVER['HTTP_CLIENT_IP']; $d->ip = $_SERVER['HTTP_CLIENT_IP'];
} else { } else if (isset($_SERVER["REMOTE_ADDR"])) {
$d->ip = $_SERVER["REMOTE_ADDR"]; $d->ip = $_SERVER["REMOTE_ADDR"];
} else if (php_sapi_name() == 'cli') {
$d->ip = 'CLI';
} else {
$d->ip = 'Unknown';
} }
$d->save(); $d->save();
} }

View File

@ -866,5 +866,13 @@
"Select_Balance_Package_or_Custom_Amount": "Select Balance Package or Custom Amount", "Select_Balance_Package_or_Custom_Amount": "Select Balance Package or Custom Amount",
"Note": "Note", "Note": "Note",
"Or_custom_balance_amount_below": "Or custom balance amount below", "Or_custom_balance_amount_below": "Or custom balance amount below",
"Input_custom_balance__will_ignore_plan_above": "Input custom balance, will ignore plan above" "Input_custom_balance__will_ignore_plan_above": "Input custom balance, will ignore plan above",
"Cron_has_not_run_for_over_1_hour__Please_check_your_setup_": "Cron has not run for over 1 hour. Please check your setup.",
"Hello": "Hello",
"your_internet_package": "your internet package",
"has_been_expired": "has been expired",
"Welcome_Message": "Welcome Message",
"will_be_replaced_with_Customer_password": "will be replaced with Customer password",
"will_be_replaced_with_Customer_Portal_URL": "will be replaced with Customer Portal URL",
"will_be_replaced_with_Company_Name": "will be replaced with Company Name"
} }