display better exception for traffic results if admin has no customers
This commit is contained in:
@@ -37,6 +37,9 @@ if ($page == 'overview' || $page == 'customers') {
|
||||
try {
|
||||
$context = Traffic::getCustomerStats($userinfo, $range);
|
||||
} catch (Exception $e) {
|
||||
if ($e->getCode() === 405) {
|
||||
Response::dynamicError(lng('traffic.nocustomers'));
|
||||
}
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -470,7 +470,7 @@ abstract class ApiCommand extends ApiParameter
|
||||
*
|
||||
* @param string $customer_hide_option
|
||||
* optional, when called as customer, some options might be hidden due to the
|
||||
* panel.customer_hide_options ettings
|
||||
* panel.customer_hide_options settings
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
|
||||
@@ -2117,6 +2117,7 @@ Vielen Dank, Ihr Administrator',
|
||||
'http' => 'HTTP',
|
||||
'ftp' => 'FTP',
|
||||
'mail' => 'Mail',
|
||||
'nocustomers' => 'Es wird mindestens ein Kunde benötigt um die Traffic Statistiken anzuzeigen.',
|
||||
],
|
||||
'translator' => '',
|
||||
'update' => [
|
||||
|
||||
@@ -2243,6 +2243,7 @@ Yours sincerely, your administrator',
|
||||
'http' => 'HTTP',
|
||||
'ftp' => 'FTP',
|
||||
'mail' => 'Mail',
|
||||
'nocustomers' => 'You need at least one customer to view the traffic reports.',
|
||||
],
|
||||
'translator' => '',
|
||||
'update' => [
|
||||
|
||||
Reference in New Issue
Block a user