File: edit_newtmpl.cgi

package info (click to toggle)
webmin-virtual-server 2.50-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,608 kB
  • ctags: 392
  • sloc: perl: 15,687; makefile: 95; sh: 8
file content (39 lines) | stat: -rwxr-xr-x 1,511 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/local/bin/perl
# Display all virtual server templates
# XXX move mysql db template and users into template?
# XXX need template for alias domains, for special Apache directives?

require './virtual-server-lib.pl';
&master_admin() || &error($text{'newtmpl_ecannot'});
&ui_print_header(undef, $text{'newtmpl_title'}, "");

# Show list of templates
@tmpls = &list_templates();
print "<a href='edit_tmpl.cgi?new=1'>$text{'newtmpl_add'}</a>\n";
print "<table border>\n";
print "<tr $tb> <td><b>$text{'newtmpl_name'}</b></td>\n",
      "<td><b>$text{'newtmpl_skel'}</b></td>\n",
      "<td><b>$text{'newtmpl_web'}</b></td>\n",
      "<td><b>$text{'newtmpl_dns'}</b></td>\n",
      "<td><b>$text{'newtmpl_ftp'}</b></td>\n",
      "<td><b>$text{'newtmpl_frame'}</b></td>\n",
      "<td><b>$text{'newtmpl_mail'}</b></td>\n",
      "</tr>\n";
foreach $t (@tmpls) {
	next if ($t->{'deleted'});
	print "<tr $cb>\n";
	print "<td><a href='edit_tmpl.cgi?id=$t->{'id'}'>$t->{'name'}</a></td>\n";
	print "<td>",$t->{'skel'} eq "none" ? $text{'newtmpl_none'} :
		     $t->{'skel'} eq "" ? $text{'default'} :
					  "<tt>$t->{'skel'}</tt>","</td>\n";
	foreach $w ('web', 'dns', 'ftp', 'frame', 'mail_on') {
		print "<td>",$t->{$w} eq "none" ? $text{'newtmpl_none'} :
			     $t->{$w} eq "" ? $text{'default'} :
				      "<i>$text{'newtmpl_cust'}</i>","</td>\n";
		}
	print "</tr>\n";
	}
print "</table>\n";
print "<a href='edit_tmpl.cgi?new=1'>$text{'newtmpl_add'}</a><p>\n";

&ui_print_footer("", $text{'index_return'});