-
Notifications
You must be signed in to change notification settings - Fork 1
/
postinstall.pl
executable file
·42 lines (38 loc) · 1.16 KB
/
postinstall.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use strict;
use warnings;
our (%text);
our $module_name;
our $config_directory;
require 'password-recovery-lib.pl';
sub module_install
{
# Grant anonymous access
&foreign_require("acl", "acl-lib.pl");
&acl::setup_anonymous_access("/$module_name", $module_name);
# Add 'forgot password' link to Webmin login form
my %clang;
&read_file("$config_directory/custom-lang", \%clang);
if (!$clang{'session_postfix'}) {
$clang{'session_postfix'} =
"<center><a href=/$module_name/>$text{'login_forgot'}</a></center>";
&write_file("$config_directory/custom-lang", \%clang);
}
# Also add to Usermin login form
if (&foreign_installed("usermin")) {
&foreign_require("usermin");
&foreign_require("virtual-server");
my %uclang;
&read_file("$usermin::config{'usermin_dir'}/custom-lang", \%uclang);
if (!$uclang{'session_postfix'}) {
my %miniserv;
&get_miniserv_config(\%miniserv);
my $port = $miniserv{'port'};
$uclang{'session_postfix'} =
"<center><a href=/$module_name/usermin.cgi ".
"onclick='javascript:event.target.port=$port'>".
"$text{'login_forgot2'}</a></center>";
&write_file("$usermin::config{'usermin_dir'}/custom-lang",
\%uclang);
}
}
}