Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vítězslav Dvořák
ISPConfig 3
Commits
5820c289
Commit
5820c289
authored
Sep 14, 2020
by
Till Brehm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '730-dev' into 'develop'
Backport from !730 See merge request
ispconfig/ispconfig3!1160
parents
8082c2f1
bb6721a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
server/lib/classes/cron.d/300-quota_notify.inc.php
server/lib/classes/cron.d/300-quota_notify.inc.php
+11
-7
No files found.
server/lib/classes/cron.d/300-quota_notify.inc.php
View file @
5820c289
...
...
@@ -49,7 +49,7 @@ class cronjob_quota_notify extends cronjob {
public
function
onRunJob
()
{
global
$app
,
$conf
;
/* used for all monitor cronjobs */
$app
->
load
(
'monitor_tools'
);
$this
->
_tools
=
new
monitor_tools
();
...
...
@@ -88,7 +88,11 @@ class cronjob_quota_notify extends cronjob {
if
(
$rec
[
'traffic_quota_lock'
]
!=
'y'
&&
(
$web_config
[
'overtraffic_notify_admin'
]
==
'y'
||
$web_config
[
'overtraffic_notify_client'
]
==
'y'
))
{
$placeholders
=
array
(
'{domain}'
=>
$rec
[
'domain'
],
'{admin_mail}'
=>
(
$global_config
[
'admin_mail'
]
!=
''
?
$global_config
[
'admin_mail'
]
:
'root'
));
'{admin_mail}'
=>
(
$global_config
[
'admin_mail'
]
!=
''
?
$global_config
[
'admin_mail'
]
:
'root'
),
'{used}'
=>
$web_traffic
,
'{limit}'
=>
$web_traffic_quota
,
'{ratio}'
=>
number_format
((
$web_traffic_quota
>
0
?
$web_traffic
/
$web_traffic_quota
:
0
)
*
100
,
2
,
'.'
,
''
)
.
'%'
);
$recipients
=
array
();
//* send email to admin
...
...
@@ -410,12 +414,12 @@ class cronjob_quota_notify extends cronjob {
$monitor_data
=
array
();
foreach
(
$tmp_rec
as
$tmp_mon
)
{
$tmp_array
=
unserialize
(
$app
->
db
->
unquote
(
$tmp_mon
[
'data'
]));
if
(
is_array
(
$tmp_array
))
if
(
is_array
(
$tmp_array
))
foreach
(
$tmp_array
as
$sys_groupid
=>
$data
)
$monitor_data
[
$data
[
'sys_groupid'
]][]
=
$data
;
}
//* remove duplicates from monitor-data
foreach
(
$monitor_data
as
$_monitor_data
)
foreach
(
$monitor_data
as
$_monitor_data
)
$monitor_data
[
$_monitor_data
[
0
][
'sys_groupid'
]]
=
array_map
(
"unserialize"
,
array_unique
(
array_map
(
"serialize"
,
$_monitor_data
)));
}
...
...
@@ -492,11 +496,11 @@ class cronjob_quota_notify extends cronjob {
$recipients
=
array
();
//* send email to admin
if
(
$global_config
[
'admin_mail'
]
!=
''
&&
$web_config
[
'overquota_db_notify_admin'
]
==
'y'
)
if
(
$global_config
[
'admin_mail'
]
!=
''
&&
$web_config
[
'overquota_db_notify_admin'
]
==
'y'
)
$recipients
[]
=
$global_config
[
'admin_mail'
];
//* Send email to client
if
(
$web_config
[
'overquota_db_notify_client'
]
==
'y'
&&
$client
[
'email'
]
!=
''
)
if
(
$web_config
[
'overquota_db_notify_client'
]
==
'y'
&&
$client
[
'email'
]
!=
''
)
$recipients
[]
=
$client
[
'email'
];
$this
->
_tools
->
send_notification_email
(
'db_quota_ok_notification'
,
$placeholders
,
$recipients
);
...
...
@@ -507,7 +511,7 @@ class cronjob_quota_notify extends cronjob {
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment