diff --git a/system/controllers/customers.php b/system/controllers/customers.php index 2b8b0987..71e252b4 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -261,6 +261,19 @@ switch ($action) { } r2(U . 'customers/view/' . $id_customer, 'e', 'Cannot find active plan'); break; + case 'login': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $id = $routes['2']; + $customer = ORM::for_table('tbl_customers')->find_one($id); + if($customer){ + $_SESSION['uid'] = $id; + User::setCookie($id); + _alert("You are logging in as $customer[fullname],
don't logout just close tab.", 'info', "home", 10); + } + _alert(Lang::T('Customer not found'), 'danger', "customers"); + break; case 'viewu': $customer = ORM::for_table('tbl_customers')->where('username', $routes['2'])->find_one(); case 'view': diff --git a/system/lan/english.json b/system/lan/english.json index bd424ffa..a692935d 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -847,5 +847,7 @@ "Update_PHPNuxBill": "Update PHPNuxBill", "Ask_Github_Community": "Ask Github Community", "Ask_Telegram_Community": "Ask Telegram Community", - "Transaction_History_List": "Transaction History List" + "Transaction_History_List": "Transaction History List", + "Login_as_Customer": "Login as Customer", + "info": "info" } \ No newline at end of file diff --git a/ui/ui/customers-view.tpl b/ui/ui/customers-view.tpl index 61c9d83d..a33ef136 100644 --- a/ui/ui/customers-view.tpl +++ b/ui/ui/customers-view.tpl @@ -255,16 +255,22 @@
-
+ -