Skip to content

Commit f5ea1b4

Browse files
committed
Implemented: FS#1418 - Change optionally the owner of the backup dir to the website user
- Added Limit fields for openvz in the database - Limited several vm functions to be used by admin only.
1 parent 9c9382e commit f5ea1b4

14 files changed

+34
-8
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE `cron` CHANGE `command` `command` TEXT NOT NULL;
2+
ALTER TABLE `client` ADD `limit_openvz_vm` int(11) NOT NULL DEFAULT '0' AFTER `limit_mailmailinglist` ,
3+
ADD `limit_openvz_vm_template_id` int(11) NOT NULL DEFAULT '0' AFTER `limit_openvz_vm`;

install/sql/ispconfig3.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ CREATE TABLE `client` (
130130
`limit_traffic_quota` int(11) NOT NULL DEFAULT '-1',
131131
`limit_client` int(11) NOT NULL DEFAULT '0',
132132
`limit_mailmailinglist` int(11) NOT NULL DEFAULT '-1',
133+
`limit_openvz_vm` int(11) NOT NULL DEFAULT '0',
134+
`limit_openvz_vm_template` int(11) NOT NULL DEFAULT '0',
133135
`parent_client_id` int(11) unsigned NOT NULL DEFAULT '0',
134136
`username` varchar(64) DEFAULT NULL,
135137
`password` varchar(64) DEFAULT NULL,
@@ -222,7 +224,7 @@ CREATE TABLE `cron` (
222224
`server_id` int(11) unsigned NOT NULL default '0',
223225
`parent_domain_id` int(11) unsigned NOT NULL default '0',
224226
`type` enum('url','chrooted','full') NOT NULL default 'url',
225-
`command` varchar(255) NOT NULL,
227+
`command` TEXT NOT NULL,
226228
`run_min` varchar(100) NULL,
227229
`run_hour` varchar(100) NULL,
228230
`run_mday` varchar(100) NULL,

interface/web/vm/form/openvz_vm.tform.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
)
165165
);
166166

167+
if($_SESSION["s"]["user"]["typ"] == 'admin') {
167168
$form["tabs"]['advanced'] = array (
168169
'title' => "Advanced",
169170
'width' => 100,
@@ -292,6 +293,7 @@
292293
##################################
293294
)
294295
);
296+
}
295297

296298

297299
?>

interface/web/vm/lib/module.conf.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'link' => 'vm/openvz_vm_list.php',
1515
'html_id' => 'openvz_vm_list');
1616

17+
if($_SESSION["s"]["user"]["typ"] == 'admin') {
1718
$items[] = array( 'title' => 'OS Templates',
1819
'target' => 'content',
1920
'link' => 'vm/openvz_ostemplate_list.php',
@@ -28,7 +29,7 @@
2829
'target' => 'content',
2930
'link' => 'vm/openvz_ip_list.php',
3031
'html_id' => 'openvz_ip_list');
31-
32+
}
3233
if(count($items))
3334
{
3435
$module['nav'][] = array( 'title' => 'OpenVZ',

interface/web/vm/openvz_ip_del.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
//* Check permissions for module
4646
$app->auth->check_module_permissions('vm');
47+
if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied');
4748

4849
$app->uses('tpl,tform');
4950
$app->load('tform_actions');

interface/web/vm/openvz_ip_edit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
//* Check permissions for module
4545
$app->auth->check_module_permissions('vm');
46+
if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied');
4647

4748
// Loading classes
4849
$app->uses('tpl,tform');

interface/web/vm/openvz_ip_list.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
//* Check permissions for module
4545
$app->auth->check_module_permissions('vm');
46+
if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied');
4647

4748
$app->uses('listform_actions');
4849

interface/web/vm/openvz_ostemplate_del.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
//* Check permissions for module
4646
$app->auth->check_module_permissions('vm');
47+
if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied');
4748

4849
$app->uses('tpl,tform');
4950
$app->load('tform_actions');

interface/web/vm/openvz_ostemplate_edit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
//* Check permissions for module
4545
$app->auth->check_module_permissions('vm');
46+
if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied');
4647

4748
// Loading classes
4849
$app->uses('tpl,tform');

interface/web/vm/openvz_ostemplate_list.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
//* Check permissions for module
4545
$app->auth->check_module_permissions('vm');
46+
if($_SESSION["s"]["user"]["typ"] != 'admin') die('permission denied');
4647

4748
$app->uses('listform_actions');
4849

0 commit comments

Comments
 (0)