Compare commits
396 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6211aff2e | ||
|
|
afebdc912c | ||
|
|
96395b1592 | ||
|
|
e158eb6005 | ||
|
|
38d0188a66 | ||
|
|
8f29bb20e4 | ||
|
|
d84df45886 | ||
|
|
ad61b5972b | ||
|
|
90c002ae8c | ||
|
|
38a80244db | ||
|
|
3d314a24dc | ||
|
|
4b92766495 | ||
|
|
1705bab13e | ||
|
|
4ede4520e4 | ||
|
|
61806a8799 | ||
|
|
82be6e142f | ||
|
|
aa5443881c | ||
|
|
617b731671 | ||
|
|
166df0cb92 | ||
|
|
b32c5a01c7 | ||
|
|
4e21e753f4 | ||
|
|
c0c993efec | ||
|
|
14b5ae8b4f | ||
|
|
f4c367f2ae | ||
|
|
c4a2bb6cd7 | ||
|
|
06beb70568 | ||
|
|
d03dcf02d2 | ||
|
|
e9d58bdd42 | ||
|
|
61000107b8 | ||
|
|
8f6a2ac462 | ||
|
|
291ba25691 | ||
|
|
1550e9e639 | ||
|
|
7ac4a389fb | ||
|
|
394ca56f4b | ||
|
|
612e2ceb21 | ||
|
|
76f9bea696 | ||
|
|
011e76c90a | ||
|
|
65a0ced403 | ||
|
|
85d303def9 | ||
|
|
a57af8c481 | ||
|
|
5f5a2b606f | ||
|
|
76f15dd28f | ||
|
|
7abb43c67f | ||
|
|
0533ce55c4 | ||
|
|
745261d663 | ||
|
|
894beb251e | ||
|
|
bd12983a77 | ||
|
|
8df0c4dc41 | ||
|
|
bcf2e0879a | ||
|
|
023f1b88b1 | ||
|
|
4c0ac21dc7 | ||
|
|
8de2847fe5 | ||
|
|
a294083e12 | ||
|
|
52588da598 | ||
|
|
094f6e3f03 | ||
|
|
f15a13bb38 | ||
|
|
0edfee6da2 | ||
|
|
ef40015214 | ||
|
|
6a2125a891 | ||
|
|
94a3c27166 | ||
|
|
d0511685a7 | ||
|
|
4b57b06b04 | ||
|
|
381aedcafe | ||
|
|
2c86164b6b | ||
|
|
dbb09b5278 | ||
|
|
4907aeb2dd | ||
|
|
b62fb504ac | ||
|
|
e6795f28f9 | ||
|
|
0a6c67e55f | ||
|
|
3d443b378a | ||
|
|
f698c0c548 | ||
|
|
87d7eec743 | ||
|
|
d82e89fb6b | ||
|
|
39bfa013f5 | ||
|
|
2687db85c7 | ||
|
|
a659146025 | ||
|
|
eb998dc84d | ||
|
|
e92a17c417 | ||
|
|
d754624baa | ||
|
|
295f98c694 | ||
|
|
74716f5d3f | ||
|
|
37453226da | ||
|
|
05475f051c | ||
|
|
7b2456aba5 | ||
|
|
3f1a9a5d8b | ||
|
|
0d1ced583f | ||
|
|
d1fa6cea55 | ||
|
|
e7f7aaaad5 | ||
|
|
5991d905e3 | ||
|
|
7062406267 | ||
|
|
a249e9be00 | ||
|
|
e3212d7f94 | ||
|
|
c39b7fdc50 | ||
|
|
1ff0ee36e4 | ||
|
|
1763f9e4cc | ||
|
|
ec622fdf95 | ||
|
|
ab00e4c7df | ||
|
|
825842267a | ||
|
|
c75346ec93 | ||
|
|
4f49d74def | ||
|
|
6a97bf2ebf | ||
|
|
dd4adbba77 | ||
|
|
a7ca787c16 | ||
|
|
782f9ca351 | ||
|
|
ad70a474d9 | ||
|
|
79badb6f58 | ||
|
|
b67f7c1e65 | ||
|
|
29517915f9 | ||
|
|
9cef9452d1 | ||
|
|
661bb957f9 | ||
|
|
f42b7436f3 | ||
|
|
f6adfaa856 | ||
|
|
42d1bfaf96 | ||
|
|
04a9b8785d | ||
|
|
424c475b5f | ||
|
|
45e5049012 | ||
|
|
26d19cb0d7 | ||
|
|
38e9df8f48 | ||
|
|
b4603b6030 | ||
|
|
163480b859 | ||
|
|
ad9a5d7871 | ||
|
|
693eda3971 | ||
|
|
d2932b3ed7 | ||
|
|
7fc6336f8f | ||
|
|
49bbb04750 | ||
|
|
d5892ed348 | ||
|
|
f550ffe799 | ||
|
|
9ab8908710 | ||
|
|
88de56f447 | ||
|
|
f7fb861e73 | ||
|
|
21c47af212 | ||
|
|
2c6533146d | ||
|
|
44909997d0 | ||
|
|
b0c26867fe | ||
|
|
1a953bf2fe | ||
|
|
3a67aa1071 | ||
|
|
676f369cd3 | ||
|
|
e65a5718d6 | ||
|
|
8daba09826 | ||
|
|
f74ef12e70 | ||
|
|
5a818ce701 | ||
|
|
ca35844f82 | ||
|
|
3672394e2e | ||
|
|
cd341663a1 | ||
|
|
3c15d076d5 | ||
|
|
8779372aec | ||
|
|
187914b069 | ||
|
|
30b9858417 | ||
|
|
19070f3383 | ||
|
|
7a5e917d34 | ||
|
|
3b86ebed97 | ||
|
|
6fb8de6e37 | ||
|
|
9a06472017 | ||
|
|
2b77a405ff | ||
|
|
e3792a48e0 | ||
|
|
389d107a39 | ||
|
|
7142ae8620 | ||
|
|
1d414e1533 | ||
|
|
2e4d3c8ccf | ||
|
|
f2687a20d1 | ||
|
|
9f42eaf58f | ||
|
|
027578312a | ||
|
|
f144517e6c | ||
|
|
41f6eaf1f1 | ||
|
|
fa0fcf52c1 | ||
|
|
c6419a471e | ||
|
|
1a296d9579 | ||
|
|
bf74599502 | ||
|
|
8c2ae56298 | ||
|
|
ccace2ce81 | ||
|
|
f1b2adaa59 | ||
|
|
e5e4b65faf | ||
|
|
d3d33af3c0 | ||
|
|
13db341e50 | ||
|
|
16859a87fd | ||
|
|
27e3b7cbed | ||
|
|
e1816a9e3c | ||
|
|
d625a5d2f9 | ||
|
|
43832c8ed9 | ||
|
|
c8e94c8cdc | ||
|
|
f2ca4e1fdd | ||
|
|
b014291882 | ||
|
|
6d96dd6a13 | ||
|
|
3d73e2faae | ||
|
|
d180b0a0f4 | ||
|
|
62d2a6d0e8 | ||
|
|
a57151c7bd | ||
|
|
5c7494cccd | ||
|
|
7fb5e74e2b | ||
|
|
e098d614cb | ||
|
|
2a01e93371 | ||
|
|
c57fba5b57 | ||
|
|
cd5616a6c0 | ||
|
|
7bceedfe42 | ||
|
|
669af033d1 | ||
|
|
eef79887ee | ||
|
|
25f01179a3 | ||
|
|
0185397a0c | ||
|
|
e8a875fc29 | ||
|
|
ec216a0115 | ||
|
|
87c8146698 | ||
|
|
9f2ef4c91a | ||
|
|
20f40d0d38 | ||
|
|
9ea1f0ad52 | ||
|
|
989e15d4cd | ||
|
|
5204bd1a1b | ||
|
|
72cce4349b | ||
|
|
2574e2012f | ||
|
|
fbef076ebc | ||
|
|
3c5e065edc | ||
|
|
84a7279442 | ||
|
|
435c55039e | ||
|
|
4aa80112c4 | ||
|
|
a1d09c977f | ||
|
|
67f8f9ccd6 | ||
|
|
c23c334eed | ||
|
|
e94b819b7b | ||
|
|
4c7eb9ccb2 | ||
|
|
a1b497dc72 | ||
|
|
7064fc4708 | ||
|
|
29960cfe92 | ||
|
|
ec1a1ed023 | ||
|
|
a97bf30bd8 | ||
|
|
b640e87969 | ||
|
|
3026a51a1f | ||
|
|
e9bcccfc8c | ||
|
|
b32fb2da61 | ||
|
|
b7758a8bcd | ||
|
|
65aaf7ad92 | ||
|
|
296a904e78 | ||
|
|
5f32e6e80e | ||
|
|
a29a356689 | ||
|
|
1cb39a681c | ||
|
|
e1a61d7815 | ||
|
|
8b60a24251 | ||
|
|
bf46fe67b8 | ||
|
|
760e0e3152 | ||
|
|
b1a2b5dfc9 | ||
|
|
86e1493dee | ||
|
|
74e37099fd | ||
|
|
fe81978900 | ||
|
|
3f1c4a23ad | ||
|
|
21faef0804 | ||
|
|
ed7997d306 | ||
|
|
ba10eb4173 | ||
|
|
ea741f002d | ||
|
|
6948205ebe | ||
|
|
4c686dbd1d | ||
|
|
6ad8c64c31 | ||
|
|
cc70ab2f39 | ||
|
|
1019a2697a | ||
|
|
214b5f3e61 | ||
|
|
379cf53076 | ||
|
|
285815cab2 | ||
|
|
8cdd3eeeab | ||
|
|
acec438536 | ||
|
|
98c2ce24c1 | ||
|
|
b049ba6c3b | ||
|
|
f153590cf2 | ||
|
|
0c5cbaef3f | ||
|
|
cb98164c82 | ||
|
|
0930bdde32 | ||
|
|
debcde489d | ||
|
|
bf0a3a109b | ||
|
|
231c8fcbd3 | ||
|
|
831abe0812 | ||
|
|
429cf742be | ||
|
|
e2438029ab | ||
|
|
532e1150ce | ||
|
|
70546895cd | ||
|
|
3758aec710 | ||
|
|
5224603d0a | ||
|
|
8d7731e72b | ||
|
|
8db0de4f9c | ||
|
|
d7c34eab2b | ||
|
|
a87f3fbf89 | ||
|
|
9c56426ccd | ||
|
|
5404142690 | ||
|
|
9350bd79cd | ||
|
|
854d34bda2 | ||
|
|
0ec465cfb0 | ||
|
|
f7441d2c22 | ||
|
|
65a00792aa | ||
|
|
6495b12ddc | ||
|
|
561763d610 | ||
|
|
758370c84c | ||
|
|
8d5f43d73b | ||
|
|
4b9e7831af | ||
|
|
b9e6ceecfc | ||
|
|
60349eb62e | ||
|
|
18a84c643e | ||
|
|
6a38dd89d1 | ||
|
|
f1924ddf81 | ||
|
|
3456f581de | ||
|
|
460ba7d8cd | ||
|
|
d16b6433f3 | ||
|
|
a4d5956291 | ||
|
|
afb8b9971a | ||
|
|
de53c5acc0 | ||
|
|
79f485d81d | ||
|
|
783ba32a48 | ||
|
|
5a53efb560 | ||
|
|
fa57718bf8 | ||
|
|
b863134d61 | ||
|
|
e6a2bb15b0 | ||
|
|
6546ad5e4a | ||
|
|
8919aafc19 | ||
|
|
9603792ab3 | ||
|
|
16e4a750b1 | ||
|
|
d3fe07cecc | ||
|
|
ae99d7a862 | ||
|
|
81376eb3fc | ||
|
|
e8d971243f | ||
|
|
ced2b98dde | ||
|
|
0895b4724f | ||
|
|
2180c77d9a | ||
|
|
f00a322d94 | ||
|
|
340b883f92 | ||
|
|
2fad122571 | ||
|
|
e423216731 | ||
|
|
85ec6381a1 | ||
|
|
5507f501df | ||
|
|
60a93b9f55 | ||
|
|
1cea2dfdd6 | ||
|
|
273100ec6e | ||
|
|
71fb561694 | ||
|
|
2d2bac1804 | ||
|
|
dd937476e3 | ||
|
|
22af3160c0 | ||
|
|
94c64c2308 | ||
|
|
8e18120cbd | ||
|
|
8410db5a1f | ||
|
|
ea0e66cff5 | ||
|
|
bbef983d2f | ||
|
|
fd7102ce81 | ||
|
|
62c3e4b3cd | ||
|
|
57801818b9 | ||
|
|
84808c3a3b | ||
|
|
4ae46dbe83 | ||
|
|
06094e22f4 | ||
|
|
7eb0821606 | ||
|
|
d3d6901a23 | ||
|
|
57537ef282 | ||
|
|
f13d6347a6 | ||
|
|
1d7cd7da24 | ||
|
|
7c301848cb | ||
|
|
feb87e2b53 | ||
|
|
c28e60951b | ||
|
|
90e164671f | ||
|
|
7d24ac3841 | ||
|
|
b2798dbe89 | ||
|
|
fa465d0f76 | ||
|
|
0b95533a88 | ||
|
|
3a86b6f00d | ||
|
|
d400db0684 | ||
|
|
f126fc3133 | ||
|
|
2eded6df95 | ||
|
|
f596d064b4 | ||
|
|
391773274f | ||
|
|
52d34aea5d | ||
|
|
8307d78c07 | ||
|
|
0c22608c7a | ||
|
|
7faf34961c | ||
|
|
348cdd1a50 | ||
|
|
4f8b96cfeb | ||
|
|
5ca8dea7a3 | ||
|
|
c12e1c9c25 | ||
|
|
d0ed52adf7 | ||
|
|
261e5eaf40 | ||
|
|
e1144a7398 | ||
|
|
1a6b280ab6 | ||
|
|
fcd0c11ef9 | ||
|
|
8fef42775b | ||
|
|
c18aaea427 | ||
|
|
ed0d487fc5 | ||
|
|
6075313456 | ||
|
|
91ac918965 | ||
|
|
2142edce39 | ||
|
|
3dd1234c24 | ||
|
|
90c23f6a1e | ||
|
|
7b1d70d620 | ||
|
|
66849cbe55 | ||
|
|
067dc65b5d | ||
|
|
2108bb5732 | ||
|
|
4d2c8979e9 | ||
|
|
2bc7440cca | ||
|
|
aa0e40d260 | ||
|
|
82100ca232 | ||
|
|
5868f8628d | ||
|
|
200d597a28 | ||
|
|
5949e01c6b | ||
|
|
4bbf2b13a3 | ||
|
|
d7477336ac | ||
|
|
22cd52a451 | ||
|
|
7f61f2536d | ||
|
|
d2cce7482b |
15
CHANGELOG.md
@@ -1,6 +1,19 @@
|
||||
## Changelog
|
||||
|
||||
#### 2.001 (September, 2022)
|
||||
#### 2.010 (November 26, 2022)
|
||||
* Add a new Terminal module (interactive shell)
|
||||
* Add to replace old Gray Theme with Virtualmin Framed Theme
|
||||
* Add _systemd_ improvements
|
||||
* Add proper support for openSUSE Leap and Tumbleweed
|
||||
* Add Linux Lite support
|
||||
* Fix connecting to external IPv6 LDAP server
|
||||
* Fix self-signed certificate generation
|
||||
* Fix setting hostname using `hostnamectl` command on _systemd_ systems
|
||||
* Fix to exclude sensors with unknown temperatures
|
||||
* Fix for FreeBSD to support Let's Encrypt certificates requests
|
||||
* Fix to support attachment filenames with slash in them
|
||||
|
||||
#### 2.001 (September 18, 2022)
|
||||
* Fix missing origins and action for direct rules in FirewallD module
|
||||
* Removed the need for a full restart when updating SSH keys
|
||||
* Improved the Javascript for redirects to HTTPS
|
||||
|
||||
@@ -31,7 +31,7 @@ Webmin can be installed in two different ways:
|
||||
1. By downloading a pre-built package, available for different distributions (CentOS, Fedora, SuSE, Mandriva, Debian, Ubuntu, Solaris and [other](https://www.webmin.com/support.html)) under [latest release assets](https://github.com/webmin/webmin/releases/latest) or from our [download page](https://webmin.com/download.html);
|
||||
<kbd>Note: It is highly recommended to [add repository](https://doxfer.webmin.com/Webmin/Installation) to your system for having automatic updates.</kbd>
|
||||
|
||||
2. By downloading, extracting [source file](https://prdownloads.sourceforge.net/webadmin/webmin-2.000.tar.gz), and running [_setup.sh_](https://www.webmin.com/tgz.html) script, with no arguments, which will setup to run it directly from this directory, or with a command-line argument, such as targeted directory.
|
||||
2. By downloading, extracting [source file](https://prdownloads.sourceforge.net/webadmin/webmin-2.003.tar.gz), and running [_setup.sh_](https://www.webmin.com/tgz.html) script, with no arguments, which will setup to run it directly from this directory, or with a command-line argument, such as targeted directory.
|
||||
<kbd>Note: If you are installing Webmin [on Windows](https://www.webmin.com/windows.html) system, you must run the command `perl setup.pl` instead. The Windows version depends on several programs, and modules that may not be part of the standard distribution. You will need _process.exe_ command, _sc.exe_ command, and _Win32::Daemon_ Perl module.</kbd>
|
||||
|
||||
## Documentation
|
||||
|
||||
23
apache/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,23 @@
|
||||
show_list=0
|
||||
httpd_dir=/srv/www
|
||||
httpd_conf=/etc/apache2/httpd.conf
|
||||
mime_types=/etc/apache2/mime.types
|
||||
httpd_path=/usr/sbin/httpd
|
||||
start_cmd=systemctl start apache2
|
||||
stop_cmd=systemctl stop apache2
|
||||
apply_cmd=systemctl restart apache2
|
||||
show_order=0
|
||||
max_servers=100
|
||||
test_config=1
|
||||
test_manual=0
|
||||
test_always=0
|
||||
test_apachectl=1
|
||||
apachectl_path=/usr/sbin/apache2ctl
|
||||
virt_file=/etc/apache2/vhosts.d
|
||||
pid_file=/run/httpd.pid
|
||||
defines_file=/etc/sysconfig/apache2
|
||||
defines_name=APACHE_SERVER_FLAGS
|
||||
auto_mods=1
|
||||
show_names=0
|
||||
allow_virtualmin=0
|
||||
format_config=1
|
||||
4
at/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,4 @@
|
||||
at_style=linux
|
||||
at_dir=/var/spool/atjobs
|
||||
allow_file=/etc/at.allow
|
||||
deny_file=/etc/at.deny
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
BEGIN { push(@INC, ".."); };
|
||||
use WebminCore;
|
||||
use JSON::PP;
|
||||
&init_config();
|
||||
use Time::Local;
|
||||
if (&foreign_check("node-groups")) {
|
||||
|
||||
@@ -5,8 +5,6 @@ $trust_unknown_referers = 1;
|
||||
require './bacula-backup-lib.pl';
|
||||
&ReadParse();
|
||||
|
||||
use JSON::PP;
|
||||
|
||||
# Input sanitization
|
||||
die "Illegal input" if ($in{'job'} and $in{'job'} !~ /^\d+\z/);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ foreach my $v (@views) {
|
||||
push(@zones, &find("zone", $conf));
|
||||
foreach my $z (@zones) {
|
||||
my $tv = &find_value("type", $z->{'members'});
|
||||
next if ($tv ne "master" && $tv ne "hint");
|
||||
next if ($tv ne "master" && $tv ne "primary" && $tv ne "hint");
|
||||
my $file = &find_value("file", $z->{'members'});
|
||||
next if (!$file);
|
||||
if (&is_raw_format_records(&make_chroot($file))) {
|
||||
|
||||
@@ -35,7 +35,7 @@ my @extra_reverse = split(/\s+/, $config{'extra_reverse'} || '');
|
||||
our %is_extra = map { $_, 1 } (@extra_forward, @extra_reverse);
|
||||
our %access = &get_module_acl();
|
||||
my $zone_names_cache = "$module_config_directory/zone-names";
|
||||
my $zone_names_version = 3;
|
||||
my $zone_names_version = 4;
|
||||
my @list_zone_names_cache;
|
||||
my $slave_error;
|
||||
my %lines_count;
|
||||
@@ -131,7 +131,7 @@ my $file = $_[0] || $config{'named_conf'};
|
||||
if (!defined($get_config_parent_cache{$file})) {
|
||||
my $conf = &get_config();
|
||||
if (!defined($lines_count{$file})) {
|
||||
my $lref = &read_file_lines($file);
|
||||
my $lref = &read_file_lines($file, 1);
|
||||
$lines_count{$file} = @$lref;
|
||||
}
|
||||
$get_config_parent_cache{$file} =
|
||||
@@ -802,7 +802,8 @@ if ($ipv6) {
|
||||
$rev = &net_to_ip6int($addr, 4*($i+1));
|
||||
$rev =~ s/\.$//g;
|
||||
foreach my $z (@zl) {
|
||||
if (lc($z->{'name'}) eq $rev && $z->{'type'} eq 'master') {
|
||||
if (lc($z->{'name'}) eq $rev &&
|
||||
($z->{'type'} eq 'master' || $z->{'type'} eq 'primary')) {
|
||||
# found the reverse master domain
|
||||
$revconf = $z;
|
||||
last DOMAIN;
|
||||
@@ -822,7 +823,7 @@ else {
|
||||
$zname =~ s/^(\d+)\/(\d+)\.//;
|
||||
if ((lc($zname) eq $rev ||
|
||||
lc($zname) eq "$rev.") &&
|
||||
$z->{'type'} eq "master") {
|
||||
($z->{'type'} eq "master" || $z->{'type'} eq "primary")) {
|
||||
# found the reverse master domain
|
||||
$revconf = $z;
|
||||
last DOMAIN;
|
||||
@@ -870,7 +871,7 @@ DOMAIN: for(my $i=1; $i<@parts; $i++) {
|
||||
my $typed;
|
||||
if ((lc($z->{'name'}) eq $fwd ||
|
||||
lc($z->{'name'}) eq "$fwd.") &&
|
||||
$z->{'type'} eq "master") {
|
||||
($z->{'type'} eq "master" || $z->{'type'} eq "primary")) {
|
||||
# Found the forward master!
|
||||
$fwdconf = $z;
|
||||
last DOMAIN;
|
||||
@@ -2195,7 +2196,7 @@ return undef;
|
||||
sub before_editing
|
||||
{
|
||||
my ($zone) = @_;
|
||||
if (!$freeze_zone_count{$zone->{'name'}}) {
|
||||
if ($zone->{'dynamic'} && !$freeze_zone_count{$zone->{'name'}}) {
|
||||
my ($out, $ok) = &try_cmd(
|
||||
"freeze ".quotemeta($zone->{'name'})." IN ".
|
||||
quotemeta($zone->{'view'} || ""));
|
||||
@@ -2225,15 +2226,21 @@ sub restart_zone
|
||||
{
|
||||
my ($dom, $view) = @_;
|
||||
my ($out, $ex);
|
||||
my $zone = &get_zone_name($dom, $view);
|
||||
my $dyn = $zone && $zone->{'dynamic'};
|
||||
if ($view) {
|
||||
# Reload a zone in a view
|
||||
&try_cmd("freeze ".quotemeta($dom)." IN ".quotemeta($view)) if ($dyn);
|
||||
$out = &try_cmd("reload ".quotemeta($dom)." IN ".quotemeta($view));
|
||||
$ex = $?;
|
||||
&try_cmd("thaw ".quotemeta($dom)." IN ".quotemeta($view)) if ($dyn);
|
||||
}
|
||||
else {
|
||||
# Just reload one top-level zone
|
||||
&try_cmd("freeze ".quotemeta($dom)) if ($dyn);
|
||||
$out = &try_cmd("reload ".quotemeta($dom));
|
||||
$ex = $?;
|
||||
&try_cmd("thaw ".quotemeta($dom)) if ($dyn);
|
||||
}
|
||||
if ($out =~ /not found/i) {
|
||||
# Zone is not known to BIND yet - do a total reload
|
||||
@@ -2452,8 +2459,11 @@ if ($changed || !$znc{'version'} ||
|
||||
my $type = &find_value("type", $z->{'members'});
|
||||
next if (!$type);
|
||||
my $file = &find_value("file", $z->{'members'});
|
||||
my $up = &find("update-policy", $z->{'members'});
|
||||
my $au = &find("allow-update", $z->{'members'});
|
||||
my $dynamic = $up || $au ? 1 : 0;
|
||||
$znc{"zone_".($n++)} = join("\t", $z->{'value'},
|
||||
$z->{'index'}, $type, $v->{'value'}, $file);
|
||||
$z->{'index'}, $type, $v->{'value'}, $dynamic, $file);
|
||||
$files{$z->{'file'}}++;
|
||||
}
|
||||
$znc{"view_".($n++)} = join("\t", $v->{'value'}, $v->{'index'});
|
||||
@@ -2464,8 +2474,11 @@ if ($changed || !$znc{'version'} ||
|
||||
next if (!$type);
|
||||
my $file = &find_value("file", $z->{'members'});
|
||||
$file ||= ""; # slaves and other types with no file
|
||||
my $up = &find("update-policy", $z->{'members'});
|
||||
my $au = &find("allow-update", $z->{'members'});
|
||||
my $dynamic = $up || $au ? 1 : 0;
|
||||
$znc{"zone_".($n++)} = join("\t", $z->{'value'},
|
||||
$z->{'index'}, $type, "*", $file);
|
||||
$z->{'index'}, $type, "*", $dynamic, $file);
|
||||
$files{$z->{'file'}}++;
|
||||
}
|
||||
|
||||
@@ -2496,12 +2509,13 @@ if (scalar(@list_zone_names_cache)) {
|
||||
my (@rv, %viewidx);
|
||||
foreach my $k (keys %znc) {
|
||||
if ($k =~ /^zone_(\d+)$/) {
|
||||
my ($name, $index, $type, $view, $file) =
|
||||
split(/\t+/, $znc{$k}, 5);
|
||||
my ($name, $index, $type, $view, $dynamic, $file) =
|
||||
split(/\t+/, $znc{$k}, 6);
|
||||
push(@rv, { 'name' => $name,
|
||||
'type' => $type,
|
||||
'index' => $index,
|
||||
'view' => !$view || $view eq '*' ? undef : $view,
|
||||
'dynamic' => $dynamic,
|
||||
'file' => $file });
|
||||
}
|
||||
elsif ($k =~ /^view_(\d+)$/) {
|
||||
@@ -2529,7 +2543,7 @@ undef(@list_zone_names_cache);
|
||||
unlink($zone_names_cache);
|
||||
}
|
||||
|
||||
# get_zone_name(index|name, [viewindex|"any"])
|
||||
# get_zone_name(index|name, [viewindex|view-name|"any"])
|
||||
# Returns a zone cache object, looked up by name or index
|
||||
sub get_zone_name
|
||||
{
|
||||
@@ -2541,7 +2555,8 @@ foreach my $z (@zones) {
|
||||
if ($z->{$field} eq $key &&
|
||||
($viewidx eq 'any' ||
|
||||
$viewidx eq '' && !defined($z->{'viewindex'}) ||
|
||||
$viewidx ne '' && $z->{'viewindex'} == $_[1])) {
|
||||
$viewidx =~ /^\d+$/ && $z->{'viewindex'} == $viewidx ||
|
||||
$viewidx ne '' && $z->{'view'} eq $viewidx)) {
|
||||
return $z;
|
||||
}
|
||||
}
|
||||
@@ -4304,7 +4319,7 @@ my %cache;
|
||||
&read_file($dnssec_expiry_cache, \%cache);
|
||||
my $changed = 0;
|
||||
foreach my $z (&list_zone_names()) {
|
||||
next if ($z->{'type'} ne 'master');
|
||||
next if ($z->{'type'} ne 'master' && $z->{'type'} ne 'primary');
|
||||
my ($t, $e);
|
||||
if ($cache{$z->{'name'}}) {
|
||||
($t, $e) = split(/\s+/, $cache{$z->{'name'}});
|
||||
@@ -4382,5 +4397,21 @@ my $kvspace = " " x length("@kvalues");
|
||||
return join(" ", @kvalues) . " " . join("\n$kvspace ", splice(@krvalues, 6));
|
||||
}
|
||||
|
||||
# redirect_url(type, [zone], [view])
|
||||
# Returns the URL of the appropriate edit_*.cgi page
|
||||
sub redirect_url
|
||||
{
|
||||
my ($type, $zone, $view) = @_;
|
||||
my $r = $type eq "master" || $type eq "primary" ? "edit_master.cgi" :
|
||||
$type eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi";
|
||||
if ($zone) {
|
||||
$r .= "?zone=".&urlize($zone);
|
||||
if ($view) {
|
||||
$r .= "&view=".&urlize($view);
|
||||
}
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@ elsif ($cgi eq 'edit_text.cgi' || $cgi eq 'edit_soa.cgi' ||
|
||||
$cgi eq 'edit_zonekey.cgi' || $cgi eq 'edit_recs.cgi' ||
|
||||
$cgi eq 'edit_record.cgi') {
|
||||
# Find a master zone
|
||||
my ($z) = grep { $_->{'type'} eq 'master' &&
|
||||
my ($z) = grep { ($_->{'type'} eq 'master' ||
|
||||
$_->{'type'} eq 'primary') &&
|
||||
&can_edit_zone($_) } &list_zone_names();
|
||||
return 'none' if (!$z);
|
||||
my $rv = 'zone='.$z->{'zone'}.
|
||||
|
||||
@@ -52,7 +52,7 @@ print &ui_table_row($text{'net_listen'}, $ltable, 3);
|
||||
|
||||
# Source address for queries
|
||||
my $src = &find("query-source", $mems);
|
||||
my $srcstr = join(" ", $src->{'values'});
|
||||
my $srcstr = $src ? join(" ", @{$src->{'values'}}) : "";
|
||||
my ($sport, $saddr);
|
||||
$sport = $1 if ($srcstr =~ /port\s+(\d+)/i);
|
||||
$saddr = $1 if ($srcstr =~ /address\s+([0-9\.]+)/i);
|
||||
|
||||
@@ -44,10 +44,6 @@ keygen=dnssec-keygen
|
||||
tmpl_dnssec=0
|
||||
dnssec_period=21
|
||||
tmpl_dnssec_dt=1
|
||||
dnssectools_conf=/etc/dnssec-tools/dnssec-tools.conf
|
||||
dnssectools_rollrec=/var/named/system.rollrec
|
||||
dnssectools_keydir=/var/named/dtkeys
|
||||
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
|
||||
force_random=0
|
||||
spf_record=0
|
||||
dnssec_info=1
|
||||
|
||||
@@ -47,10 +47,6 @@ keygen=dnssec-keygen
|
||||
tmpl_dnssec=0
|
||||
dnssec_period=21
|
||||
tmpl_dnssec_dt=1
|
||||
dnssectools_conf=/etc/dnssec-tools/dnssec-tools.conf
|
||||
dnssectools_rollrec=/var/named/system.rollrec
|
||||
dnssectools_keydir=/var/named/dtkeys
|
||||
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
|
||||
force_random=0
|
||||
spf_record=0
|
||||
dnssec_info=1
|
||||
@@ -44,10 +44,6 @@ keygen=dnssec-keygen
|
||||
tmpl_dnssec=0
|
||||
dnssec_period=21
|
||||
tmpl_dnssec_dt=1
|
||||
dnssectools_conf=/etc/dnssec-tools/dnssec-tools.conf
|
||||
dnssectools_rollrec=/var/named/system.rollrec
|
||||
dnssectools_keydir=/var/named/dtkeys
|
||||
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
|
||||
force_random=0
|
||||
spf_record=0
|
||||
dnssec_info=1
|
||||
|
||||
@@ -44,10 +44,6 @@ keygen=dnssec-keygen
|
||||
tmpl_dnssec=0
|
||||
dnssec_period=21
|
||||
tmpl_dnssec_dt=1
|
||||
dnssectools_conf=/etc/dnssec-tools/dnssec-tools.conf
|
||||
dnssectools_rollrec=/var/named/system.rollrec
|
||||
dnssectools_keydir=/var/named/dtkeys
|
||||
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
|
||||
force_random=0
|
||||
spf_record=0
|
||||
dnssec_info=1
|
||||
|
||||
@@ -47,10 +47,6 @@ keygen=dnssec-keygen
|
||||
tmpl_dnssec=0
|
||||
dnssec_period=21
|
||||
tmpl_dnssec_dt=1
|
||||
dnssectools_conf=/etc/dnssec-tools/dnssec-tools.conf
|
||||
dnssectools_rollrec=/var/named/system.rollrec
|
||||
dnssectools_keydir=/var/named/dtkeys
|
||||
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
|
||||
force_random=0
|
||||
spf_record=0
|
||||
dnssec_info=1
|
||||
@@ -44,10 +44,6 @@ keygen=dnssec-keygen
|
||||
tmpl_dnssec=0
|
||||
dnssec_period=21
|
||||
tmpl_dnssec_dt=1
|
||||
dnssectools_conf=/etc/dnssec-tools/dnssec-tools.conf
|
||||
dnssectools_rollrec=/var/named/system.rollrec
|
||||
dnssectools_keydir=/var/named/dtkeys
|
||||
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
|
||||
force_random=0
|
||||
spf_record=0
|
||||
dnssec_info=1
|
||||
|
||||
50
bind8/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,50 @@
|
||||
soa_style=1
|
||||
named_path=/usr/sbin/named
|
||||
named_conf=/etc/named.conf
|
||||
show_list=1
|
||||
records_order=0
|
||||
max_zones=50
|
||||
rev_def=0
|
||||
support_aaaa=1
|
||||
allow_comments=0
|
||||
allow_wild=1
|
||||
allow_long=0
|
||||
master_ttl=1
|
||||
whois_cmd=whois
|
||||
short_names=0
|
||||
updserial_def=0
|
||||
updserial_on=1
|
||||
updserial_man=1
|
||||
ndc_cmd=ndc
|
||||
forwardzonefilename_format=ZONE.hosts
|
||||
reversezonefilename_format=ZONE.rev
|
||||
start_cmd=systemctl start named
|
||||
restart_cmd=systemctl reload named
|
||||
stop_cmd=systemctl stop named
|
||||
pid_file=/var/run/named/named.pid
|
||||
chroot=
|
||||
rev_must=0
|
||||
ipv6_mode=1
|
||||
allow_underscore=1
|
||||
by_view=0
|
||||
confirm_zone=1
|
||||
confirm_rec=0
|
||||
no_chroot=1
|
||||
relative_paths=0
|
||||
rndc_cmd=rndc
|
||||
auto_chroot=
|
||||
no_pid_chroot=0
|
||||
soa_start=0
|
||||
rndc_conf=/etc/rndc.conf
|
||||
rndcconf_cmd=rndc-confgen
|
||||
largezones=0
|
||||
slave_dir=/var/lib/named/slave
|
||||
master_dir=/var/lib/named/master
|
||||
checkzone=named-checkzone
|
||||
keygen=dnssec-keygen
|
||||
signzone=dnssec-signzone
|
||||
checkconf=named-checkconf
|
||||
other_slaves=1
|
||||
force_random=0
|
||||
spf_record=0
|
||||
dnssec_info=1
|
||||
@@ -47,10 +47,6 @@ keygen=dnssec-keygen
|
||||
tmpl_dnssec=0
|
||||
dnssec_period=21
|
||||
tmpl_dnssec_dt=1
|
||||
dnssectools_conf=/etc/dnssec-tools/dnssec-tools.conf
|
||||
dnssectools_rollrec=/var/named/system.rollrec
|
||||
dnssectools_keydir=/var/named/dtkeys
|
||||
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
|
||||
force_random=0
|
||||
spf_record=0
|
||||
dnssec_info=1
|
||||
|
||||
@@ -25,6 +25,7 @@ $access{'delete'} || &error($text{'master_edeletecannot'});
|
||||
my $rev = ($zconf->{'value'} =~ /in-addr\.arpa/i ||
|
||||
$zconf->{'value'} =~ /\.$ipv6revzone/i);
|
||||
my $type = &find("type", $zconf->{'members'})->{'value'};
|
||||
$type = 'master' if ($type eq 'primary');
|
||||
if (!$in{'confirm'} && $config{'confirm_zone'}) {
|
||||
# Ask the user if he is sure ..
|
||||
&ui_print_header(undef, $text{'delete_title'}, "",
|
||||
|
||||
@@ -24,7 +24,7 @@ if ($key) {
|
||||
foreach my $k (@keyfiles) {
|
||||
&lock_file($k);
|
||||
}
|
||||
&delete_dnssec_key($zone, 1);
|
||||
&delete_dnssec_key($zone, $in{'keep'});
|
||||
foreach my $k (@keyfiles) {
|
||||
&unlock_file($k);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ my $typedesc = $text{"recs_$in{'type'}"} || $in{'type'};
|
||||
|
||||
# Show form for adding a record
|
||||
my $type = $zone->{'type'};
|
||||
$type = 'master' if ($type eq 'primary');
|
||||
my $file = $zone->{'file'};
|
||||
my $form = 0;
|
||||
my $shown_create_form;
|
||||
|
||||
@@ -34,6 +34,5 @@ print &ui_table_row(undef, &ui_checkbox("soa", $config{'updserial_on'},
|
||||
print &ui_table_end();
|
||||
print &ui_form_end($access{'ro'} ? [ ] : [ [ undef, $text{'save'} ] ]);
|
||||
|
||||
&ui_print_footer(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?zone=$in{'zone'}&view=$in{'view'}", $text{'master_return'});
|
||||
&ui_print_footer(&redirect_url($tv, $in{'zone'}, $in{'view'}),
|
||||
$text{'master_return'});
|
||||
|
||||
@@ -75,7 +75,8 @@ if (@keyrecs) {
|
||||
print &ui_hr();
|
||||
print &ui_buttons_start();
|
||||
print &ui_buttons_row("disable_zonekey.cgi", $text{'zonekey_disable'},
|
||||
$text{'zonekey_disabledesc'},
|
||||
$text{'zonekey_disabledesc'}."<br>\n".
|
||||
&ui_checkbox("keep", 1, $text{'zonekey_keep'}, 1),
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("zone", $in{'zone'}));
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ my %taken;
|
||||
my %nets;
|
||||
foreach my $z (@zones) {
|
||||
my $type = &find_value("type", $z->{'members'});
|
||||
next if ($type ne "master");
|
||||
next if ($type ne "master" && $type ne "primary");
|
||||
my $file = &find_value("file", $z->{'members'});
|
||||
my @recs = &read_zone_file($file, $z->{'value'});
|
||||
foreach my $r (@recs) {
|
||||
|
||||
@@ -29,9 +29,5 @@ if ($? || $out =~ /failed|not found|error/i) {
|
||||
&error(&text('restart_endc', "<tt>$out</tt>"));
|
||||
}
|
||||
&webmin_log("freeze", $dom);
|
||||
|
||||
my $tv = $zone->{'type'};
|
||||
&redirect(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?zone=$in{'zone'}&view=$in{'view'}");
|
||||
&redirect(&redirect_url($zone->{'type'}, $in{'zone'}, $in{'view'}));
|
||||
|
||||
|
||||
@@ -187,6 +187,7 @@ elsif (@zones && (!@views || !$config{'by_view'})) {
|
||||
my $t = $z->{'type'};
|
||||
next if (!$t);
|
||||
$t = "delegation" if ($t eq "delegation-only");
|
||||
$t = "master" if ($t eq "primary");
|
||||
my $zn = $v eq "." ? "<i>$text{'index_root'}</i>"
|
||||
: &ip6int_to_net(&arpa_to_ip($v));
|
||||
if ($z->{'view'}) {
|
||||
@@ -350,6 +351,8 @@ elsif (@zones) {
|
||||
foreach my $z (@zv) {
|
||||
my $v = $z->{'name'};
|
||||
my $t = $z->{'type'};
|
||||
$t = "delegation" if ($t eq "delegation-only");
|
||||
$t = "master" if ($t eq "primary");
|
||||
my $zn = $v eq "." ? "<i>$text{'index_root'}</i>"
|
||||
: &ip6int_to_net(&arpa_to_ip($v));
|
||||
push(@zlinks, "edit_$t.cgi?zone=$z->{'name'}".
|
||||
|
||||
@@ -1282,6 +1282,7 @@ zonekey_expandzone=Show public and private zone-key details ..
|
||||
zonekey_noprivate=However, Webmin could not find the private key associated with the zone, and so will not be able to re-sign it.
|
||||
zonekey_eprivate=The private key associated with this zone could not be read : $1
|
||||
zonekey_disable=Remove Key
|
||||
zonekey_keep=Keep existing key if DNSSEC is re-enabled?
|
||||
zonekey_disabledesc=Removes the DNSSEC key from this zone, and all signing records. Once this is done, you will be able to generate a new key.
|
||||
zonekey_sign=Sign Zone
|
||||
zonekey_signdesc=Immediately re-sign this zone, so that any changes to records made manually will be included in the signing records.
|
||||
|
||||
@@ -62,7 +62,7 @@ $in{'ttl_def'} || $in{'ttl'} =~ /^\d+$/ ||
|
||||
|
||||
foreach my $zi (@zones) {
|
||||
print &text('rmass_doing', "<tt>$zi->{'name'}</tt>"),"<br>\n";
|
||||
if ($zi->{'type'} ne 'master') {
|
||||
if ($zi->{'type'} ne 'master' && $zi->{'type'} ne 'primary') {
|
||||
# Skip - not a master zone
|
||||
print $text{'umass_notmaster'},"<p>\n";
|
||||
next;
|
||||
|
||||
@@ -28,7 +28,7 @@ $in{'name_def'} || $in{'name'} || &error($text{'rdmass_ename'});
|
||||
|
||||
foreach my $zi (@zones) {
|
||||
print &text('rdmass_doing', "<tt>$zi->{'name'}</tt>"),"<br>\n";
|
||||
if ($zi->{'type'} ne 'master') {
|
||||
if ($zi->{'type'} ne 'master' && $zi->{'type'} ne 'primary') {
|
||||
# Skip - not a master zone
|
||||
print $text{'umass_notmaster'},"<p>\n";
|
||||
next;
|
||||
|
||||
@@ -63,7 +63,7 @@ elsif ($in{'type'} eq 'ttl') {
|
||||
|
||||
foreach my $zi (@zones) {
|
||||
print &text('umass_doing', "<tt>$zi->{'name'}</tt>"),"<br>\n";
|
||||
if ($zi->{'type'} ne 'master') {
|
||||
if ($zi->{'type'} ne 'master' && $zi->{'type'} ne 'primary') {
|
||||
# Skip - not a master zone
|
||||
print $text{'umass_notmaster'},"<p>\n";
|
||||
next;
|
||||
|
||||
@@ -25,7 +25,7 @@ my $errcount = 0;
|
||||
my $donecount = 0;
|
||||
foreach my $z (@zones) {
|
||||
# Get the key
|
||||
next if ($z->{'type'} ne 'master');
|
||||
next if ($z->{'type'} ne 'master' && $z->{'type'} ne 'primary');
|
||||
my $zonefile = &get_zone_file($z);
|
||||
my $krfile = "$zonefile".".krf";
|
||||
my $dom = $z->{'members'} ? $z->{'values'}->[0] : $z->{'name'};
|
||||
|
||||
@@ -28,14 +28,6 @@ if ($access{'remote'}) {
|
||||
}
|
||||
|
||||
&webmin_log("apply");
|
||||
my $redir_targ = ($in{'type'} eq "master" ? "edit_master.cgi" :
|
||||
$in{'type'} eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi");
|
||||
my $zone;
|
||||
if ($in{'zone'}) {
|
||||
$zone = "?zone=$in{'zone'}";
|
||||
if ($in{'view'}) {
|
||||
$zone .= "&view=$in{'view'}";
|
||||
}
|
||||
}
|
||||
&redirect($zone && $in{'return'} ? "$redir_targ$zone" : "");
|
||||
&redirect($in{'zone'} && $in{'return'} ?
|
||||
&redirect_url($in{'type'}, $in{'zone'}, $in{'view'}) : "");
|
||||
|
||||
|
||||
@@ -17,7 +17,4 @@ my $err = &restart_zone($zone->{'name'}, $zone->{'view'});
|
||||
&error($err) if ($err);
|
||||
&webmin_log("apply", $zone->{'name'});
|
||||
|
||||
my $tv = $zone->{'type'};
|
||||
my $redir_targ = ($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi");
|
||||
&redirect($redir_targ . "?zone=$in{'zone'}&view=$in{'view'}");
|
||||
&redirect(&redirect_url($zone->{'type'}, $in{'zone'}, $in{'view'}));
|
||||
|
||||
@@ -158,7 +158,8 @@ else {
|
||||
# Is this address already in use? Search all domains
|
||||
# to find out..
|
||||
foreach my $z (@zl) {
|
||||
next if ($z->{'type'} ne "master");
|
||||
next if ($z->{'type'} ne "master" &&
|
||||
$z->{'type'} ne "primary");
|
||||
next if ($z->{'name'} =~ /in-addr\.arpa/i);
|
||||
my $file = $z->{'file'};
|
||||
my @frecs = &read_zone_file($file, $z->{'name'});
|
||||
@@ -180,7 +181,8 @@ else {
|
||||
# Is this address already in use? Search all domains
|
||||
# to find out..
|
||||
foreach my $z (@zl) {
|
||||
next if ($z->{'type'} ne "master");
|
||||
next if ($z->{'type'} ne "master" &&
|
||||
$z->{'type'} ne "primary");
|
||||
next if ($z->{'name'} =~ /\.$ipv6revzone/i);
|
||||
my $file = $z->{'file'};
|
||||
my @frecs = &read_zone_file($file, $z->{'name'});
|
||||
|
||||
@@ -60,7 +60,7 @@ foreach my $v (@views) {
|
||||
}
|
||||
foreach my $z (@zoneconfs) {
|
||||
my $type = &find_value("type", $z->{'members'});
|
||||
if ($type eq "master") {
|
||||
if ($type eq "master" || $type eq "primary") {
|
||||
$zmap{$z->{'value'}} = $z;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,14 +14,6 @@ $access{'apply'} || &error($text{'start_ecannot'});
|
||||
my $err = &start_bind();
|
||||
&error($err) if ($err);
|
||||
&webmin_log("start");
|
||||
my $redir_targ = ($in{'type'} eq "master" ? "edit_master.cgi" :
|
||||
$in{'type'} eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi");
|
||||
my $zone;
|
||||
if ($in{'zone'}) {
|
||||
$zone = "?zone=$in{'zone'}";
|
||||
if ($in{'view'}) {
|
||||
$zone .= "&view=$in{'view'}";
|
||||
}
|
||||
}
|
||||
&redirect($zone && $in{'return'} ? "$redir_targ$zone" : "");
|
||||
&redirect($in{'zone'} && $in{'return'} ?
|
||||
&redirect_url($in{'type'}, $in{'zone'}, $in{'view'}) : "");
|
||||
|
||||
|
||||
@@ -8,14 +8,6 @@ $access{'apply'} || &error($text{'stop_ecannot'});
|
||||
$err = &stop_bind();
|
||||
&error($err) if ($err);
|
||||
&webmin_log("stop");
|
||||
my $redir_targ = ($in{'type'} eq "master" ? "edit_master.cgi" :
|
||||
$in{'type'} eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi");
|
||||
my $zone;
|
||||
if ($in{'zone'}) {
|
||||
$zone = "?zone=$in{'zone'}";
|
||||
if ($in{'view'}) {
|
||||
$zone .= "&view=$in{'view'}";
|
||||
}
|
||||
}
|
||||
&redirect($zone && $in{'return'} ? "$redir_targ$zone" : "");
|
||||
&redirect($in{'zone'} && $in{'return'} ?
|
||||
&redirect_url($in{'type'}, $in{'zone'}, $in{'view'}) : "");
|
||||
|
||||
|
||||
@@ -30,8 +30,4 @@ if ($? || $out =~ /failed|not found|error/i) {
|
||||
}
|
||||
&webmin_log("thaw", $dom);
|
||||
|
||||
my $tv = $zone->{'type'};
|
||||
&redirect(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
&redirect(&redirect_url($zone->{'type'}, $in{'zone'}, $in{'view'}));
|
||||
|
||||
@@ -36,6 +36,5 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
&ui_print_footer(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?zone=$in{'zone'}&view=$in{'view'}", $text{'master_return'});
|
||||
&ui_print_footer(&redirect_url($tv, $in{'zone'}, $in{'view'}),
|
||||
$text{'master_return'});
|
||||
|
||||
@@ -34,7 +34,5 @@ print &ui_table_start(&text('whois_header', "<tt>".&html_escape($pcmd)."</tt>"),
|
||||
print &ui_table_row(undef, "<pre>".&html_escape($out)."</pre>", 2);
|
||||
print &ui_table_end();
|
||||
|
||||
&ui_print_footer(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?zone=$in{'zone'}&view=$in{'view'}", $text{'master_return'});
|
||||
|
||||
&ui_print_footer(&redirect_url($tv, $in{'zone'}, $in{'view'}),
|
||||
$text{'master_return'});
|
||||
|
||||
@@ -5,58 +5,39 @@ do 'burner-lib.pl';
|
||||
# Output HTML for editing security options for the acl module
|
||||
sub acl_security_form
|
||||
{
|
||||
print "<tr> <td><b>$text{'acl_create'}</b></td> <td>\n";
|
||||
printf "<input type=radio name=create value=1 %s> $text{'yes'}\n",
|
||||
$_[0]->{'create'} ? 'checked' : '';
|
||||
printf "<input type=radio name=create value=0 %s> $text{'no'}</td>\n",
|
||||
$_[0]->{'create'} ? '' : 'checked';
|
||||
my ($o) = @_;
|
||||
print &ui_table_row($text{'acl_create'},
|
||||
&ui_yesno_radio("create", $o->{'create'}));
|
||||
|
||||
print "<td><b>$text{'acl_edit'}</b></td> <td>\n";
|
||||
printf "<input type=radio name=edit value=1 %s> $text{'yes'}\n",
|
||||
$_[0]->{'edit'} ? 'checked' : '';
|
||||
printf "<input type=radio name=edit value=0 %s> $text{'no'}</td> </tr>\n",
|
||||
$_[0]->{'edit'} ? '' : 'checked';
|
||||
print &ui_table_row($text{'acl_edit'},
|
||||
&ui_yesno_radio("edit", $o->{'edit'}));
|
||||
|
||||
print "<tr> <td><b>$text{'acl_global'}</b></td> <td>\n";
|
||||
printf "<input type=radio name=global value=1 %s> $text{'yes'}\n",
|
||||
$_[0]->{'global'} ? 'checked' : '';
|
||||
printf "<input type=radio name=global value=0 %s> $text{'no'}</td>\n",
|
||||
$_[0]->{'global'} ? '' : 'checked';
|
||||
print "</tr>\n";
|
||||
print &ui_table_row($text{'acl_global'},
|
||||
&ui_yesno_radio("global", $o->{'global'}));
|
||||
|
||||
print "<tr> <td valign=top><b>$text{'acl_profiles'}</b></td>\n";
|
||||
print "<td colspan=3>\n";
|
||||
printf "<input type=radio name=all value=1 %s> %s\n",
|
||||
$_[0]->{'profiles'} eq "*" ? "checked" : "", $text{'acl_all'};
|
||||
printf "<input type=radio name=all value=0 %s> %s<br>\n",
|
||||
$_[0]->{'profiles'} eq "*" ? "" : "checked", $text{'acl_sel'};
|
||||
print "<select name=profiles multiple size=5>\n";
|
||||
local $p;
|
||||
local %can = map { $_, 1 } split(/\s+/, $_[0]->{'profiles'});
|
||||
foreach $p (&list_profiles()) {
|
||||
printf "<option value=%s %s>%s (%s)\n",
|
||||
$p->{'id'}, $can{$p->{'id'}} ? "selected" : "",
|
||||
$text{'index_type'.$p->{'type'}},
|
||||
$p->{'type'} == 1 ? $p->{'iso'} :
|
||||
$p->{'type'} == 4 ? $p->{'sdesc'} : $p->{'source_0'}.
|
||||
($p->{'source_1'} ? ", ..." : "");
|
||||
}
|
||||
print "</select></td> </tr>\n";
|
||||
print &ui_table_row($text{'acl_profiles'},
|
||||
&ui_radio("all", $o->{'profiles'} eq '*' ? 1 : 0,
|
||||
[ [ 1, $text{'acl_all'} ],
|
||||
[ 0, $text{'acl_sel'}."<br>" ] ])."\n".
|
||||
&ui_select("profiles",
|
||||
[ split(/\s+/, $o->{'profiles'}) ],
|
||||
[ map { [ $_->{'id'}, $text{'index_type'.$_->{'type'}} ] }
|
||||
&list_profiles() ],
|
||||
5, 1), 3);
|
||||
|
||||
print "<tr> <td><b>$text{'acl_dirs'}</b></td> <td colspan=2>\n";
|
||||
printf "<input name=dirs size=40 value='%s'></td> </tr>\n",
|
||||
$_[0]->{'dirs'};
|
||||
print &ui_table_row($text{'acl_dirs'},
|
||||
&ui_textbox("dirs", $o->{'dirs'}, 60), 3);
|
||||
}
|
||||
|
||||
# acl_security_save(&options)
|
||||
# Parse the form for security options for the acl module
|
||||
sub acl_security_save
|
||||
{
|
||||
$_[0]->{'create'} = $in{'create'};
|
||||
$_[0]->{'edit'} = $in{'edit'};
|
||||
$_[0]->{'global'} = $in{'global'};
|
||||
$_[0]->{'profiles'} = $in{'all'} ? "*" :
|
||||
join(" ", split(/\0/, $in{'profiles'}));
|
||||
$_[0]->{'dirs'} = $in{'dirs'};
|
||||
my ($o) = @_;
|
||||
$o->{'create'} = $in{'create'};
|
||||
$o->{'edit'} = $in{'edit'};
|
||||
$o->{'global'} = $in{'global'};
|
||||
$o->{'profiles'} = $in{'all'} ? "*" : join(" ", split(/\0/, $in{'profiles'}));
|
||||
$o->{'dirs'} = $in{'dirs'};
|
||||
}
|
||||
|
||||
|
||||
@@ -130,6 +130,7 @@ if ($in{'burn'} || $in{'test'}) {
|
||||
$iso = $config{'temp'} ? "$config{'temp'}/burner.iso"
|
||||
: &tempname("burner.iso");
|
||||
local $cmd = "$config{'mkisofs'} -graft-points -o $iso";
|
||||
$cmd .= " -iso-level 3";
|
||||
$cmd .= " -J" if ($profile->{'joliet'});
|
||||
$cmd .= " --netatalk" if ($profile->{'netatalk'});
|
||||
$cmd .= " --cap" if ($profile->{'cap'});
|
||||
|
||||
9
cfengine/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,9 @@
|
||||
cfrun_hosts=
|
||||
cfd_conf=
|
||||
cfengine_conf=
|
||||
cfd=/usr/sbin/cfd
|
||||
cfengine_dir=/etc/cfengine
|
||||
cfrun=/usr/sbin/cfrun
|
||||
cfengine=/usr/sbin/cfengine
|
||||
start_cmd=systemctl start cfengine
|
||||
stop_cmd=systemctl stop cfengine
|
||||
@@ -58,7 +58,7 @@ foreach $o (@lang_order_list) {
|
||||
}
|
||||
|
||||
# Call any config pre-load function
|
||||
if (&foreign_func_exists($module, 'config_pre_load')) {
|
||||
if (&foreign_defined($module, 'config_pre_load')) {
|
||||
&foreign_call($module, "config_pre_load", \%info, \@info_order);
|
||||
&foreign_call($module, "config_pre_load", \%einfo);
|
||||
}
|
||||
@@ -281,7 +281,7 @@ if ($section) {
|
||||
# prevent changing behaviour of a module
|
||||
if (&foreign_exists($module) &&
|
||||
&foreign_require($module) &&
|
||||
&foreign_func_exists($module, 'config_pre_load')) {
|
||||
&foreign_defined($module, 'config_pre_load')) {
|
||||
&foreign_call($module, "config_pre_load", \%info, \@info_order);
|
||||
}
|
||||
|
||||
|
||||
10
config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,10 @@
|
||||
find_pid_command=ps auwwwx | grep NAME | grep -v grep | awk '{ print $2 }'
|
||||
path=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
|
||||
ld_env=LD_LIBRARY_PATH
|
||||
passwd_file=/etc/shadow
|
||||
passwd_uindex=0
|
||||
passwd_pindex=1
|
||||
passwd_cindex=2
|
||||
passwd_mindex=4
|
||||
by_view=0
|
||||
tempdelete_days=7
|
||||
24
cron/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,24 @@
|
||||
vixie_cron=1
|
||||
cron_deny_all=2
|
||||
system_crontab=/etc/crontab
|
||||
cron_allow_file=/var/spool/cron/allow
|
||||
cron_get_command=crontab -u USER -l
|
||||
cron_user_get_command=crontab -l
|
||||
cron_delete_command=crontab -u USER -r
|
||||
cron_user_delete_command=crontab -r
|
||||
cron_edit_command=crontab -u USER -e
|
||||
cron_user_edit_command=crontab -e
|
||||
cron_dir=/var/spool/cron/tabs
|
||||
cron_deny_file=/var/spool/cron/deny
|
||||
cron_input=1
|
||||
cronfiles_dir=/etc/cron.d
|
||||
max_len=80
|
||||
show_run=0
|
||||
show_time=0
|
||||
match_mode=0
|
||||
match_user=1
|
||||
kill_subs=0
|
||||
show_comment=0
|
||||
hourly_only=0
|
||||
max_jobs=100
|
||||
show_next=0
|
||||
@@ -19,7 +19,7 @@ cron_input=Cron pozwala na dodawanie zadań,1,1-Tak,0-Nie
|
||||
cron_allow_file=Plik z listą dopuszczonych użytkowników,0
|
||||
cron_deny_file=Plik z listą użytkowników bez dostępu,0
|
||||
cron_deny_all=Uprawnienia przy braku plików pozwoleń/zakazu,1,0-Zablokuj dla wszystkich,1-Zablokuj oprócz roota,2-Pozwól wszystkim
|
||||
vixie_cron=Obsluga rozszerzeń vixie-crona,1,1-Tak,0-Nie
|
||||
vixie_cron=Obsługa rozszerzeń vixie-crona,1,1-Tak,0-Nie
|
||||
system_crontab=Scieżka do systemowego pliku zadań vixie-crona,0
|
||||
single_file=Ścieżka do pliku crontab pojedynczego użytkownika,0
|
||||
cronfiles_dir=Ścieżka do katalogu z dodatkowymi plikami crona,3,Brak
|
||||
|
||||
170
cron/lang/ru
@@ -1,22 +1,56 @@
|
||||
index_title=Расписание заданий cron
|
||||
index_user=Пользователь
|
||||
index_active=Выполнять задание?
|
||||
index_active=Активно?
|
||||
index_command=Команда
|
||||
index_none=В этой системе нет заданий cron
|
||||
index_create=Создать новое задание
|
||||
index_allow=Управление доступом пользователей к заданиям cron
|
||||
index_when=Запускать
|
||||
index_comment=Описание
|
||||
index_none=В этой системе нет заданий cron.
|
||||
index_none2=Нет заданий cron, к которым у вас есть доступ.
|
||||
index_none3=У вас пока нет заданий cron.
|
||||
index_create=Создать новое задание.
|
||||
index_ecreate=Создать новую переменную среды.
|
||||
index_allow=Управление доступом пользователей к заданиям cron.
|
||||
index_manual=Редактировать задания вручную.
|
||||
index_return=списку заданий
|
||||
index_env=Переменная среды
|
||||
index_move=Переместить
|
||||
index_next=Следующий запуск
|
||||
index_nunknown=Неизвестно
|
||||
index_run=Выполняется?
|
||||
index_ecmd=Команда $1 для управления пользовательскими настройками Cron не найдена. Может быть, Cron не установлен в этой системе?
|
||||
index_esingle=Файл $1, в котором перечислены задания Cron, не существует. Может быть, Cron не установлен в этой системе?
|
||||
index_ecrondir=Каталог заданий Cron $1 не существует. Может быть, конфигурация модуля неверна, или Cron не установлен?
|
||||
index_ecrondir_create=Попытаться создать каталог заданий Cron $1 ?
|
||||
index_delete=Удалить Выбранные Задания
|
||||
index_disable=Отключить Выбранные Задания
|
||||
index_enable=Включить Выбранные Задания
|
||||
index_esearch=По вашему запросу $1 не найдено ни одного задания.
|
||||
index_toomany2=Слишком много вариантов. Воспользуйтесь поиском выше, чтобы ограничить результат.
|
||||
index_search=Найти подходящие задания Cron
|
||||
index_ok=Поиск
|
||||
index_searchres=Задания Cron, соответствующие $1 ..
|
||||
index_reset=Сбросить поиск.
|
||||
index_econfigcheck=Заданиями Cron нельзя управлять в вашей системе, так как конфигурация модуля неверна : $1
|
||||
index_stop=Остановить Cron Daemon
|
||||
index_stopdesc=Остановить серверный фоновый процесс <tt>crond</tt>, запускающий запланированные задания cron. Это предотвратит выполнение команд в назначенное им время.
|
||||
index_start=Запустить Cron Daemon
|
||||
index_startdesc=Запустить серверный фоновый процесс <tt>crond</tt>, запускающий запланированные задания cro.. <font color=red><b>Это необходимо для выполнения команд в назначенное им время.</b></font>
|
||||
index_boot=Загружать Cron Daemon?
|
||||
index_bootdesc=Измените этот параметр, чтобы включить или отключить запуск Cron Jobs Daemon во время загрузки системы.
|
||||
|
||||
edit_title=Изменение задания
|
||||
create_title=Создание задания
|
||||
edit_ecannot=У вас недостаточно прав на изменение задания для этого пользователя
|
||||
edit_details=Подробная информация о задании
|
||||
edit_user=Выполнять задание от имени пользователя
|
||||
edit_active=Разрешить выполнение?
|
||||
edit_active=Активно?
|
||||
edit_next=Время следующего запуска
|
||||
edit_commands=Команды
|
||||
edit_command=Команда
|
||||
edit_comment=Описание
|
||||
edit_input=Стандартный поток ввода для команды
|
||||
edit_when=Время начала выполнения
|
||||
edit_range=Диапазон дат для выполнения
|
||||
edit_mins=Минуты
|
||||
edit_hours=Часы
|
||||
edit_days=Дни
|
||||
@@ -25,8 +59,24 @@ edit_weekdays=Дни недели
|
||||
edit_all=Все
|
||||
edit_selected=Выбранные ..
|
||||
edit_run=Выполнить задание сейчас
|
||||
edit_return=заданию
|
||||
edit_saverun=Сохранить и Выполнить Сейчас
|
||||
edit_clone=Клонировать Задание
|
||||
edit_return=заданию cron
|
||||
edit_ctrl=Примечание: Для выбора нескольких часов, минут, дней и месяцев можно щелкнуть по ним, удерживая клавишу Ctrl.
|
||||
edit_special1=Простое расписание ..
|
||||
edit_special0=Время и даты, выбранные ниже ..
|
||||
edit_special_hourly=Ежечасно
|
||||
edit_special_daily=Ежедневно (в полночь)
|
||||
edit_special_weekly=Еженедельно (в воскресенье)
|
||||
edit_special_monthly=Ежемесячно (1-го числа)
|
||||
edit_special_yearly=Ежегодно (1 января)
|
||||
edit_special_reboot=При загрузке системы
|
||||
lcedit_special_hourly=ежечасно
|
||||
lcedit_special_daily=ежедневно (в полночь)
|
||||
lcedit_special_weekly=еженедельно (в воскресенье)
|
||||
lcedit_special_monthly=ежемесячно (1-го числа)
|
||||
lcedit_special_yearly=ежегодно (1 января)
|
||||
lcedit_special_reboot=при загрузке системы
|
||||
|
||||
save_err=Не удалось назначить задание
|
||||
save_ecmd=Не указана команда для выполнения
|
||||
@@ -35,6 +85,8 @@ save_euser2=Пользователь '$1' не существует
|
||||
save_eallow=Пользователь '$1' не имеет достаточно прав для доступа к заданиям
|
||||
save_ecannot=У вас нет прав на создание или изменение заданий от имени пользователя '$1'
|
||||
save_enone=Вы не выбрали $1 для выполнения
|
||||
save_ecannot2=Вам не разрешено создавать задания cron
|
||||
save_eidx=Задание cron было успешно сохранено, но не может быть запущено, поскольку оно не было найдено!
|
||||
|
||||
allow_title=Управление доступом к заданиям cron
|
||||
allow_desc=Ниже вы можете указать, какие пользователи могут создавать и выполнять задания cron.
|
||||
@@ -45,13 +97,26 @@ allow_all3=Разрешить всем
|
||||
allow_allow=Разрешить только указанным пользователям
|
||||
allow_deny=Разрешить всем пользователям, кроме
|
||||
|
||||
env_title1=Изменить переменную среды
|
||||
env_title2=Создать переменную среды
|
||||
env_name=Имя переменной
|
||||
env_value=Значение
|
||||
env_user=Для пользователя
|
||||
env_active=Активно?
|
||||
env_details=Детали переменной среды
|
||||
env_err=Не удалось сохранить переменную среды
|
||||
env_ename='$1' не является допустимым именем переменной
|
||||
env_order=Данный параметр переменной среды будет применяться к заданиям Cron только после того, как переменная появится в списке заданий на главной странице модуля.
|
||||
env_where=Добавить переменную среды
|
||||
env_where2=Переместить переменную среды
|
||||
env_top=Перед всеми заданиями Cron для пользователя
|
||||
env_bot=После всех заданий Cron
|
||||
env_leave=Текущая позиция
|
||||
|
||||
exec_title=Выполнение задания
|
||||
exec_title=Выполнить Задание Cron
|
||||
exec_ecannot=У вас нет прав на выполнение задания от имени данного пользователя
|
||||
exec_cmd=Вывод команды $1 ..
|
||||
exec_cmdbg=Выполнение команды $1 в качестве фонового процесса.
|
||||
exec_none=Вывод команды отсутствует
|
||||
|
||||
acl_users=Может изменять задания cron
|
||||
@@ -60,14 +125,89 @@ acl_this=Текущего пользователя webmin
|
||||
acl_only=Только указанных пользователей
|
||||
acl_except=Всех пользователей, кроме указанных
|
||||
acl_control=Может управлять доступом пользователей к заданиям cron?
|
||||
acl_command=Может просматривать и редактировать команды Cron?
|
||||
acl_uid=Пользователи с UID в диапазоне
|
||||
acl_gid=Пользователи с основоной группой
|
||||
acl_create=Может создавать задания Cron?
|
||||
acl_delete=Может удалять задания Cron?
|
||||
acl_move=Может перенести работу Cron?
|
||||
acl_kill=Может прекратить работу Cron?
|
||||
acl_hourly=Ограничить задания максимум ежечасными?
|
||||
acl_hourlydef=Как установлено в Настройках Модуля
|
||||
acl_stop=Может остановить и запустить Cron daemon?
|
||||
|
||||
log_modify=Изменено задание cron для $1
|
||||
log_modify_l=Изменено задание cron "$2" для $1
|
||||
log_create=Создано задание cron для $1
|
||||
log_create_l=Изменено задание cron "$2" для $1
|
||||
log_delete=Удалено задание cron для $1
|
||||
log_exec=Выполнено задание cron от имени $1
|
||||
log_exec_l=Выполнено задание cron "$2" для $1
|
||||
log_allow=Изменен доступ пользователей к заданиям cron
|
||||
log_modify=Изменено задание Cron для $1
|
||||
log_modify_l=Изменено задание Cron "$2" для $1
|
||||
log_create=Создано задание Cron для $1
|
||||
log_create_l=Изменено задание Cron "$2" для $1
|
||||
log_delete=Удалено задание Cron для $1
|
||||
log_exec=Выполнено задание Cron от имени $1
|
||||
log_exec_l=Выполнено задание Cron "$2" для $1
|
||||
log_kill=Прекращенное задание Cron для $1
|
||||
log_kill_l=Прекращенное задание Cron "$2" для $1
|
||||
log_allow=Изменен доступ пользователей к заданиям Cron
|
||||
log_env_create=Создана переменная среды для $1
|
||||
log_env_modify=Изменена переменная среды для $1
|
||||
log_env_delete=Удалена переменная среды для $1
|
||||
log_move=Задание Cron перемещено для $1
|
||||
log_crons_delete=Удалено $1 заданий Cron
|
||||
log_crons_disable=Отключено $1 заданий Cron
|
||||
log_crons_enable=Включено $1 заданий Cron
|
||||
log_stop=Daemon Cron остановлен
|
||||
log_start=Daemon Cron запущен
|
||||
log_bootup=Daemon Cron включен при загрузке
|
||||
log_bootdown=Daemon Cron отключен при загрузке
|
||||
|
||||
ecopy=Обнаружена ошибка в новой конфигурации Cron: $1 $2
|
||||
|
||||
when_min=каждую минуту
|
||||
when_hour=каждый час в $1 минут
|
||||
when_day=каждый день в $2:$1
|
||||
when_month=в $3 день каждый месяц в $2:$1
|
||||
when_weekday=каждый $3 в $2:$1
|
||||
when_cron=по времени cron $1
|
||||
when_interval=каждые $1 секунд(ы)
|
||||
when_boot=во время запуска
|
||||
|
||||
ucwhen_min=Каждую минуту
|
||||
ucwhen_hour=Каждый час в $1 минут
|
||||
ucwhen_day=Каждый день в $2:$1
|
||||
ucwhen_month=В $3 день каждый месяц в $2:$1
|
||||
ucwhen_weekday=Каждый $3 на $2:$1
|
||||
ucwhen_cron=По времени cron $1
|
||||
ucwhen_interval=Каждые $1 секунд(ы)
|
||||
ucwhen_boot=Во время запуска
|
||||
|
||||
move_err=Не удалось переместить задание Cron
|
||||
move_etype=Эта работа не может быть перемещена
|
||||
|
||||
kill_err=Не удалось завершить задание Cron
|
||||
kill_ecannot=Вы не можете прекратить это задание
|
||||
kill_egone=Больше не выполняется
|
||||
kill_ekill=Убить не удалось : $1
|
||||
kill_title=Завершить задание Cron
|
||||
kill_rusure=Вы уверены, что хотите завершить процесс $1 с PID $2 ?
|
||||
kill_rusure2=Вы уверены, что хотите завершить процесс $1 с PID $2 и всеми его подпроцессами?
|
||||
kill_ok=Да, Завершить процесс
|
||||
|
||||
range_all=Запускать в любую дату
|
||||
range_start=Запускать только с $1
|
||||
range_end=по $1
|
||||
range_estart=Отсутствует или неверная дата начала диапазона для запуска
|
||||
range_eend=Отсутствует или недействительная дата окончания диапазона для запуска
|
||||
|
||||
delete_err=Не удалось удалить задания Cron
|
||||
delete_enone=Ничего не выбрано
|
||||
|
||||
manual_title=Редактировать Вручную Задания Cron
|
||||
manual_edit=Cron файл для редактирования:
|
||||
manual_ok=Редактировать
|
||||
manual_editing=Используйте текстовое поле ниже для редактирования заданий Cron в $1. Будьте осторожны, так как Webmin не будет выполнять проверку!
|
||||
manual_efile=Выбранный файл недействителен!
|
||||
manual_ecannot=Вы запрещено вручную редактировать задания cron
|
||||
|
||||
stop_err=Не удалось остановить daemon
|
||||
start_err=Не удалось запустить daemon
|
||||
stop_ecannot=Вам запрещено останавливать daemon
|
||||
start_ecannot=Вам запрещено запускать daemon
|
||||
bootup_ecannot=Вам запрещено включать daemon при загрузке
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
desc_pl=Harmonogram zadaĂą Cron
|
||||
longdesc_pl=TwĂłrz, edytuj i usuwaj zadania Cron.
|
||||
desc_pl=Harmonogram zadań Cron
|
||||
longdesc_pl=Twórz, edytuj i usuwaj zadania Cron.
|
||||
|
||||
17
dhcpd/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,17 @@
|
||||
start_cmd=systemctl start dhcpd
|
||||
stop_cmd=systemctl stop dhcpd
|
||||
restart_cmd=systemctl restart dhcpd
|
||||
dhcpd_conf=/etc/dhcpd.conf
|
||||
pid_file=/var/lib/dhcp/var/run/dhcpd.pid
|
||||
dhcpd_path=/usr/sbin/dhcpd
|
||||
lease_file=/var/lib/dhcp/db/dhcpd.leases
|
||||
lease_sort=0
|
||||
dhcpd_nocols=5
|
||||
lease_tz=0
|
||||
interfaces_type=suse
|
||||
show_ip=0
|
||||
show_mac=0
|
||||
group_name=0
|
||||
display_max=100
|
||||
desc_name=0
|
||||
lease_vendor=0
|
||||
11
dnsadmin/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,11 @@
|
||||
soa_style=1
|
||||
show_list=0
|
||||
nslookup_pathname=nslookup
|
||||
named_pid_file=/var/run/named.pid
|
||||
named_pathname=/usr/sbin/named
|
||||
ping_pathname=ping -c 1
|
||||
named_boot_file=/etc/named.boot
|
||||
records_order=0
|
||||
updserial_def=0
|
||||
updserial_on=1
|
||||
updserial_man=1
|
||||
4
dovecot/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,4 @@
|
||||
dovecot=/usr/sbin/dovecot
|
||||
dovecot_config=/etc/dovecot/dovecot.conf
|
||||
init_script=dovecot
|
||||
pid_file=/var/run/dovecot/master.pid
|
||||
@@ -15,7 +15,6 @@ index_version=Version $1
|
||||
stop_err=Failed to stop Dovecot
|
||||
stop_erunning=No longer running
|
||||
start_err=Failed to start Dovecot
|
||||
start_eprotos=No protocols selected on the <b>Networking and Protocols</b> page
|
||||
apply_err=Failed to apply configuration
|
||||
|
||||
net_title=Networking and Protocols
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
|
||||
require './dovecot-lib.pl';
|
||||
&error_setup($text{'start_err'});
|
||||
$conf = &get_config();
|
||||
@protos = split(/\s+/, &find_value("protocols", $conf));
|
||||
@protos || &error($text{'start_eprotos'});
|
||||
$err = &start_dovecot();
|
||||
&error($err) if ($err);
|
||||
&webmin_log("start");
|
||||
|
||||
4
exports-nfs4/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,4 @@
|
||||
restart_command=systemctl restart nfsserver
|
||||
exports_file=/etc/exports
|
||||
nfs_server=rpc.nfsd
|
||||
apply_cmd=exportfs -r
|
||||
3
exports/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,3 @@
|
||||
restart_command=systemctl restart nfsserver
|
||||
exports_file=/etc/exports
|
||||
apply_cmd=exportfs -r
|
||||
@@ -51,7 +51,8 @@ if (@jails) {
|
||||
my $val = $2;
|
||||
$col = lc($col);
|
||||
$col =~ s/\s/_/g;
|
||||
if ($col !~ /journal_matches/) {
|
||||
if ($col !~ /journal_matches/ &&
|
||||
$col !~ /file_list/) {
|
||||
push(@head, "<div $tdc>".$text{"status_head_$col"}."</div>");
|
||||
if ($col =~ /banned_ip_list/) {
|
||||
$jips = $val;
|
||||
|
||||
@@ -5,40 +5,33 @@ require 'fdisk-lib.pl';
|
||||
# Output HTML for editing security options for the fdisk module
|
||||
sub acl_security_form
|
||||
{
|
||||
local @dlist = &list_disks_partitions();
|
||||
local ($d, %dcan);
|
||||
map { $dcan{$_}++ } split(/\s+/, $_[0]->{'disks'});
|
||||
print "<tr> <td valign=top><b>$text{'acl_disks'}</b></td> <td>\n";
|
||||
printf "<input type=radio name=disks_def value=1 %s> %s\n",
|
||||
$_[0]->{'disks'} eq '*' ? 'checked' : '', $text{'acl_dall'};
|
||||
printf "<input type=radio name=disks_def value=0 %s> %s<br>\n",
|
||||
$_[0]->{'disks'} eq '*' ? '' : 'checked', $text{'acl_dsel'};
|
||||
print "<select name=disks size=4 multiple>\n";
|
||||
foreach $d (@dlist) {
|
||||
printf "<option value='%s' %s>%s</option>\n",
|
||||
$d->{'device'},
|
||||
$dcan{$d->{'device'}} ? "selected" : "",
|
||||
&text('select_device', uc($d->{'type'}), uc(substr($d->{'device'}, -1))).($d->{'model'} ? " ($d->{'model'})" : "");
|
||||
}
|
||||
print "</select></td> </tr>\n";
|
||||
my ($o) = @_;
|
||||
my @dlist = &list_disks_partitions();
|
||||
|
||||
print "<tr> <td><b>$text{'acl_view'}</b></td>\n";
|
||||
printf "<td><input type=radio name=view value=1 %s> %s\n",
|
||||
$_[0]->{'view'} ? 'checked' : '', $text{'yes'};
|
||||
printf "<input type=radio name=view value=0 %s> %s</td> </tr>\n",
|
||||
$_[0]->{'view'} ? '' : 'checked', $text{'no'};
|
||||
print &ui_table_row($text{'acl_disks'},
|
||||
&ui_radio("disks_def", $o->{'disks'} eq '*' ? 1 : 0,
|
||||
[ [ 1, $text{'acl_dall'} ],
|
||||
[ 0, $text{'acl_dsel'} ] ])."<br>\n".
|
||||
&ui_select("disks",
|
||||
[ split(/\s+/, $o->{'disks'}) ],
|
||||
[ map { [ $_->{'device'}, &text('select_device', uc($_->{'type'}), uc(substr($_->{'device'}, -1))).($_->{'model'} ? " ($_->{'model'})" : "") ] } @dlist ],
|
||||
4, 1), 3);
|
||||
|
||||
print &ui_table_row($text{'acl_view'},
|
||||
&ui_yesno_radio("view", $o->{'view'}));
|
||||
}
|
||||
|
||||
# acl_security_save(&options)
|
||||
# Parse the form for security options for the fdisk module
|
||||
sub acl_security_save
|
||||
{
|
||||
my ($o) = @_;
|
||||
if ($in{'disks_def'}) {
|
||||
$_[0]->{'disks'} = "*";
|
||||
$o->{'disks'} = "*";
|
||||
}
|
||||
else {
|
||||
$_[0]->{'disks'} = join(" ", split(/\0/, $in{'disks'}));
|
||||
$o->{'disks'} = join(" ", split(/\0/, $in{'disks'}));
|
||||
}
|
||||
$_[0]->{'view'} = $in{'view'};
|
||||
$o->{'view'} = $in{'view'};
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,8 @@ else {
|
||||
|
||||
# Extent and cylinders
|
||||
if ($in{'new'}) {
|
||||
$ext = &ui_textbox("start", $start, 4)." - ".&ui_textbox("end", $end, 4);
|
||||
$ext = &ui_textbox("start", $start, 10)." - ".
|
||||
&ui_textbox("end", $end, 10);
|
||||
}
|
||||
else {
|
||||
$ext = "$pinfo->{'start'} - $pinfo->{'end'}";
|
||||
@@ -230,12 +231,12 @@ elsif ($pinfo->{'edittype'} != 2) {
|
||||
}
|
||||
|
||||
if (!$in{'new'} && !$pinfo->{'extended'} && $pinfo->{'edittype'} != 2) {
|
||||
my $ui_buttons_content;
|
||||
my $ui_buttons_content = "";
|
||||
|
||||
if (!@stat || $stat[2] == 0) {
|
||||
# Show form for creating filesystem
|
||||
local $rt = @stat ? $stat[1] : &conv_type($pinfo->{'type'});
|
||||
$ui_buttons_content = &ui_buttons_row("mkfs_form.cgi",
|
||||
$ui_buttons_content .= &ui_buttons_row("mkfs_form.cgi",
|
||||
$text{'edit_mkfs2'}, $text{'edit_mkfsmsg2'},
|
||||
&ui_hidden("dev", $dev),
|
||||
&ui_select("type", $rt,
|
||||
@@ -245,7 +246,7 @@ if (!$in{'new'} && !$pinfo->{'extended'} && $pinfo->{'edittype'} != 2) {
|
||||
|
||||
if (!$in{'new'} && @stat && $stat[2] == 0 && &can_fsck($stat[1])) {
|
||||
# Show form to fsck filesystem
|
||||
$ui_buttons_content = &ui_buttons_row("fsck_form.cgi",
|
||||
$ui_buttons_content .= &ui_buttons_row("fsck_form.cgi",
|
||||
$text{'edit_fsck'},&text('edit_fsckmsg', "<tt>fsck</tt>"),
|
||||
&ui_hidden("dev", $dev)." ".
|
||||
&ui_hidden("type", $stat[1]));
|
||||
@@ -253,7 +254,7 @@ if (!$in{'new'} && !$pinfo->{'extended'} && $pinfo->{'edittype'} != 2) {
|
||||
|
||||
if (!$in{'new'} && @stat && $stat[2] == 0 && &can_tune($stat[1])) {
|
||||
# Show form to tune filesystem
|
||||
$ui_buttons_content = &ui_buttons_row("tunefs_form.cgi",
|
||||
$ui_buttons_content .= &ui_buttons_row("tunefs_form.cgi",
|
||||
$text{'edit_tune'}, $text{'edit_tunemsg'},
|
||||
&ui_hidden("dev", $dev)." ".
|
||||
&ui_hidden("type", $stat[1]));
|
||||
@@ -264,7 +265,7 @@ if (!$in{'new'} && !$pinfo->{'extended'} && $pinfo->{'edittype'} != 2) {
|
||||
# Show form to mount filesystem
|
||||
if ($types[0] eq "swap") {
|
||||
# Swap partition
|
||||
$ui_buttons_content = &ui_buttons_row("../mount/edit_mount.cgi",
|
||||
$ui_buttons_content .= &ui_buttons_row("../mount/edit_mount.cgi",
|
||||
$text{'edit_newmount2'},$text{'edit_mountmsg2'},
|
||||
&ui_hidden("type", $types[0]).
|
||||
&ui_hidden("newdev", $dev));
|
||||
@@ -279,7 +280,7 @@ if (!$in{'new'} && !$pinfo->{'extended'} && $pinfo->{'edittype'} != 2) {
|
||||
else {
|
||||
$dirsel .= &ui_hidden("type", $types[0]);
|
||||
}
|
||||
$ui_buttons_content = &ui_buttons_row("../mount/edit_mount.cgi",
|
||||
$ui_buttons_content .= &ui_buttons_row("../mount/edit_mount.cgi",
|
||||
$text{'edit_newmount'}, $text{'edit_mountmsg'},
|
||||
&ui_hidden("newdev", $dev),
|
||||
$dirsel);
|
||||
@@ -292,11 +293,10 @@ if (!$in{'new'} && !$pinfo->{'extended'} && $pinfo->{'edittype'} != 2) {
|
||||
print $ui_buttons_content;
|
||||
print &ui_buttons_end();
|
||||
}
|
||||
} elsif (!$mounted &&
|
||||
$pinfo->{'edittype'} == 2) {
|
||||
my $label = $config{'mode'} eq 'fdisk' ?
|
||||
'edit_eparted2' : 'edit_eparted';
|
||||
print "$text{$label}\n";
|
||||
}
|
||||
elsif (!$mounted && $pinfo->{'edittype'} == 2) {
|
||||
my $label = $config{'mode'} eq 'fdisk' ? 'edit_eparted2' : 'edit_eparted';
|
||||
print $text{$label},"\n";
|
||||
}
|
||||
|
||||
&ui_print_footer("edit_disk.cgi?device=$dinfo->{'device'}",
|
||||
|
||||
6
fetchmail/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,6 @@
|
||||
config_file=
|
||||
fetchmail_path=fetchmail
|
||||
daemon_user=root
|
||||
pid_file=/var/run/fetchmail.pid
|
||||
view_mode=0
|
||||
max_users=400
|
||||
@@ -25,7 +25,7 @@ print "Content-Disposition: attachment; filename=\"$name$ext\"\n";
|
||||
print "Content-Length: $size\n\n";
|
||||
open (FILE, "< $file") or die "can't open $file: $!";
|
||||
binmode FILE;
|
||||
local $/ = \2048000;
|
||||
local $/ = \&get_buffer_size_binary();
|
||||
while (<FILE>) {
|
||||
print $_;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ BEGIN { push(@INC, ".."); };
|
||||
use WebminCore;
|
||||
&init_config();
|
||||
|
||||
use lib './lib';
|
||||
use POSIX;
|
||||
use Encode qw(decode encode);
|
||||
use File::Basename;
|
||||
|
||||
@@ -1,299 +0,0 @@
|
||||
package File::BaseDir;
|
||||
|
||||
use strict;
|
||||
use Carp;
|
||||
require File::Spec;
|
||||
require Exporter;
|
||||
|
||||
our $VERSION = 0.06;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our %EXPORT_TAGS = (
|
||||
vars => [ qw(
|
||||
xdg_data_home xdg_data_dirs
|
||||
xdg_config_home xdg_config_dirs
|
||||
xdg_cache_home
|
||||
) ],
|
||||
lookup => [ qw(
|
||||
data_home data_dirs data_files
|
||||
config_home config_dirs config_files
|
||||
cache_home
|
||||
) ],
|
||||
);
|
||||
our @EXPORT_OK = (
|
||||
qw(xdg_data_files xdg_config_files),
|
||||
map @$_, values %EXPORT_TAGS
|
||||
);
|
||||
|
||||
# Set root and home directories
|
||||
my $rootdir = File::Spec->rootdir();
|
||||
if ($^O eq 'MSWin32') {
|
||||
$rootdir = 'C:\\'; # File::Spec default depends on CWD
|
||||
$ENV{HOME} ||= $ENV{USERPROFILE} || $ENV{HOMEDRIVE}.$ENV{HOMEPATH};
|
||||
# logic from File::HomeDir::Windows
|
||||
}
|
||||
my $home = $ENV{HOME};
|
||||
unless ($home) {
|
||||
# Default to operating system's home dir. NOTE: web applications may not have $ENV{HOME} assigned,
|
||||
# so don't issue a warning. See RT bug #41744
|
||||
$home = $rootdir;
|
||||
}
|
||||
|
||||
# Set defaults
|
||||
our $xdg_data_home = File::Spec->catdir($home, qw/.local share/);
|
||||
our @xdg_data_dirs = (
|
||||
File::Spec->catdir($rootdir, qw/usr local share/),
|
||||
File::Spec->catdir($rootdir, qw/usr share/),
|
||||
);
|
||||
our $xdg_config_home = File::Spec->catdir($home, '.config');
|
||||
our @xdg_config_dirs = ( File::Spec->catdir($rootdir, qw/etc xdg/) );
|
||||
our $xdg_cache_home = File::Spec->catdir($home, '.cache');
|
||||
|
||||
# OO method
|
||||
sub new { bless \$VERSION, shift } # what else is there to bless ?
|
||||
|
||||
# Variable methods
|
||||
sub xdg_data_home { $ENV{XDG_DATA_HOME} || $xdg_data_home }
|
||||
|
||||
sub xdg_data_dirs {
|
||||
( $ENV{XDG_DATA_DIRS}
|
||||
? _adapt($ENV{XDG_DATA_DIRS})
|
||||
: @xdg_data_dirs
|
||||
)
|
||||
}
|
||||
|
||||
sub xdg_config_home {$ENV{XDG_CONFIG_HOME} || $xdg_config_home }
|
||||
|
||||
sub xdg_config_dirs {
|
||||
( $ENV{XDG_CONFIG_DIRS}
|
||||
? _adapt($ENV{XDG_CONFIG_DIRS})
|
||||
: @xdg_config_dirs
|
||||
)
|
||||
}
|
||||
|
||||
sub xdg_cache_home { $ENV{XDG_CACHE_HOME} || $xdg_cache_home }
|
||||
|
||||
sub _adapt {
|
||||
map { File::Spec->catdir( split('/', $_) ) } split /[:;]/, shift;
|
||||
# ':' defined in the spec, but ';' is standard on win32
|
||||
}
|
||||
|
||||
# Lookup methods
|
||||
sub data_home { _catfile(xdg_data_home, @_) }
|
||||
|
||||
sub data_dirs { _find_files(\&_dir, \@_, xdg_data_home, xdg_data_dirs) }
|
||||
|
||||
sub data_files { _find_files(\&_file, \@_, xdg_data_home, xdg_data_dirs) }
|
||||
|
||||
sub xdg_data_files { my @dirs = data_files(@_); return @dirs }
|
||||
|
||||
sub config_home { _catfile(xdg_config_home, @_) }
|
||||
|
||||
sub config_dirs { _find_files(\&_dir, \@_, xdg_config_home, xdg_config_dirs) }
|
||||
|
||||
sub config_files { _find_files(\&_file, \@_, xdg_config_home, xdg_config_dirs) }
|
||||
|
||||
sub xdg_config_files { my @dirs = config_files(@_); return @dirs }
|
||||
|
||||
sub cache_home { _catfile(xdg_cache_home, @_) }
|
||||
|
||||
sub _catfile {
|
||||
my $dir = shift;
|
||||
shift if ref $_[0] or $_[0] =~ /::/; # OO call
|
||||
return File::Spec->catfile($dir, @_);
|
||||
}
|
||||
|
||||
sub _find_files {
|
||||
my $type = shift;
|
||||
my $file = shift;
|
||||
shift @$file if ref $$file[0] or $$file[0] =~ /::/; # OO call
|
||||
#warn "Looking for: @$file\n in: @_\n";
|
||||
if (wantarray) {
|
||||
return grep { &$type( $_ ) && -r $_ }
|
||||
map { File::Spec->catfile($_, @$file) } @_;
|
||||
}
|
||||
else { # prevent unnecessary stats by returning early
|
||||
for (@_) {
|
||||
my $path = File::Spec->catfile($_, @$file);
|
||||
return $path if &$type($path) && -r $path;
|
||||
}
|
||||
}
|
||||
return ();
|
||||
}
|
||||
|
||||
sub _dir { -d $_[0] }
|
||||
|
||||
sub _file { -f $_[0] }
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
File::BaseDir - Use the Freedesktop.org base directory specification
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use File::BaseDir qw/xdg_data_files/;
|
||||
for ( xdg_data_files('mime/globs') ) {
|
||||
# do something
|
||||
}
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This module can be used to find directories and files as specified
|
||||
by the Freedesktop.org Base Directory Specification. This specifications
|
||||
gives a mechanism to locate directories for configuration, application data
|
||||
and cache data. It is suggested that desktop applications for e.g. the
|
||||
Gnome, KDE or Xfce platforms follow this layout. However, the same layout can
|
||||
just as well be used for non-GUI applications.
|
||||
|
||||
This module forked from L<File::MimeInfo>.
|
||||
|
||||
This module follows version 0.6 of BaseDir specification.
|
||||
|
||||
=head1 EXPORT
|
||||
|
||||
None by default, but all methods can be exported on demand.
|
||||
Also the groups ":lookup" and ":vars" are defined. The ":vars" group
|
||||
contains all routines with a "xdg_" prefix; the ":lookup" group
|
||||
contains the routines to locate files and directories.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=over 4
|
||||
|
||||
=item C<new()>
|
||||
|
||||
Simple constructor to allow Object Oriented use of this module.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Lookup
|
||||
|
||||
The following methods are used to lookup files and folders in one of the
|
||||
search paths.
|
||||
|
||||
=over 4
|
||||
|
||||
=item C<data_home(@PATH)>
|
||||
|
||||
Takes a list of file path elements and returns a new path by appending
|
||||
them to the data home directory. The new path does not need to exist.
|
||||
Use this when writing user specific application data.
|
||||
|
||||
Example:
|
||||
|
||||
# data_home is: /home/USER/.local/share
|
||||
$path = $bd->data_home('Foo', 'Bar', 'Baz');
|
||||
# returns: /home/USER/.local/share/Foo/Bar/Baz
|
||||
|
||||
=item C<data_dirs(@PATH)>
|
||||
|
||||
Looks for directories specified by C<@PATH> in the data home and
|
||||
other data directories. Returns (possibly empty) list of readable
|
||||
directories. In scalar context only the first directory found is
|
||||
returned. Use this to lookup application data.
|
||||
|
||||
=item C<data_files(@PATH)>
|
||||
|
||||
Looks for files specified by C<@PATH> in the data home and other data
|
||||
directories. Only returns files that are readable. In scalar context only
|
||||
the first file found is returned. Use this to lookup application data.
|
||||
|
||||
=item C<config_home(@PATH)>
|
||||
|
||||
Takes a list of path elements and appends them to the config home
|
||||
directory returning a new path. The new path does not need to exist.
|
||||
Use this when writing user specific configuration.
|
||||
|
||||
=item C<config_dirs(@PATH)>
|
||||
|
||||
Looks for directories specified by C<@PATH> in the config home and
|
||||
other config directories. Returns (possibly empty) list of readable
|
||||
directories. In scalar context only the first directory found is
|
||||
returned. Use this to lookup configuration.
|
||||
|
||||
=item C<config_files(@PATH)>
|
||||
|
||||
Looks for files specified by C<@PATH> in the config home and other
|
||||
config directories. Returns a (possibly empty) list of files that
|
||||
are readable. In scalar context only the first file found is returned.
|
||||
Use this to lookup configuration.
|
||||
|
||||
=item C<cache_home(@PATH)>
|
||||
|
||||
Takes a list of path elements and appends them to the cache home
|
||||
directory returning a new path. The new path does not need to exist.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Variables
|
||||
|
||||
The following methods only returns the value of one of the XDG variables.
|
||||
|
||||
=over 4
|
||||
|
||||
=item C<xdg_data_home>
|
||||
|
||||
Returns either C<$ENV{XDG_DATA_HOME}> or it's default value.
|
||||
Default is F<$HOME/.local/share>.
|
||||
|
||||
=item C<xdg_data_dirs>
|
||||
|
||||
Returns either C<$ENV{XDG_DATA_DIRS}> or it's default value as list.
|
||||
Default is F</usr/local/share>, F</usr/share>.
|
||||
|
||||
=item C<xdg_config_home>
|
||||
|
||||
Returns either C<$ENV{XDG_CONFIG_HOME}> or it's default value.
|
||||
Default is F<$HOME/.config>.
|
||||
|
||||
=item C<xdg_config_dirs>
|
||||
|
||||
Returns either C<$ENV{XDG_CONFIG_DIRS}> or it's default value as list.
|
||||
Default is F</etc/xdg>.
|
||||
|
||||
=item C<xdg_cache_home>
|
||||
|
||||
Returns either C<$ENV{XDG_CACHE_HOME}> or it's default value.
|
||||
Default is F<$HOME/.cache>.
|
||||
|
||||
=back
|
||||
|
||||
=head1 NON-UNIX PLATFORMS
|
||||
|
||||
The use of L<File::Spec> ensures that all paths are returned in the appropriate
|
||||
form for the current platform. On Windows this module will try to set C<$HOME>
|
||||
to a sensible value if it is not defined yet. On other platforms one can use
|
||||
e.g. L<File::HomeDir> to set $HOME before loading File::BaseDir.
|
||||
|
||||
Please note that the specification is targeting Unix platforms only and
|
||||
will only have limited relevance on other platforms. Any platform dependent
|
||||
behavior in this module should be considered an extension of the spec.
|
||||
|
||||
=head1 BACKWARDS COMPATIBILITY
|
||||
|
||||
The methods C<xdg_data_files()> and C<xdg_config_files()> are exported for
|
||||
backwards compatibility with version 0.02. They are identical to C<data_files()>
|
||||
and C<config_files()> respectively but without the C<wantarray> behavior.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
Please mail the author if you encounter any bugs.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Jaap Karssenberg || Pardus [Larus] E<lt>pardus@cpan.orgE<gt>
|
||||
|
||||
Copyright (c) 2003, 2007 Jaap G Karssenberg. All rights reserved.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself.
|
||||
|
||||
Currently being maintained by Kim Ryan
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<http://www.freedesktop.org/wiki/Specifications/basedir-spec>
|
||||
|
||||
@@ -1,482 +0,0 @@
|
||||
package File::MimeInfo;
|
||||
|
||||
use strict;
|
||||
use Carp;
|
||||
use Fcntl 'SEEK_SET';
|
||||
use File::Spec;
|
||||
use File::BaseDir qw/data_files/;
|
||||
require Exporter;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(mimetype);
|
||||
our @EXPORT_OK = qw(extensions describe globs inodetype mimetype_canon mimetype_isa);
|
||||
our $VERSION = '0.27';
|
||||
our $DEBUG;
|
||||
|
||||
our ($_hashed, $_hashed_aliases, $_hashed_subclasses);
|
||||
our (@globs, %literal, %extension, %mime2ext, %aliases, %subclasses);
|
||||
our ($LANG, @DIRS);
|
||||
# @globs = [ [ 'glob', qr//, $mime_string ], ... ]
|
||||
# %literal contains literal matches
|
||||
# %extension contains extensions (globs matching /^\*(\.\w)+$/ )
|
||||
# %mime2ext is used for looking up extension by mime type
|
||||
# %aliases contains the aliases table
|
||||
# %subclasses contains the subclasses table
|
||||
# $LANG can be used to set a default language for the comments
|
||||
# @DIRS can be used to specify custom database directories
|
||||
|
||||
sub new { bless \$VERSION, shift } # what else is there to bless ?
|
||||
|
||||
sub mimetype {
|
||||
my $file = pop;
|
||||
croak 'subroutine "mimetype" needs a filename as argument' unless defined $file;
|
||||
return
|
||||
inodetype($file) ||
|
||||
globs($file) ||
|
||||
default($file);
|
||||
}
|
||||
|
||||
sub inodetype {
|
||||
my $file = pop;
|
||||
print STDERR "> Checking inode type\n" if $DEBUG;
|
||||
lstat $file or return undef;
|
||||
return undef if -f _;
|
||||
my $t = (-l $file) ? 'inode/symlink' : # Win32 does not like '_' here
|
||||
(-d _) ? 'inode/directory' :
|
||||
(-p _) ? 'inode/fifo' :
|
||||
(-c _) ? 'inode/chardevice' :
|
||||
(-b _) ? 'inode/blockdevice' :
|
||||
(-S _) ? 'inode/socket' : '' ;
|
||||
if ($t eq 'inode/directory') { # compare devices to detect mount-points
|
||||
my $dev = (stat _)[0]; # device of the node under investigation
|
||||
$file = File::Spec->rel2abs($file); # get full path
|
||||
my @dirs = File::Spec->splitdir($file);
|
||||
$file = File::Spec->catfile(@dirs); # removes trailing '/' or equivalent
|
||||
return $t if -l $file; # parent can be on other dev for links
|
||||
pop @dirs;
|
||||
my $dir = File::Spec->catdir(@dirs); # parent dir
|
||||
$t = 'inode/mount-point' unless (stat $dir)[0] == $dev; # compare devices
|
||||
return $t;
|
||||
}
|
||||
else { return $t ? $t : undef }
|
||||
}
|
||||
|
||||
sub globs {
|
||||
my $file = pop;
|
||||
croak 'subroutine "globs" needs a filename as argument' unless defined $file;
|
||||
rehash() unless $_hashed;
|
||||
(undef, undef, $file) = File::Spec->splitpath($file); # remove path
|
||||
print STDERR "> Checking globs for basename '$file'\n" if $DEBUG;
|
||||
|
||||
return $literal{$file} if exists $literal{$file};
|
||||
|
||||
if ($file =~ /\.(\w+(\.\w+)*)$/) {
|
||||
my @ext = split /\./, $1;
|
||||
while (@ext) {
|
||||
my $ext = join('.', @ext);
|
||||
print STDERR "> Checking for extension '.$ext'\n" if $DEBUG;
|
||||
warn "WARNING: wantarray behaviour of globs() will change in the future.\n" if wantarray;
|
||||
return wantarray
|
||||
? ($extension{$ext}, $ext)
|
||||
: $extension{$ext}
|
||||
if exists $extension{$ext};
|
||||
shift @ext;
|
||||
}
|
||||
}
|
||||
|
||||
for (@globs) {
|
||||
next unless $file =~ $_->[1];
|
||||
print STDERR "> This file name matches \"$_->[0]\"\n" if $DEBUG;
|
||||
return $_->[2];
|
||||
}
|
||||
|
||||
return globs(lc $file) if $file =~ /[A-Z]/; # recurs
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub default {
|
||||
my $file = pop;
|
||||
croak 'subroutine "default" needs a filename as argument' unless defined $file;
|
||||
|
||||
my $line;
|
||||
unless (ref $file) {
|
||||
return undef unless -f $file;
|
||||
print STDERR "> File exists, trying default method\n" if $DEBUG;
|
||||
return 'text/plain' if -z $file;
|
||||
|
||||
open FILE, '<', $file or return undef;
|
||||
binmode FILE, ':utf8' unless $] < 5.008;
|
||||
read FILE, $line, 32;
|
||||
close FILE;
|
||||
}
|
||||
else {
|
||||
print STDERR "> Trying default method on object\n" if $DEBUG;
|
||||
|
||||
$file->seek(0, SEEK_SET);
|
||||
$file->read($line, 32);
|
||||
}
|
||||
|
||||
{
|
||||
no warnings; # warnings can be thrown when input not ascii
|
||||
if ($] < 5.008 or ! utf8::valid($line)) {
|
||||
use bytes; # avoid invalid utf8 chars
|
||||
$line =~ s/\s//g; # \m, \n and \t are also control chars
|
||||
return 'text/plain' unless $line =~ /[\x00-\x1F\x7F]/;
|
||||
}
|
||||
else {
|
||||
# use perl to do something intelligent for ascii & utf8
|
||||
return 'text/plain' unless $line =~ /[^[:print:]\s]/;
|
||||
}
|
||||
}
|
||||
print STDERR "> First 10 bytes of the file contain control chars\n" if $DEBUG;
|
||||
return 'application/octet-stream';
|
||||
}
|
||||
|
||||
sub rehash {
|
||||
(@globs, %literal, %extension, %mime2ext) = (); # clear all data
|
||||
local $_; # limit scope of $_ ... :S
|
||||
my @globfiles = @DIRS
|
||||
? ( grep {-e $_ && -r $_} map "$_/globs", @DIRS )
|
||||
: ( reverse data_files('mime/globs') );
|
||||
print STDERR << 'EOT' unless @globfiles;
|
||||
WARNING: You don't seem to have a mime-info database. The
|
||||
shared-mime-info package is available from http://freedesktop.org/ .
|
||||
EOT
|
||||
my @done;
|
||||
for my $file (@globfiles) {
|
||||
next if grep {$file eq $_} @done;
|
||||
_hash_globs($file);
|
||||
push @done, $file;
|
||||
}
|
||||
$_hashed = 1;
|
||||
}
|
||||
|
||||
sub _hash_globs {
|
||||
my $file = shift;
|
||||
open GLOB, '<', $file || croak "Could not open file '$file' for reading" ;
|
||||
binmode GLOB, ':utf8' unless $] < 5.008;
|
||||
my ($string, $glob);
|
||||
while (<GLOB>) {
|
||||
next if /^\s*#/ or ! /\S/; # skip comments and empty lines
|
||||
chomp;
|
||||
($string, $glob) = split /:/, $_, 2;
|
||||
unless ($glob =~ /[\?\*\[]/) { $literal{$glob} = $string }
|
||||
elsif ($glob =~ /^\*\.(\w+(\.\w+)*)$/) {
|
||||
$extension{$1} = $string unless exists $extension{$1};
|
||||
$mime2ext{$string} = [] if !defined($mime2ext{$string});
|
||||
push @{$mime2ext{$string}}, $1;
|
||||
} else { unshift @globs, [$glob, _glob_to_regexp($glob), $string] }
|
||||
}
|
||||
close GLOB || croak "Could not open file '$file' for reading" ;
|
||||
}
|
||||
|
||||
sub _glob_to_regexp {
|
||||
my $glob = shift;
|
||||
$glob =~ s/\./\\./g;
|
||||
$glob =~ s/([?*])/.$1/g;
|
||||
$glob =~ s/([^\w\/\\\.\?\*\[\]])/\\$1/g;
|
||||
qr/^$glob$/;
|
||||
}
|
||||
|
||||
sub extensions {
|
||||
my $mimet = mimetype_canon(pop @_);
|
||||
rehash() unless $_hashed;
|
||||
my $ref = $mime2ext{$mimet} if exists $mime2ext{$mimet};
|
||||
return $ref ? @{$ref} : undef if wantarray;
|
||||
return $ref ? @{$ref}[0] : '';
|
||||
}
|
||||
|
||||
sub describe {
|
||||
shift if ref $_[0];
|
||||
my ($mt, $lang) = @_;
|
||||
croak 'subroutine "describe" needs a mimetype as argument' unless $mt;
|
||||
$mt = mimetype_canon($mt);
|
||||
$lang = $LANG unless defined $lang;
|
||||
my $att = $lang ? qq{xml:lang="$lang"} : '';
|
||||
my $desc;
|
||||
my @descfiles = @DIRS
|
||||
? ( grep {-e $_ && -r $_} map "$_/$mt.xml", @DIRS )
|
||||
: ( reverse data_files('mime', split '/', "$mt.xml") ) ;
|
||||
for my $file (@descfiles) {
|
||||
$desc = ''; # if a file was found, return at least empty string
|
||||
open XML, '<', $file || croak "Could not open file '$file' for reading";
|
||||
binmode XML, ':utf8' unless $] < 5.008;
|
||||
while (<XML>) {
|
||||
next unless m!<comment\s*$att>(.*?)</comment>!;
|
||||
$desc = $1;
|
||||
last;
|
||||
}
|
||||
close XML || croak "Could not open file '$file' for reading";
|
||||
last if $desc;
|
||||
}
|
||||
return $desc;
|
||||
}
|
||||
|
||||
sub mimetype_canon {
|
||||
my $mimet = pop;
|
||||
croak 'mimetype_canon needs argument' unless defined $mimet;
|
||||
rehash_aliases() unless $_hashed_aliases;
|
||||
return exists($aliases{$mimet}) ? $aliases{$mimet} : $mimet;
|
||||
}
|
||||
|
||||
sub rehash_aliases {
|
||||
%aliases = _read_map_files('aliases');
|
||||
$_hashed_aliases++;
|
||||
}
|
||||
|
||||
sub _read_map_files {
|
||||
my ($name, $list) = @_;
|
||||
my @files = @DIRS
|
||||
? ( grep {-e $_ && -r $_} map "$_/$name", @DIRS )
|
||||
: ( reverse data_files("mime/$name") );
|
||||
my (@done, %map);
|
||||
for my $file (@files) {
|
||||
next if grep {$_ eq $file} @done;
|
||||
open MAP, '<', $file || croak "Could not open file '$file' for reading";
|
||||
binmode MAP, ':utf8' unless $] < 5.008;
|
||||
while (<MAP>) {
|
||||
next if /^\s*#/ or ! /\S/; # skip comments and empty lines
|
||||
chomp;
|
||||
my ($k, $v) = split /\s+/, $_, 2;
|
||||
if ($list) {
|
||||
$map{$k} = [] unless $map{$k};
|
||||
push @{$map{$k}}, $v;
|
||||
}
|
||||
else { $map{$k} = $v }
|
||||
}
|
||||
close MAP;
|
||||
push @done, $file;
|
||||
}
|
||||
return %map;
|
||||
}
|
||||
|
||||
sub mimetype_isa {
|
||||
my $parent = pop || croak 'mimetype_isa needs argument';
|
||||
my $mimet = pop;
|
||||
if (ref $mimet or ! defined $mimet) {
|
||||
$mimet = mimetype_canon($parent);
|
||||
undef $parent;
|
||||
}
|
||||
else {
|
||||
$mimet = mimetype_canon($mimet);
|
||||
$parent = mimetype_canon($parent);
|
||||
}
|
||||
rehash_subclasses() unless $_hashed_subclasses;
|
||||
|
||||
my @subc;
|
||||
push @subc, 'inode/directory' if $mimet eq 'inode/mount-point';
|
||||
push @subc, @{$subclasses{$mimet}} if exists $subclasses{$mimet};
|
||||
push @subc, 'text/plain' if $mimet =~ m#^text/#;
|
||||
push @subc, 'application/octet-stream' unless $mimet =~ m#^inode/#;
|
||||
|
||||
return $parent ? scalar(grep {$_ eq $parent} @subc) : @subc;
|
||||
}
|
||||
|
||||
sub rehash_subclasses {
|
||||
%subclasses = _read_map_files('subclasses', 'LIST');
|
||||
$_hashed_subclasses++;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
File::MimeInfo - Determine file type
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use File::MimeInfo;
|
||||
my $mime_type = mimetype($file);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This module can be used to determine the mime type of a file. It
|
||||
tries to implement the freedesktop specification for a shared
|
||||
MIME database.
|
||||
|
||||
For this module shared-mime-info-spec 0.13 was used.
|
||||
|
||||
This package only uses the globs file. No real magic checking is
|
||||
used. The L<File::MimeInfo::Magic> package is provided for magic typing.
|
||||
|
||||
If you want to determine the mimetype of data in a memory buffer you should
|
||||
use L<File::MimeInfo::Magic> in combination with L<IO::Scalar>.
|
||||
|
||||
This module loads the various data files when needed. If you want to
|
||||
hash data earlier see the C<rehash> methods below.
|
||||
|
||||
=head1 EXPORT
|
||||
|
||||
The method C<mimetype> is exported by default.
|
||||
The methods C<inodetype>, C<globs>, C<extensions>, C<describe>,
|
||||
C<mimetype_canon> and C<mimetype_isa> can be exported on demand.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=over 4
|
||||
|
||||
=item C<new()>
|
||||
|
||||
Simple constructor to allow Object Oriented use of this module.
|
||||
If you want to use this, include the package as C<use File::MimeInfo ();>
|
||||
to avoid importing sub C<mimetype()>.
|
||||
|
||||
=item C<mimetype($file)>
|
||||
|
||||
Returns a mimetype string for C<$file>, returns undef on failure.
|
||||
|
||||
This method bundles C<inodetype> and C<globs>.
|
||||
|
||||
If these methods are unsuccessful the file is read and the mimetype defaults
|
||||
to 'text/plain' or to 'application/octet-stream' when the first ten chars
|
||||
of the file match ascii control chars (white spaces excluded).
|
||||
If the file doesn't exist or isn't readable C<undef> is returned.
|
||||
|
||||
=item C<inodetype($file)>
|
||||
|
||||
Returns a mimetype in the 'inode' namespace or undef when the file is
|
||||
actually a normal file.
|
||||
|
||||
=item C<globs($file)>
|
||||
|
||||
Returns a mimetype string for C<$file> based on the filename and filename extensions.
|
||||
Returns undef on failure. The file doesn't need to exist.
|
||||
|
||||
Behaviour in list context (wantarray) is unspecified and will change in future
|
||||
releases.
|
||||
|
||||
=item C<default($file)>
|
||||
|
||||
This method decides whether a file is binary or plain text by looking at
|
||||
the first few bytes in the file. Used to decide between "text/plain" and
|
||||
"application/octet-stream" if all other methods have failed.
|
||||
|
||||
The spec states that we should check for the ascii control chars and let
|
||||
higher bit chars pass to allow utf8. We try to be more intelligent using
|
||||
perl utf8 support.
|
||||
|
||||
=item C<extensions($mimetype)>
|
||||
|
||||
In list context, returns the list of filename extensions that map to the given mimetype.
|
||||
In scalar context, returns the first extension that is found in the database
|
||||
for this mimetype.
|
||||
|
||||
=item C<describe($mimetype, $lang)>
|
||||
|
||||
Returns a description of this mimetype as supplied by the mime info database.
|
||||
You can specify a language with the optional parameter C<$lang>, this should be
|
||||
the two letter language code used in the xml files. Also you can set the global
|
||||
variable C<$File::MimeInfo::LANG> to specify a language.
|
||||
|
||||
This method returns undef when no xml file was found (i.e. the mimetype
|
||||
doesn't exist in the database). It returns an empty string when the xml file doesn't
|
||||
contain a description in the language you specified.
|
||||
|
||||
I<Currently no real xml parsing is done, it trusts the xml files are nicely formatted.>
|
||||
|
||||
=item C<mimetype_canon($mimetype)>
|
||||
|
||||
Returns the canonical mimetype for a given mimetype.
|
||||
Deprecated mimetypes are typically aliased to their canonical variants.
|
||||
This method only checks aliases, doesn't check whether the mimetype
|
||||
exists.
|
||||
|
||||
Use this method as a filter when you take a mimetype as input.
|
||||
|
||||
=item C<mimetype_isa($mimetype)>
|
||||
|
||||
=item C<mimetype_isa($mimetype, $mimetype)>
|
||||
|
||||
When give only one argument this method returns a list with mimetypes that are parent
|
||||
classes for this mimetype.
|
||||
|
||||
When given two arguments returns true if the second mimetype is a parent class of
|
||||
the first one.
|
||||
|
||||
This method checks the subclasses table and applies a few rules for implicit
|
||||
subclasses.
|
||||
|
||||
=item C<rehash()>
|
||||
|
||||
Rehash the data files. Glob information is preparsed when this method is called.
|
||||
|
||||
If you want to by-pass the XDG basedir system you can specify your database
|
||||
directories by setting C<@File::MimeInfo::DIRS>. But normally it is better to
|
||||
change the XDG basedir environment variables.
|
||||
|
||||
=item C<rehash_aliases()>
|
||||
|
||||
Rehashes the F<mime/aliases> files.
|
||||
|
||||
=item C<rehash_subclasses()>
|
||||
|
||||
Rehashes the F<mime/subclasses> files.
|
||||
|
||||
=back
|
||||
|
||||
=head1 DIAGNOSTICS
|
||||
|
||||
This module throws an exception when it can't find any data files, when it can't
|
||||
open a data file it found for reading or when a subroutine doesn't get enough arguments.
|
||||
In the first case you either don't have the freedesktop mime info database installed,
|
||||
or your environment variables point to the wrong places,
|
||||
in the second case you have the database installed, but it is broken
|
||||
(the mime info database should logically be world readable).
|
||||
|
||||
=head1 TODO
|
||||
|
||||
Make an option for using some caching mechanism to reduce init time.
|
||||
|
||||
Make C<describe()> use real xml parsing ?
|
||||
|
||||
=head1 LIMITATIONS
|
||||
|
||||
Perl versions prior to 5.8.0 do not have the ':utf8' IO Layer, thus
|
||||
for the default method and for reading the xml files
|
||||
utf8 is not supported for these versions.
|
||||
|
||||
Since it is not possible to distinguish between encoding types (utf8, latin1, latin2 etc.)
|
||||
in a straightforward manner only utf8 is supported (because the spec recommends this).
|
||||
|
||||
This module does not yet check extended attributes for a mimetype.
|
||||
Patches for this are very welcome.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Jaap Karssenberg E<lt>pardus@cpan.orgE<gt>
|
||||
Maintained by Michiel Beijen E<lt>michiel.beijen@gmail.comE<gt>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright (c) 2003, 2012 Jaap G Karssenberg. All rights reserved.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<File::BaseDir>,
|
||||
L<File::MimeInfo::Magic>,
|
||||
L<File::MimeInfo::Applications>,
|
||||
L<File::MimeInfo::Rox>
|
||||
|
||||
=over 4
|
||||
|
||||
=item related CPAN modules
|
||||
|
||||
L<File::MMagic>
|
||||
|
||||
=item freedesktop specifications used
|
||||
|
||||
L<http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec>,
|
||||
L<http://www.freedesktop.org/wiki/Specifications/basedir-spec>,
|
||||
L<http://www.freedesktop.org/wiki/Specifications/desktop-entry-spec>
|
||||
|
||||
=item freedesktop mime database
|
||||
|
||||
L<http://www.freedesktop.org/wiki/Software/shared-mime-info>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
@@ -95,9 +95,9 @@ else {
|
||||
}
|
||||
if ($table->{'name'} eq 'nat' && $rule->{'chain'} ne 'POSTROUTING') {
|
||||
if ($rule->{'j'}->[1] eq 'DNAT' && !$in{'dnatdef'}) {
|
||||
!$in{'dipfrom'} || &check_ipaddress($in{'dipfrom'}) ||
|
||||
!$in{'dipfrom'} || &check_ip6address($in{'dipfrom'}) ||
|
||||
&error($text{'save_edipfrom'});
|
||||
!$in{'dipto'} || &check_ipaddress($in{'dipto'}) ||
|
||||
!$in{'dipto'} || &check_ip6address($in{'dipto'}) ||
|
||||
&error($text{'save_edipto'});
|
||||
local $v = "[".$in{'dipfrom'}."]";
|
||||
$v .= "-[".$in{'dipto'}."]" if ($in{'dipto'});
|
||||
@@ -123,9 +123,9 @@ else {
|
||||
$rule->{'chain'} ne 'OUTPUT') {
|
||||
if ($rule->{'j'}->[1] eq 'SNAT' && !$in{'snatdef'}) {
|
||||
(!$in{'sipfrom'} && !$in{'sipto'}) ||
|
||||
&check_ipaddress($in{'sipfrom'}) ||
|
||||
&check_ip6address($in{'sipfrom'}) ||
|
||||
&error($text{'save_esipfrom'});
|
||||
!$in{'sipto'} || &check_ipaddress($in{'sipto'}) ||
|
||||
!$in{'sipto'} || &check_ip6address($in{'sipto'}) ||
|
||||
&error($text{'save_esipto'});
|
||||
local $v = $in{'sipfrom'};
|
||||
$v .= "-".$in{'sipto'} if ($in{'sipto'});
|
||||
|
||||
6
frox/config-openSUSE-Linux-15.0-ALL
Normal file
@@ -0,0 +1,6 @@
|
||||
frox=/usr/sbin/frox
|
||||
frox_conf=/etc/frox.conf
|
||||
alt_frox_conf=/usr/share/doc/packages/frox-0.7.9/frox.conf
|
||||
start_cmd=systemctl start frox
|
||||
stop_cmd=systemctl stop frox
|
||||
apply_cmd=systemctl reload frox
|
||||
@@ -272,7 +272,7 @@ local ($wrong_password, $got_login, $connect_failed);
|
||||
local $out;
|
||||
local $stars = ("*" x length($pass));
|
||||
while(1) {
|
||||
local $rv = &wait_for($cfh, "password:", "yes\\/no", "(^|\\n)\\s*Permission denied.*\n", "ssh: connect.*\n", ".*\n");
|
||||
local $rv = &wait_for($cfh, "password:|Password\\s+for\\s+\\S+:", "yes\\/no", "(^|\\n)\\s*Permission denied.*\n", "ssh: connect.*\n", ".*\n");
|
||||
if ($wait_for_input !~ /^\s*DUMP:\s+ACLs\s+in\s+inode/i) {
|
||||
$wait_for_input =~ s/\Q$pass\E/$stars/g;
|
||||
if ($fhmode) {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
---- Changes since 1.280 ----
|
||||
First version of this theme.
|
||||
---- Changes since 1.290 ----
|
||||
The current category name is now underlined.
|
||||
Reduced the thickness of border lines.
|
||||
All icons are now shown half the usual size, with the titles to the right instead of below.
|
||||
---- Changes since 1.300 ----
|
||||
Totally re-worked theme to use a new framed design, with a Javascript collapsing category menu.
|
||||
---- Changes since 1.310 ----
|
||||
Added Webmin Servers link on the left menu, when accessed via the Webmin Servers Index module.
|
||||
---- Changes since 1.320 ----
|
||||
Added a feedback link to the left menu, but only when a custom feedback address is set.
|
||||
---- Changes since 1.330 ----
|
||||
Updated the color schema to match the new webmin.com, and made table borders and forms nicer (thanks to Joe).
|
||||
Added a whole new set of icons from Virtualmin.
|
||||
---- Changes since 1.340 ----
|
||||
Fixed bad table indentation on some browsers.
|
||||
Changed link colors to be darker.
|
||||
---- Changes since 1.400 ----
|
||||
Display system uptime in the right frame after logging in.
|
||||
---- Changes since 1.430 ----
|
||||
Updated CSS and all UI elements to match the Virtualmin theme, except for colors and icons.
|
||||
BIN
gray-theme/acl/images/twofactor.gif
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
gray-theme/cluster-copy/images/smallicon.gif
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
gray-theme/cluster-cron/images/smallicon.gif
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
gray-theme/cluster-passwd/images/smallicon.gif
Normal file
|
After Width: | Height: | Size: 852 B |
BIN
gray-theme/cluster-shell/images/smallicon.gif
Normal file
|
After Width: | Height: | Size: 972 B |
BIN
gray-theme/cluster-software/images/smallicon.gif
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
127
gray-theme/config.cgi
Executable file
@@ -0,0 +1,127 @@
|
||||
#!/usr/local/bin/perl
|
||||
# Display a form for editing the configuration of a module, one section at
|
||||
# a time.
|
||||
|
||||
require "gray-theme/gray-theme-lib.pl";
|
||||
require './config-lib.pl';
|
||||
&ReadParse();
|
||||
|
||||
$m = $in{'module'} || $ARGV[0];
|
||||
&foreign_available($m) || &error($text{'config_eaccess'});
|
||||
%access = &get_module_acl(undef, $m);
|
||||
$access{'noconfig'} &&
|
||||
&error($text{'config_ecannot'});
|
||||
%module_info = &get_module_info($m);
|
||||
if (-r &help_file($m, "config_intro")) {
|
||||
$help = [ "config_intro", $m ];
|
||||
}
|
||||
else {
|
||||
$help = undef;
|
||||
}
|
||||
&ui_print_header(&text('config_dir', $module_info{'desc'}),
|
||||
$text{'config_title'}, "", $help, 0, 1);
|
||||
$mdir = &module_root_directory($m);
|
||||
my $mdir_conf_file = "$mdir/config.info";
|
||||
if ($current_lang && $default_lang &&
|
||||
$current_lang ne $default_lang &&
|
||||
-r "$mdir_conf_file.$current_lang")
|
||||
{
|
||||
$mdir_conf_file .= ".$current_lang";
|
||||
}
|
||||
|
||||
# Read the config.info file to find sections
|
||||
&read_file($mdir_conf_file, \%info, \@info_order);
|
||||
|
||||
# Call any config preload function
|
||||
if (&foreign_require($m) &&
|
||||
&foreign_defined($m, 'config_pre_load')) {
|
||||
&foreign_call($m, "config_pre_load", \%info, \@info_order);
|
||||
}
|
||||
|
||||
foreach $i (@info_order) {
|
||||
@p = split(/,/, $info{$i});
|
||||
if ($p[1] == 11) {
|
||||
push(@sections, [ $i, $p[0] ]);
|
||||
}
|
||||
}
|
||||
if (@sections > 1) {
|
||||
# Work out template section to edit
|
||||
$in{'section'} ||= $sections[0]->[0];
|
||||
$idx = &indexof($in{'section'}, map { $_->[0] } @sections);
|
||||
if ($in{'nprev'}) {
|
||||
$idx--;
|
||||
$idx = @sections-1 if ($idx < 0);
|
||||
}
|
||||
elsif ($in{'nnext'}) {
|
||||
$idx++;
|
||||
$idx = 0 if ($idx >= @sections);
|
||||
}
|
||||
$in{'section'} = $sections[$idx]->[0];
|
||||
|
||||
# We have some sections .. show a menu to select
|
||||
print &ui_form_start("config.cgi");
|
||||
print &ui_hidden("module", $m),"\n";
|
||||
print $text{'config_section'},"\n";
|
||||
print &ui_select("section", $in{'section'}, \@sections,
|
||||
1, 0, 0, 0, "onChange='form.submit()'");
|
||||
print &ui_submit($text{'config_change'});
|
||||
print " \n";
|
||||
print &ui_submit($text{'config_nprev'}, "nprev");
|
||||
print &ui_submit($text{'config_nnext'}, "nnext");
|
||||
print &ui_form_end();
|
||||
($s) = grep { $_->[0] eq $in{'section'} } @sections;
|
||||
$sname = $s->[1];
|
||||
}
|
||||
|
||||
print &ui_form_start("config_save.cgi", "post");
|
||||
print &ui_hidden("module", $m),"\n";
|
||||
print &ui_hidden("section", $in{'section'}),"\n";
|
||||
if ($s) {
|
||||
# Find next section
|
||||
$idx = &indexof($s, @sections);
|
||||
if ($idx == @sections-1) {
|
||||
print &ui_hidden("section_next", $sections[0]->[0]);
|
||||
}
|
||||
else {
|
||||
print &ui_hidden("section_next", $sections[$idx+1]->[0]);
|
||||
}
|
||||
}
|
||||
print &ui_table_start($sname, "width=100%", 2);
|
||||
|
||||
# Load module config defaults (fill missing)
|
||||
my $mdefconf = "$mdir/config";
|
||||
$mdefconf = "$mdir/config-$gconfig{'os_type'}"
|
||||
if (-r "$mdir/config-$gconfig{'os_type'}");
|
||||
&read_file($mdefconf, \%newconfig);
|
||||
|
||||
# Load module config custom
|
||||
&read_file("$config_directory/$m/config", \%newconfig);
|
||||
|
||||
# Load module config user custom
|
||||
&load_module_preferences($m, \%newconfig);
|
||||
|
||||
if (-r "$mdir/config_info.pl") {
|
||||
# Module has a custom config editor
|
||||
&foreign_require($m, "config_info.pl");
|
||||
local $fn = "${m}::config_form";
|
||||
if (defined(&$fn)) {
|
||||
$func++;
|
||||
&foreign_call($m, "config_form", \%newconfig);
|
||||
}
|
||||
}
|
||||
if (!$func) {
|
||||
# Use config.info to create config inputs
|
||||
&generate_config(\%newconfig, $mdir_conf_file, $m, undef, undef,
|
||||
$in{'section'});
|
||||
}
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ "save", $text{'save'} ],
|
||||
$s ? ( [ "save_next", $text{'config_next'} ] ) : ( ) ]);
|
||||
|
||||
if ($m eq "virtual-server") {
|
||||
&ui_print_footer("/right.cgi", $text{'config_return'});
|
||||
}
|
||||
else {
|
||||
&ui_print_footer("/$m", $text{'index'});
|
||||
}
|
||||
|
||||
53
gray-theme/config_save.cgi
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/usr/local/bin/perl
|
||||
# config_save.cgi
|
||||
# Save inputs from config.cgi
|
||||
|
||||
require "gray-theme/gray-theme-lib.pl";
|
||||
require './config-lib.pl';
|
||||
&ReadParse();
|
||||
$m = $in{'module'};
|
||||
&error_setup($text{'config_err'});
|
||||
&foreign_available($m) || &error($text{'config_eaccess'});
|
||||
%access = &get_module_acl(undef, $m);
|
||||
$access{'noconfig'} && &error($text{'config_ecannot'});
|
||||
|
||||
mkdir("$config_directory/$m", 0700);
|
||||
&lock_file("$config_directory/$m/config");
|
||||
&read_file("$config_directory/$m/config", \%newconfig);
|
||||
%oldconfig = %newconfig;
|
||||
|
||||
$mdir = &module_root_directory($m);
|
||||
if (-r "$mdir/config_info.pl") {
|
||||
# Module has a custom config editor
|
||||
&foreign_require($m, "config_info.pl");
|
||||
local $fn = "${m}::config_form";
|
||||
if (defined(&$fn)) {
|
||||
$func++;
|
||||
&foreign_call($m, "config_save", \%newconfig);
|
||||
}
|
||||
}
|
||||
if (!$func) {
|
||||
# Use config.info to parse config inputs
|
||||
&parse_config(\%newconfig, "$mdir/config.info", $m, undef, $in{'section'});
|
||||
}
|
||||
&write_file("$config_directory/$m/config", \%newconfig);
|
||||
&unlock_file("$config_directory/$m/config");
|
||||
&save_module_preferences($m, \%newconfig);
|
||||
|
||||
# Call any post-config save function
|
||||
if (&foreign_require($m) &&
|
||||
&foreign_defined($m, 'config_post_save')) {
|
||||
&foreign_call($m, "config_post_save", \%newconfig, \%oldconfig)
|
||||
}
|
||||
|
||||
&webmin_log("_config_", undef, undef, \%in, $m);
|
||||
if ($in{'save_next'}) {
|
||||
&redirect("config.cgi?module=$in{'module'}§ion=$in{'section_next'}");
|
||||
}
|
||||
elsif ($m eq "virtual-server") {
|
||||
&redirect("/right.cgi");
|
||||
}
|
||||
else {
|
||||
&redirect("/$m/");
|
||||
}
|
||||
|
||||
BIN
gray-theme/dhcpd-2.0/images/group.gif
Normal file
|
After Width: | Height: | Size: 800 B |
BIN
gray-theme/dhcpd-2.0/images/host.gif
Normal file
|
After Width: | Height: | Size: 768 B |
BIN
gray-theme/dhcpd-2.0/images/icon.gif
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
gray-theme/dhcpd-2.0/images/shared.gif
Normal file
|
After Width: | Height: | Size: 585 B |
BIN
gray-theme/dhcpd-2.0/images/subnet.gif
Normal file
|
After Width: | Height: | Size: 559 B |
24
gray-theme/edit_overlay.cgi
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/local/bin/perl
|
||||
# Show a form for changing the theme overlay
|
||||
|
||||
require "gray-theme/gray-theme-lib.pl";
|
||||
|
||||
# Get the user and themes
|
||||
&foreign_require("acl", "acl-lib.pl");
|
||||
@overlays = &list_virtualmin_theme_overlays();
|
||||
($user) = grep { $_->{'name'} eq $base_remote_user } &acl::list_users();
|
||||
$user || &error($text{'overlay_euser'});
|
||||
$overlay = $current_themes[1];
|
||||
|
||||
&ui_print_header(undef, $text{'overlay_title'}, "");
|
||||
|
||||
print &ui_form_start("save_overlay.cgi");
|
||||
print $text{'overlay_desc'},"<p>\n";
|
||||
print "<b>$text{'overlay_msg'}</b>\n";
|
||||
print &ui_select("overlay", $overlay,
|
||||
[ [ "", $text{'overlay_none'} ],
|
||||
map { [ $_->{'dir'}, $_->{'desc'} ] } @overlays ]),"<br>\n";
|
||||
print &ui_form_end([ [ undef, $text{'overlay_ok'} ] ]);
|
||||
|
||||
&ui_print_footer("right.cgi", $text{'right_return'});
|
||||
|
||||
110
gray-theme/edit_right.cgi
Executable file
@@ -0,0 +1,110 @@
|
||||
#!/usr/local/bin/perl
|
||||
# Show a form for configuring what gets dislayed on the right frame
|
||||
|
||||
require "gray-theme/gray-theme-lib.pl";
|
||||
require "gray-theme/theme.pl";
|
||||
|
||||
($hasvirt, $level, $hasvm2) = &get_virtualmin_user_level();
|
||||
$sects = &get_right_frame_sections();
|
||||
!$sects->{'global'} ||
|
||||
$hasvirt && &virtual_server::master_admin() ||
|
||||
$hasvm2 && !$server_manager::access{'owner'} ||
|
||||
&error($text{'edright_ecannot'});
|
||||
|
||||
&ui_print_header(undef, $text{'edright_title'}, "", undef, 0, 1, 1);
|
||||
|
||||
print &ui_form_start("save_right.cgi", "post");
|
||||
print &ui_table_start($text{'edright_header'}, undef ,2);
|
||||
|
||||
# Visible sections
|
||||
print &ui_table_row($text{'edright_sects'},
|
||||
join("<br>\n", map { &ui_checkbox($_->{'name'}, 1, $_->{'title'},
|
||||
!$sects->{'no'.$_->{'name'}}) }
|
||||
&list_right_frame_sections()));
|
||||
|
||||
# Show list by default
|
||||
print &ui_table_row($text{'edright_list'},
|
||||
&ui_radio("list", $sects->{'list'} || 0,
|
||||
[ [ 0, $text{'edright_list0'} ],
|
||||
$hasvirt ? ( [ 1, $text{'edright_list1'} ] ) : ( ),
|
||||
$hasvm2 ? ( [ 2, $text{'edright_list2'} ] ) : ( ),
|
||||
]));
|
||||
|
||||
# Alternate page
|
||||
print &ui_table_row($text{'edright_alt'},
|
||||
&ui_opt_textbox("alt", $sects->{'alt'}, 40, $text{'edright_altdef'}."<br>",
|
||||
$text{'edright_alturl'}));
|
||||
|
||||
# Default tab
|
||||
print &ui_table_row($text{'edright_deftab'},
|
||||
&ui_select("tab", $sects->{'tab'},
|
||||
[ [ "", $text{'edright_tab1'} ],
|
||||
$hasvirt ? ( [ "virtualmin", $text{'edright_virtualmin'} ] ) : ( ),
|
||||
$hasvm2 ? ( [ "vm2", $text{'edright_vm2'} ] ) : ( ),
|
||||
[ "webmin", $text{'edright_webmin'} ] ]));
|
||||
|
||||
# Left frame size
|
||||
print &ui_table_row($text{'edright_fsize'},
|
||||
&ui_opt_textbox("fsize", $sects->{'fsize'}, 6, $text{'edright_fsizedef'}).
|
||||
" ".$text{'edright_pixels'});
|
||||
|
||||
# Show search box
|
||||
print &ui_table_row($text{'edright_search'},
|
||||
&ui_yesno_radio("search", !$sects->{'nosearch'}));
|
||||
|
||||
if ($hasvirt) {
|
||||
# Default domain
|
||||
print &ui_table_row($text{'edright_dom'},
|
||||
&ui_select("dom", $sects->{'dom'},
|
||||
[ [ "", $text{'edright_first'} ],
|
||||
map { [ $_->{'id'}, &virtual_server::show_domain_name($_) ] }
|
||||
grep { &virtual_server::can_edit_domain($_) }
|
||||
sort { $a->{'dom'} cmp $b->{'dom'} }
|
||||
&virtual_server::list_domains() ]));
|
||||
|
||||
# Sort quotas by bytes or percent
|
||||
print &ui_table_row($text{'edright_qsort'},
|
||||
&ui_radio("qsort", int($sects->{'qsort'}),
|
||||
[ [ 1, $text{'edright_qsort1'} ],
|
||||
[ 0, $text{'edright_qsort0'} ] ]));
|
||||
|
||||
# Show quotas as bytes or percent
|
||||
print &ui_table_row($text{'edright_qshow'},
|
||||
&ui_radio("qshow", int($sects->{'qshow'}),
|
||||
[ [ 1, $text{'edright_qsort1'} ],
|
||||
[ 0, $text{'edright_qsort0'} ] ]));
|
||||
|
||||
# Number of servers to show
|
||||
print &ui_table_row($text{'edright_max'},
|
||||
&ui_opt_textbox("max", $sects->{'max'}, 5,
|
||||
$text{'default'}." ($default_domains_to_show)"));
|
||||
}
|
||||
|
||||
if ($hasvm2) {
|
||||
# Default Cloudmin server
|
||||
@servers = &server_manager::list_available_managed_servers_sorted();
|
||||
print &ui_table_row($text{'edright_server'},
|
||||
&ui_select("server", $sects->{'server'},
|
||||
[ [ "", $text{'edright_first'} ],
|
||||
map { [ $_->{'id'}, $_->{'host'} ] } @servers ]));
|
||||
}
|
||||
|
||||
if ($hasvirt && &virtual_server::master_admin() ||
|
||||
$hasvm2 && &server_manager::can_action(undef, "global")) {
|
||||
# Allow changing
|
||||
print &ui_table_row($text{'edright_global'},
|
||||
&ui_yesno_radio("global", int($sects->{'global'})));
|
||||
|
||||
# Show Webmin category
|
||||
print &ui_table_row($text{'edright_nowebmin'},
|
||||
&ui_radio("nowebmin", int($sects->{'nowebmin'}),
|
||||
[ [ 0, $text{'yes'} ],
|
||||
[ 1, $text{'no'} ],
|
||||
[ 2, $text{'edright_others'} ] ]));
|
||||
}
|
||||
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ "save", $text{'save'} ] ]);
|
||||
|
||||
&ui_print_footer("right.cgi", $text{'right_return'});
|
||||
|
||||
BIN
gray-theme/escputil/images/icon.gif
Normal file
|
After Width: | Height: | Size: 449 B |
BIN
gray-theme/favicon.ico
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
gray-theme/fdisk/images/smallicon.gif
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
gray-theme/generate-acls/images/icon.gif
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
185
gray-theme/gray-theme-lib.pl
Normal file → Executable file
@@ -1,9 +1,184 @@
|
||||
# Common functions for theme CGIs
|
||||
# Functions used by theme CGIs
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
BEGIN { push(@INC, ".."); };
|
||||
use WebminCore;
|
||||
eval "use WebminCore;";
|
||||
if ($@) {
|
||||
do '../web-lib.pl';
|
||||
do '../ui-lib.pl';
|
||||
}
|
||||
&init_config();
|
||||
&load_theme_library();
|
||||
%text = &load_language($current_theme);
|
||||
$right_frame_sections_file = "$config_directory/$current_theme/sections";
|
||||
$default_domains_to_show = 10;
|
||||
|
||||
# get_left_frame_width()
|
||||
# Returns the width of the left frame in pixels
|
||||
sub get_left_frame_width
|
||||
{
|
||||
local $sects = &get_right_frame_sections();
|
||||
return $sects->{'fsize'} ? $sects->{'fsize'} :
|
||||
&get_product_name() eq 'usermin' ? 200 :
|
||||
&foreign_available("server-manager") &&
|
||||
&foreign_available("virtual-server") ? 280 : 260;
|
||||
}
|
||||
|
||||
# list_virtualmin_theme_overlays()
|
||||
# Returns a list of overlay themes suitable for this theme
|
||||
sub list_virtualmin_theme_overlays
|
||||
{
|
||||
&foreign_require("webmin", "webmin-lib.pl");
|
||||
local @rv;
|
||||
foreach my $tinfo (&webmin::list_themes()) {
|
||||
if ($tinfo->{'overlay'} &&
|
||||
(!$tinfo->{'overlays'} ||
|
||||
&indexof($current_theme,
|
||||
split(/\s+/, $tinfo->{'overlays'})) >= 0)) {
|
||||
push(@rv, $tinfo);
|
||||
}
|
||||
}
|
||||
return @rv;
|
||||
}
|
||||
|
||||
sub get_virtualmin_docs
|
||||
{
|
||||
local ($level) = @_;
|
||||
return $level == 0 ? "http://www.virtualmin.com/documentation" :
|
||||
$level == 1 ? "http://www.virtualmin.com/documentation/users/reseller" :
|
||||
$level == 2 ? "http://www.virtualmin.com/documentation/users/server-owner" :
|
||||
"http://www.virtualmin.com/documentation";
|
||||
}
|
||||
|
||||
sub get_vm2_docs
|
||||
{
|
||||
local ($level) = @_;
|
||||
return "http://www.virtualmin.com/documentation/cloudmin";
|
||||
}
|
||||
|
||||
# get_right_frame_sections()
|
||||
# Returns a hash containg details of visible right-frame sections
|
||||
sub get_right_frame_sections
|
||||
{
|
||||
local %sects;
|
||||
&read_file($right_frame_sections_file, \%sects);
|
||||
if ($sects{'global'}) {
|
||||
# Force use of global settings
|
||||
return \%sects;
|
||||
}
|
||||
else {
|
||||
# Can try personal settings, but fall back to global
|
||||
local %usersects;
|
||||
if (&read_file($right_frame_sections_file.".".$remote_user,
|
||||
\%usersects)) {
|
||||
return \%usersects;
|
||||
}
|
||||
else {
|
||||
return \%sects;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# save_right_frame_sections(§s)
|
||||
sub save_right_frame_sections
|
||||
{
|
||||
local ($sects) = @_;
|
||||
&make_dir("$config_directory/$current_theme", 0700);
|
||||
if ($sects->{'global'}) {
|
||||
# Update global settings, for all users
|
||||
&write_file($right_frame_sections_file, $sects);
|
||||
}
|
||||
else {
|
||||
# Save own, and turn off global flag (if this is the master admin)
|
||||
if (&foreign_check("virtual-server")) {
|
||||
&foreign_require("virtual-server", "virtual-server-lib.pl");
|
||||
if (&virtual_server::master_admin()) {
|
||||
local %globalsect;
|
||||
&read_file($right_frame_sections_file, \%globalsect);
|
||||
$globalsect{'global'} = 0;
|
||||
&write_file($right_frame_sections_file, \%globalsect);
|
||||
}
|
||||
}
|
||||
&write_file($right_frame_sections_file.".".$remote_user, $sects);
|
||||
}
|
||||
}
|
||||
|
||||
# list_right_frame_sections()
|
||||
# Returns a list of possible sections for the current user, as hash refs
|
||||
sub list_right_frame_sections
|
||||
{
|
||||
local ($hasvirt, $level, $hasvm2) = &get_virtualmin_user_level();
|
||||
local @rv;
|
||||
if ($level == 0) {
|
||||
# Master admin
|
||||
if ($hasvirt) {
|
||||
push(@rv, 'updates', 'status', 'newfeatures',
|
||||
'quotas', 'bw', 'ips', 'sysinfo');
|
||||
}
|
||||
if ($hasvm2) {
|
||||
push(@rv, 'vm2servers');
|
||||
}
|
||||
}
|
||||
elsif ($level == 2) {
|
||||
# Domain owner
|
||||
push(@rv, 'virtualmin');
|
||||
}
|
||||
elsif ($level == 1) {
|
||||
# Reseller
|
||||
push(@rv, 'reseller', 'quotas', 'bw');
|
||||
}
|
||||
elsif ($level == 4) {
|
||||
# Cloudmin system owner
|
||||
push(@rv, 'owner', 'vm2servers');
|
||||
}
|
||||
else {
|
||||
# Usermin
|
||||
push(@rv, 'system');
|
||||
}
|
||||
@rv = map { { 'name' => $_,
|
||||
'title' => $virtual_server::text{'right_'.$_.'header'} } } @rv;
|
||||
|
||||
# Add plugin-defined sections
|
||||
if (($level == 0 || $level == 1 || $level == 2) && $hasvirt &&
|
||||
defined(&virtual_server::list_plugin_sections)) {
|
||||
push(@rv, &virtual_server::list_plugin_sections($level));
|
||||
}
|
||||
if (($level == 0 || $level == 4) && $hasvm2 &&
|
||||
defined(&server_manager::list_plugin_sections)) {
|
||||
push(@rv, &server_manager::list_plugin_sections($level));
|
||||
}
|
||||
|
||||
return @rv;
|
||||
}
|
||||
|
||||
# get_virtualmin_user_level()
|
||||
# Returns three numbers - the first being a flag if virtualmin is installed,
|
||||
# the second a user type (3=usermin, 2=domain, 1=reseller, 0=master, 4=system
|
||||
# owner), the third a flag for Cloudmin
|
||||
sub get_virtualmin_user_level
|
||||
{
|
||||
local ($hasvirt, $hasvm2, $level);
|
||||
$hasvm2 = &foreign_available("server-manager");
|
||||
$hasvirt = &foreign_available("virtual-server");
|
||||
if ($hasvm2) {
|
||||
&foreign_require("server-manager", "server-manager-lib.pl");
|
||||
}
|
||||
if ($hasvirt) {
|
||||
&foreign_require("virtual-server", "virtual-server-lib.pl");
|
||||
}
|
||||
if ($hasvm2) {
|
||||
$level = $server_manager::access{'owner'} ? 4 : 0;
|
||||
}
|
||||
elsif ($hasvirt) {
|
||||
$level = &virtual_server::master_admin() ? 0 :
|
||||
&virtual_server::reseller_admin() ? 1 : 2;
|
||||
}
|
||||
elsif (&get_product_name() eq "usermin") {
|
||||
$level = 3;
|
||||
}
|
||||
else {
|
||||
$level = 0;
|
||||
}
|
||||
return ($hasvirt, $level, $hasvm2);
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1008 B |
|
Before Width: | Height: | Size: 445 B |
|
Before Width: | Height: | Size: 465 B |
BIN
gray-theme/images/lang.png
Normal file
|
After Width: | Height: | Size: 733 B |
|
Before Width: | Height: | Size: 571 B |
|
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 585 B |
|
Before Width: | Height: | Size: 912 B |
BIN
gray-theme/images/sig.gif
Normal file
|
After Width: | Height: | Size: 1010 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,41 +1,131 @@
|
||||
#!/usr/bin/perl
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
require 'gray-theme/gray-theme-lib.pl';
|
||||
require "gray-theme/gray-theme-lib.pl";
|
||||
require "gray-theme/theme.pl";
|
||||
&ReadParse();
|
||||
our ($current_theme, %in);
|
||||
our %text = &load_language($current_theme);
|
||||
|
||||
my $minfo;
|
||||
if ($in{'mod'}) {
|
||||
$minfo = { &get_module_info($in{'mod'}) };
|
||||
# Work out which module to open by default
|
||||
$hasvirt = &foreign_available("virtual-server");
|
||||
$hasvm2 = &foreign_available("server-manager");
|
||||
if ($in{'dom'} && $hasvirt) {
|
||||
# Caller has requested a specific domain ..
|
||||
&foreign_require("virtual-server", "virtual-server-lib.pl");
|
||||
$d = &virtual_server::get_domain($in{'dom'});
|
||||
if ($d) {
|
||||
$goto = &virtual_server::can_config_domain($d) ?
|
||||
"virtual-server/edit_domain.cgi?dom=$d->{'id'}" :
|
||||
"virtual-server/view_domain.cgi?dom=$d->{'id'}";
|
||||
$left = "left.cgi?dom=$d->{'id'}";
|
||||
}
|
||||
}
|
||||
if (!$goto) {
|
||||
# Default is determined by theme or Webmin config,
|
||||
# defaults to system info page
|
||||
local $sects = &get_right_frame_sections();
|
||||
$minfo = &get_goto_module();
|
||||
if ($sects->{'list'} == 1 && $hasvirt) {
|
||||
$goto = "virtual-server/";
|
||||
}
|
||||
elsif ($sects->{'list'} == 2 && $hasvm2) {
|
||||
$goto = "server-manager/";
|
||||
}
|
||||
elsif ($minfo &&
|
||||
$minfo->{'dir'} ne 'virtual-server' &&
|
||||
$minfo->{'dir'} ne 'server-manager') {
|
||||
$goto = "$minfo->{'dir'}/";
|
||||
}
|
||||
else {
|
||||
$goto = "right.cgi".
|
||||
"?open=system&auto=status&open=updates&".
|
||||
"open=common&open=owner&open=reseller&open=vm2limits&".
|
||||
"open=vm2usage";
|
||||
}
|
||||
$left = "left.cgi";
|
||||
if ($minfo) {
|
||||
$left .= "?$minfo->{'category'}=1";
|
||||
}
|
||||
}
|
||||
|
||||
# Work out the title that includes the version
|
||||
if ($hasvirt) {
|
||||
%minfo = &get_module_info("virtual-server");
|
||||
$title = &text('index_virtualmintitle', $minfo{'version'});
|
||||
}
|
||||
elsif ($hasvm2) {
|
||||
%minfo = &get_module_info("server-manager");
|
||||
$title = &text('index_cloudmintitle', $minfo{'version'});
|
||||
}
|
||||
elsif (&get_product_name() eq 'usermin') {
|
||||
$title = &text('index_usermintitle', &get_webmin_version());
|
||||
}
|
||||
else {
|
||||
$minfo = &get_goto_module();
|
||||
$title = &text('index_webmintitle', &get_webmin_version());
|
||||
}
|
||||
my $goto = $minfo ? $minfo->{'dir'}."/" :
|
||||
$in{'page'} ? "" : "right.cgi";
|
||||
if ($in{'page'}) {
|
||||
$goto .= "/".$in{'page'};
|
||||
$title = &get_html_title($title);
|
||||
|
||||
# Work out if we have a top frame
|
||||
if ($hasvirt) {
|
||||
%vconfig = &foreign_config("virtual-server");
|
||||
}
|
||||
$upperframe = $vconfig{'theme_topframe'} ||
|
||||
$gconfig{'theme_topframe'};
|
||||
$upperrows = $vconfig{'theme_toprows'} ||
|
||||
$gconfig{'theme_toprows'} || 200;
|
||||
if ($upperframe =~ /\$LEVEL|\$\{LEVEL/) {
|
||||
# Sub in user level
|
||||
$levelnum = &get_virtualmin_user_level();
|
||||
$level = $levelnum == 0 ? "master" :
|
||||
$levelnum == 1 ? "reseller" :
|
||||
$levelnum == 2 ? "domain" :
|
||||
$levelnum == 3 ? "usermin" :
|
||||
$levelnum == 4 ? "owner" : "unknown";
|
||||
$upperframe = &substitute_template($upperframe, { 'level' => $level });
|
||||
}
|
||||
my $cat = $minfo ? "?$minfo->{'category'}=1" : "";
|
||||
|
||||
# Show frameset
|
||||
my $title = &get_html_framed_title();
|
||||
my $cols = &get_product_name() eq 'usermin' ? 180 : 230;
|
||||
&popup_header($title, undef, undef, 1);
|
||||
&PrintHeader();
|
||||
$cols = &get_left_frame_width();
|
||||
$frame1 = "<frame name=left title=Navigation src='$left' scrolling=auto>";
|
||||
$frame2 = "<frame name=right title=Content src='$goto' noresize scrolling=auto>";
|
||||
$fscols = "$cols,*";
|
||||
if ($current_lang_info->{'rtl'} || $current_lang eq "ar") {
|
||||
($frame1, $frame2) = ($frame2, $frame1);
|
||||
$fscols = "*,$cols";
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
<frameset cols="$cols,*" border=0>
|
||||
<frame name="left" src="left.cgi$cat" scrolling="auto">
|
||||
<frame name="right" src="$goto" noresize>
|
||||
<noframes>
|
||||
<body>
|
||||
<p>This page uses frames, but your browser doesn't support them.</p>
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
EOF
|
||||
&popup_footer(1);
|
||||
# Page header
|
||||
print "<html>\n";
|
||||
print "<head> <title>$title</title> </head>\n";
|
||||
|
||||
# Upper custom frame
|
||||
if ($upperframe) {
|
||||
print "<frameset rows='$upperrows,*' border=0>\n";
|
||||
if ($upperframe =~ /^\//) {
|
||||
# Local file to serve
|
||||
print "<frame name=top src='top.cgi' scrolling=auto>\n";
|
||||
}
|
||||
else {
|
||||
# Absolute URL
|
||||
print "<frame name=top src='$upperframe' scrolling=auto>\n";
|
||||
}
|
||||
}
|
||||
|
||||
# Left and right frames
|
||||
print "<frameset cols='$fscols' border=0>\n";
|
||||
print $frame1,"\n";
|
||||
print $frame2,"\n";
|
||||
|
||||
# What if no frames?
|
||||
print "<noframes>\n";
|
||||
print "<body>\n";
|
||||
print "<p>This page uses frames, but your browser doesn't support them.</p>\n";
|
||||
print "</body>\n";
|
||||
print "</noframes>\n";
|
||||
|
||||
# End of the frames and page
|
||||
if ($upperframe) {
|
||||
print "</frameset>\n";
|
||||
}
|
||||
print "</frameset>\n";
|
||||
print "</html>\n";
|
||||
|
||||
|
||||