Skip to content

Commit 0e3e3c9

Browse files
author
Marius Cramer
committed
Merge branch 'master' into 'master'
Master
2 parents 3faab0c + cce9d63 commit 0e3e3c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+359
-48
lines changed

install/lib/installer_base.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2161,7 +2161,7 @@ public function install_crontab() {
21612161

21622162
$root_cron_jobs = array(
21632163
"* * * * * ".$install_dir."/server/server.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` \"\$line\" >> ".$conf['ispconfig_log_dir']."/cron.log; done",
2164-
"30 00 * * * ".$install_dir."/server/cron.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` \"\$line\" >> ".$conf['ispconfig_log_dir']."/cron.log; done"
2164+
"* * * * * ".$install_dir."/server/cron.sh 2>&1 > /dev/null | while read line; do echo `/bin/date` \"\$line\" >> ".$conf['ispconfig_log_dir']."/cron.log; done"
21652165
);
21662166

21672167
if ($conf['nginx']['installed'] == true) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ALTER TABLE `client`
2+
ADD `limit_database_quota` int(11) NOT NULL default '-1' AFTER `limit_database`;
3+
ALTER TABLE `client_template`
4+
ADD `limit_database_quota` int(11) NOT NULL default '-1' AFTER `limit_database`;
5+
ALTER TABLE `web_database`
6+
ADD `database_quota` int(11) unsigned DEFAULT NULL AFTER `database_name_prefix`,
7+
ADD `last_quota_notification` date NULL default NULL;

install/sql/ispconfig3.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ CREATE TABLE `client` (
214214
`default_dbserver` int(11) NOT NULL DEFAULT '1',
215215
`dns_servers` blob NOT NULL DEFAULT '',
216216
`limit_database` int(11) NOT NULL DEFAULT '-1',
217+
`limit_database_quota` int(11) NOT NULL default '-1',
217218
`limit_cron` int(11) NOT NULL DEFAULT '0',
218219
`limit_cron_type` enum('url','chrooted','full') NOT NULL DEFAULT 'url',
219220
`limit_cron_frequency` int(11) NOT NULL DEFAULT '5',
@@ -317,6 +318,7 @@ CREATE TABLE `client_template` (
317318
`limit_dns_slave_zone` int(11) NOT NULL default '-1',
318319
`limit_dns_record` int(11) NOT NULL default '-1',
319320
`limit_database` int(11) NOT NULL default '-1',
321+
`limit_database_quota` int(11) NOT NULL default '-1',
320322
`limit_cron` int(11) NOT NULL default '0',
321323
`limit_cron_type` enum('url','chrooted','full') NOT NULL default 'url',
322324
`limit_cron_frequency` int(11) NOT NULL default '5',
@@ -1758,6 +1760,7 @@ CREATE TABLE `web_database` (
17581760
`type` varchar(16) NOT NULL DEFAULT 'y',
17591761
`database_name` varchar(64) DEFAULT NULL,
17601762
`database_name_prefix` varchar(50) NOT NULL default '',
1763+
`database_quota` int(11) unsigned DEFAULT NULL,
17611764
`database_user_id` int(11) unsigned DEFAULT NULL,
17621765
`database_ro_user_id` int(11) unsigned DEFAULT NULL,
17631766
`database_charset` varchar(64) DEFAULT NULL,

install/tpl/server.ini.master

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ php_ini_check_minutes=1
101101
overquota_notify_admin=y
102102
overquota_notify_client=y
103103
overquota_notify_freq=7
104+
overquota_db_notify_admin=y
105+
overquota_db_notify_client=y
104106
overquota_notify_onok=n
105107

106108
[dns]

interface/lib/classes/tools_monitor.inc.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,32 +124,35 @@ function showDatabaseSize () {
124124
$record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'database_size' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc");
125125
if(isset($record['data'])) {
126126
$data = unserialize($record['data']);
127-
/*
128-
Format the data
129-
*/
127+
//* format the data
130128
$html =
131129
'<div class="systemmonitor-state state-'.$record['state'].'">
132130
<div class="systemmonitor-content icons32 ico-'.$record['state'].'">
133-
<table>
134-
<thead>
135-
<tr>
131+
<table><thead><tr>
136132
<td>'.$app->lng("monitor_database_name_txt").'</td>
137133
<td>'.$app->lng("monitor_database_size_txt").'</td>
138134
<td>'.$app->lng("monitor_database_client_txt").'</td>
135+
<td>'.$app->lng("monitor_database_domain_txt").'</td>
139136
</tr>';
140137
foreach($data as $line) {
141138
$html .= '<tr>';
142139
if ($line['size'] > 0) $line['size'] = $app->functions->formatBytes($line['size']);
143-
$t=$app->db->queryOneRecord("SELECT username FROM client WHERE sys_groupid = ".$line['client_id']);
144-
$line['client_id']=$t['username'];
145-
unset($t);
140+
141+
//* get the client
142+
$line['client']=$app->db->queryOneRecord("SELECT client.username FROM web_database, sys_group, client WHERE web_database.sys_groupid = sys_group.groupid AND sys_group.client_id = client.client_id AND web_database.database_name='".$line['database_name']."'")['username'];
143+
144+
//* get the domain
145+
$line['domain']=$app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id=(SELECT parent_domain_id FROM web_database WHERE database_name='".$line['database_name']."')")['domain'];
146+
147+
//* remove the sys_groupid from output
148+
unset($line['sys_groupid']);
149+
146150
foreach ($line as $item) {
147151
$html .= '<td>' . $item . '</td>';
148152
}
149153
$html .= '</tr></tmpl loop>';
150154
}
151-
$html .= '</tbody></table>';
152-
$html .= '</div></div>';
155+
$html .= '</tbody></table></div></div>';
153156
} else {
154157
$html = '<p>'.$app->lng("no_data_database_size_txt").'</p>';
155158
}

interface/web/admin/form/server_config.tform.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,18 @@
688688
'default' => 'y',
689689
'value' => array(0 => 'n', 1 => 'y')
690690
),
691+
'overquota_db_notify_admin' => array(
692+
'datatype' => 'VARCHAR',
693+
'formtype' => 'CHECKBOX',
694+
'default' => 'y',
695+
'value' => array(0 => 'n', 1 => 'y')
696+
),
697+
'overquota_db_notify_client' => array(
698+
'datatype' => 'VARCHAR',
699+
'formtype' => 'CHECKBOX',
700+
'default' => 'y',
701+
'value' => array(0 => 'n', 1 => 'y')
702+
),
691703
'overquota_notify_freq' => array(
692704
'datatype' => 'INTEGER',
693705
'formtype' => 'TEXT',

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,6 @@ $wb["v6_prefix_length"] = 'Prefix too long according to defined IPv6 ';
197197
$wb['backup_dir_is_mount_txt'] = 'Backup directory is a mount?';
198198
$wb['backup_dir_mount_cmd_txt'] = 'Mount command, if backup directory not mounted';
199199
$wb['backup_delete_txt'] = 'Delete backups on domain/website delete';
200+
$wb["overquota_db_notify_admin_txt"] = 'Send DB quota warnings to admin';
201+
$wb["overquota_db_notify_client_txt"] = 'Send DB quota warnings to client';
200202
?>

interface/web/admin/templates/server_config_web_edit.htm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ <h2><tmpl_var name="list_head_txt"></h2>
125125
{tmpl_var name='overquota_notify_client'}
126126
</div>
127127
</div>
128+
<div class="ctrlHolder">
129+
<p class="label">{tmpl_var name='overquota_db_notify_admin_txt'}</p>
130+
<div class="multiField">
131+
{tmpl_var name='overquota_db_notify_admin'}
132+
</div>
133+
</div>
134+
<div class="ctrlHolder">
135+
<p class="label">{tmpl_var name='overquota_db_notify_client_txt'}</p>
136+
<div class="multiField">
137+
{tmpl_var name='overquota_db_notify_client'}
138+
</div>
139+
</div>
128140
<div class="ctrlHolder">
129141
<label for="overquota_notify_freq">{tmpl_var name='overquota_notify_freq_txt'}</label>
130142
<input name="overquota_notify_freq" id="overquota_notify_freq" value="{tmpl_var name='overquota_notify_freq'}" size="40" maxlength="255" type="text" class="textInput" />&nbsp;{tmpl_var name='overquota_notify_freq_note_txt'}

interface/web/client/form/client.tform.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,20 @@
10931093
'rows' => '',
10941094
'cols' => ''
10951095
),
1096+
'limit_database_quota' => array (
1097+
'datatype' => 'INTEGER',
1098+
'formtype' => 'TEXT',
1099+
'validators' => array ( 0 => array ( 'type' => 'ISINT',
1100+
'errmsg'=> 'limit_database_quota_error_notint'),
1101+
),
1102+
'default' => '-1',
1103+
'value' => '',
1104+
'separator' => '',
1105+
'width' => '10',
1106+
'maxlength' => '10',
1107+
'rows' => '',
1108+
'cols' => ''
1109+
),
10961110
'limit_cron' => array (
10971111
'datatype' => 'INTEGER',
10981112
'formtype' => 'TEXT',

interface/web/client/form/client_template.tform.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,20 @@
557557
'rows' => '',
558558
'cols' => ''
559559
),
560+
'limit_database_quota' => array (
561+
'datatype' => 'INTEGER',
562+
'formtype' => 'TEXT',
563+
'validators' => array ( 0 => array ( 'type' => 'ISINT',
564+
'errmsg'=> 'limit_database_quota_error_notint'),
565+
),
566+
'default' => '-1',
567+
'value' => '',
568+
'separator' => '',
569+
'width' => '10',
570+
'maxlength' => '10',
571+
'rows' => '',
572+
'cols' => ''
573+
),
560574
'limit_cron' => array (
561575
'datatype' => 'INTEGER',
562576
'formtype' => 'TEXT',

0 commit comments

Comments
 (0)