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