module.conf.php 5.97 KB
Newer Older
tbrehm's avatar
tbrehm committed
1
2
<?php

3
4
$userid=$app->auth->get_user_id();

5
6
7
$module["name"]  = "sites";
$module["title"]  = "top_menu_sites";
$module["template"]  = "module.tpl.htm";
8
$module["startpage"]  = "sites/web_vhost_domain_list.php";
tbrehm's avatar
tbrehm committed
9
$module["tab_width"]    = '';
Marius Cramer's avatar
Marius Cramer committed
10
$module['order']    = '30';
tbrehm's avatar
tbrehm committed
11

cfoe's avatar
cfoe committed
12
// Websites menu
13
14
$items=array();

15
if($app->auth->get_client_limit($userid, 'web_domain') != 0)
16
{
17
18
	$items[] = array(   'title'  => "Website",
		'target'  => 'content',
19
		'link' => 'sites/web_vhost_domain_list.php?type=domain',
20
		'html_id'   => 'domain_list');
21
22
}

23
if($app->auth->get_client_limit($userid, 'web_subdomain') != 0)
24
{
25
26
	$items[] = array(   'title'  => "Subdomain",
		'target'  => 'content',
27
		'link'      => 'sites/web_childdomain_list.php?type=subdomain',
28
		'html_id'   => 'childdomain_list');
29
30
31
32
33
34
35

	// read web config
	$app->uses('getconf');
	$sys_config = $app->getconf->get_global_config('sites');
	if($sys_config['vhost_subdomains'] == 'y') {
		$items[] = array(   'title'  => "Subdomain (Vhost)",
			'target'  => 'content',
36
			'link'      => 'sites/web_vhost_domain_list.php?type=subdomain',
37
			'html_id'   => 'childdomain_list');
38
	}
39
40
}

41
if($app->auth->get_client_limit($userid, 'web_aliasdomain') != 0)
42
{
43
44
	$items[] = array(   'title'   => "Aliasdomain",
		'target'  => 'content',
45
		'link'    => 'sites/web_childdomain_list.php?type=aliasdomain',
46
		'html_id' => 'childdomain_list');
Dominik's avatar
Dominik committed
47
48
49
50
51
52
53

	// read web config
	$app->uses('getconf');
	$sys_config = $app->getconf->get_global_config('sites');
	if($sys_config['vhost_aliasdomains'] == 'y') {
		$items[] = array(   'title'  => "Aliasdomain (Vhost)",
				'target'  => 'content',
54
				'link'      => 'sites/web_vhost_domain_list.php?type=aliasdomain',
55
				'html_id'   => 'childdomain_list');
Dominik's avatar
Dominik committed
56
	}
57
58
59
60
}

if(count($items))
{
61
62
63
	$module["nav"][] = array(   'title' => 'Websites',
		'open'  => 1,
		'items' => $items);
64
}
tbrehm's avatar
tbrehm committed
65

cfoe's avatar
cfoe committed
66
// Databases menu
67
if($app->auth->get_client_limit($userid, 'database') != 0 && $app->system->has_service($userid, 'db'))
68
{
69
	$items=array();
cfoe's avatar
cfoe committed
70

71
72
73
74
	$items[] = array(   'title'     => "Database",
		'target'  => 'content',
		'link' => 'sites/database_list.php',
		'html_id'   => 'database_list');
75

cfoe's avatar
cfoe committed
76

77
78
79
80
81
	$items[] = array(   'title'     => "Database User",
		'target'  => 'content',
		'link' => 'sites/database_user_list.php',
		'html_id'   => 'database_user_list'
	);
cfoe's avatar
cfoe committed
82

83
84
85
	$module["nav"][] = array(   'title' => 'Database',
		'open'  => 1,
		'items' => $items);
86
}
87

cfoe's avatar
cfoe committed
88
89
// Web menu
$items=array();
90
if($app->auth->get_client_limit($userid, 'ftp_user') != 0)
91
{
92
93
94
95
	$items[] = array(   'title'     => "FTP-User",
		'target'  => 'content',
		'link' => 'sites/ftp_user_list.php',
		'html_id'   => 'ftp_user_list');
96
}
97

98
if($app->auth->get_client_limit($userid, 'webdav_user') != 0)
99
{
Marius Cramer's avatar
Marius Cramer committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
	$apache_in_use = false;
	$servers = $app->db->queryAllRecords("SELECT * FROM server WHERE web_server = 1 AND active = 1");
	if(is_array($servers) && !empty($servers)){
		foreach($servers as $server){
			$tmp_web_config = $app->getconf->get_server_config($server['server_id'], 'web');
			if(strtolower($tmp_web_config['server_type']) == 'apache'){
				$apache_in_use = true;
				break;
			}
		}
	}

	if($apache_in_use == true){
		$items[] = array(   'title'  => "Webdav-User",
			'target'  => 'content',
			'link' => 'sites/webdav_user_list.php',
			'html_id'   => 'webdav_user_list');
	}
118
}
119

cfoe's avatar
cfoe committed
120
$items[] = array(   'title'     => "Folder",
121
122
123
124
125
126
127
128
129
	'target'  => 'content',
	'link' => 'sites/web_folder_list.php',
	'html_id'   => 'web_folder_list');

$items[] = array(   'title'  => "Folder users",
	'target'  => 'content',
	'link' => 'sites/web_folder_user_list.php',
	'html_id'   => 'web_folder_user_list');

cfoe's avatar
cfoe committed
130
$module["nav"][] = array(   'title' => 'Web Access',
131
132
	'open'  => 1,
	'items' => $items);
133
134


cfoe's avatar
cfoe committed
135
// CMD menu
136
if($app->auth->get_client_limit($userid, 'shell_user') != 0 or $app->auth->get_client_limit($userid, 'cron') != 0)
137
{
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
	$items=array();

	if($app->auth->get_client_limit($userid, 'shell_user') != 0)
	{
		$items[] = array(   'title'     => "Shell-User",
			'target'  => 'content',
			'link' => 'sites/shell_user_list.php',
			'html_id'   => 'shell_user_list');
	}
	if($app->auth->get_client_limit($userid, 'cron') != 0)
	{
		$items[] = array(   'title'   => "Cron Jobs",
			'target'  => 'content',
			'link'    => 'sites/cron_list.php',
			'html_id' => 'cron_list');
	}
	$module["nav"][] = array(   'title' => 'Command Line',
		'open'  => 1,
		'items' => $items);
157
}
cfoe's avatar
cfoe committed
158
159

// APS menu
160
if($app->auth->get_client_limit($userid, 'aps') != 0)
161
{
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
	$items = array();

	$items[] = array(   'title'   => 'Available packages',
		'target'  => 'content',
		'link'    => 'sites/aps_availablepackages_list.php',
		'html_id' => 'aps_availablepackages_list');

	$items[] = array(   'title'   => 'Installed packages',
		'target'  => 'content',
		'link'    => 'sites/aps_installedpackages_list.php',
		'html_id' => 'aps_installedpackages_list');


	// Second menu group, available only for admins
	if($_SESSION['s']['user']['typ'] == 'admin')
	{
		$items[] = array(   'title'   => 'Update Packagelist',
			'target'  => 'content',
			'link'    => 'sites/aps_update_packagelist.php',
			'html_id' => 'aps_packagedetails_show');
	}

	$module['nav'][] = array(   'title' => 'APS Installer',
		'open'  => 1,
		'items' => $items);
187
}
188

cfoe's avatar
cfoe committed
189
// Statistics menu
190
191
$items = array();

cfoe's avatar
cfoe committed
192
$items[] = array(   'title'   => 'Web traffic',
193
194
195
	'target'  => 'content',
	'link'    => 'sites/web_sites_stats.php',
	'html_id' => 'websites_stats');
196

Cédric's avatar
Cédric committed
197
198
199
200
201
$items[] = array(   'title'   => 'FTP traffic',
	'target'  => 'content',
	'link'    => 'sites/ftp_sites_stats.php',
	'html_id' => 'ftpsites_stats');

cfoe's avatar
cfoe committed
202
$items[] = array(   'title'   => 'Website quota (Harddisk)',
203
204
205
	'target'  => 'content',
	'link'    => 'sites/user_quota_stats.php',
	'html_id' => 'user_quota_stats');
206

207
208
209
210
211
$items[] = array(   'title'   => 'Database quota',
	'target'  => 'content',
	'link'    => 'sites/database_quota_stats.php',
	'html_id' => 'databse_quota_stats');

Patrick Anders's avatar
Patrick Anders committed
212
213
214
215
216
217
218
$items[] = array (
	'title'   => 'Backup Stats',
	'target'  => 'content',
	'link'    => 'sites/backup_stats.php',
	'html_id' => 'backup_stats'
);

219
$module['nav'][] = array(   'title' => 'Statistics',
220
221
	'open'  => 1,
	'items' => $items);
222

223
224
// clean up
unset($items);
225
?>