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
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
Massimiliano
ISPConfig 3
Commits
e4f5781e
Commit
e4f5781e
authored
Aug 08, 2018
by
Jesse Norell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix db quota messages
parent
e8f8b1f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
server/lib/classes/cron.d/100-monitor_database_size.inc.php
server/lib/classes/cron.d/100-monitor_database_size.inc.php
+2
-2
server/lib/classes/db_mysql.inc.php
server/lib/classes/db_mysql.inc.php
+2
-2
No files found.
server/lib/classes/cron.d/100-monitor_database_size.inc.php
View file @
e4f5781e
...
...
@@ -95,12 +95,12 @@ class cronjob_monitor_database_size extends cronjob {
if
(
!
is_numeric
(
$quota
))
continue
;
if
(
$quota
<
1
||
$quota
>
$data
[
$i
][
'size'
])
{
print
$rec
[
'database_name'
]
.
' does not exceed quota qize: '
.
$quota
.
' > '
.
$data
[
$i
][
'size'
]
.
"
\n
"
;
print
'database '
.
$rec
[
'database_name'
]
.
' size does not exceed quota: '
.
$quota
.
' (quota) > '
.
$data
[
$i
][
'size'
]
.
" (used)
\n
"
;
if
(
$rec
[
'quota_exceeded'
]
==
'y'
)
{
$app
->
dbmaster
->
datalogUpdate
(
'web_database'
,
array
(
'quota_exceeded'
=>
'n'
),
'database_id'
,
$rec
[
'database_id'
]);
}
}
elseif
(
$rec
[
'quota_exceeded'
]
==
'n'
)
{
print
$rec
[
'database_name'
]
.
' exceeds quota qize: '
.
$quota
.
' < '
.
$data
[
$i
][
'size'
]
.
"
\n
"
;
print
'database '
.
$rec
[
'database_name'
]
.
' size exceeds quota: '
.
$quota
.
' (quota) < '
.
$data
[
$i
][
'size'
]
.
" (used)
\n
"
;
$app
->
dbmaster
->
datalogUpdate
(
'web_database'
,
array
(
'quota_exceeded'
=>
'y'
),
'database_id'
,
$rec
[
'database_id'
]);
}
}
...
...
server/lib/classes/db_mysql.inc.php
View file @
e4f5781e
...
...
@@ -634,12 +634,12 @@ class db
$result
=
$this
->
_query
(
"SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='"
.
$this
->
escape
(
$database_name
)
.
"'"
);
if
(
!
$result
)
{
$this
->
_sqlerror
(
'Unable to
get the database-size for
'
.
$database_name
);
$this
->
_sqlerror
(
'Unable to
determine the size of database
'
.
$database_name
);
return
;
}
$database_size
=
$result
->
getAsRow
();
$result
->
free
();
return
$database_size
[
0
]
;
return
$database_size
[
0
]
?
$database_size
[
0
]
:
0
;
}
//** Function to fill the datalog with a full differential record.
...
...
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