mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Merge branch 'master' of github.com:webmin/webmin
This commit is contained in:
@@ -3763,7 +3763,7 @@ elsif ($config{'passwd_file'}) {
|
||||
local $day = time()/(24*60*60);
|
||||
print DEBUG "validate_unix_user: c=$c m=$m day=$day\n";
|
||||
$m ||= 0;
|
||||
if ($c =~ /^\d+/ && $day - $c > $m) {
|
||||
if ($c =~ /^\d+/ && $m =~ /^\d+/ && $day - $c > $m) {
|
||||
# Yep, it has ..
|
||||
$rv = 2;
|
||||
}
|
||||
|
||||
@@ -201,9 +201,11 @@ $passmode = $pass eq "" && $random_password eq "" ? 0 :
|
||||
$pass && $pass ne $config{'lock_string'} &&
|
||||
$random_password eq "" ? 2 : -1;
|
||||
$pffunc = $config{'passwd_stars'} ? \&ui_password : \&ui_textbox;
|
||||
print &ui_table_row(&hlink($text{'pass'}, "pass"),
|
||||
&ui_radio_table("passmode", $passmode,
|
||||
[ [ 0, $config{'empty_mode'} ? $text{'none1'} : $text{'none2'} ],
|
||||
my $modes = [];
|
||||
if ($passmode eq '0' || $config{'empty_mode'}) {
|
||||
push(@{$modes}, [ 0, $config{'empty_mode'} ? $text{'none1'} : $text{'none2'} ]);
|
||||
}
|
||||
push(@{$modes},
|
||||
[ 1, $text{'nologin'} ],
|
||||
[ 3, $text{'clear'},
|
||||
&$pffunc("pass", $config{'random_password'} && $n eq "" ?
|
||||
@@ -212,8 +214,9 @@ print &ui_table_row(&hlink($text{'pass'}, "pass"),
|
||||
( [ 2, $text{'nochange'},
|
||||
&ui_hidden("encpass", $pass) ] ) :
|
||||
( [ 2, $text{'encrypted'},
|
||||
&ui_textbox("encpass", $passmode == 2 ? $pass : "", 60) ] )
|
||||
]).
|
||||
&ui_textbox("encpass", $passmode == 2 ? $pass : "", 60) ] ));
|
||||
print &ui_table_row(&hlink($text{'pass'}, "pass"),
|
||||
&ui_radio_table("passmode", $passmode, $modes).
|
||||
($can_disable ? " ".&ui_checkbox("disable", 1,
|
||||
$text{'uedit_disabled'}, $disabled) : "")
|
||||
);
|
||||
|
||||
@@ -327,7 +327,8 @@ my $tmp_base = $gconfig{'tempdir_'.&get_module_name()} ?
|
||||
$ENV{'TMP'} && $ENV{'TMP'} ne "/tmp" ? $ENV{'TMP'} :
|
||||
-d "c:/temp" ? "c:/temp" : "/tmp/.webmin";
|
||||
my $tmp_dir;
|
||||
if (@remote_user_info && -d $remote_user_info[7] && !$gconfig{'nohometemp'}) {
|
||||
if (@remote_user_info && -d $remote_user_info[7] &&
|
||||
-w $remote_user_info[7] && !$gconfig{'nohometemp'}) {
|
||||
$tmp_dir = "$remote_user_info[7]/.tmp";
|
||||
}
|
||||
elsif (@remote_user_info) {
|
||||
@@ -1995,14 +1996,21 @@ if (!$@) {
|
||||
my $opts = ref($only) ? $only : {};
|
||||
my $locale_default = &get_default_system_locale();
|
||||
my $locale_auto = &parse_accepted_language();
|
||||
my $locale_name = $opts->{'locale'} || $gconfig{'locale_'.$remote_user} || $locale_auto || $gconfig{'locale'} || &get_default_system_locale();
|
||||
my $locale_name = $opts->{'locale'} || $gconfig{'locale_'.$remote_user} ||
|
||||
$locale_auto || $gconfig{'locale'} || &get_default_system_locale();
|
||||
my $tz = $opts->{'tz'};
|
||||
if (!$tz) {
|
||||
eval {
|
||||
$tz = DateTime::TimeZone->new( name => 'local' )->name(); # Asia/Nicosia
|
||||
$tz =
|
||||
DateTime::TimeZone->new(name => strftime("%z", localtime()))->name(); # +0200
|
||||
};
|
||||
if ($@) {
|
||||
$tz = DateTime::TimeZone->new( name => 'UTC' )->name(); # UTC
|
||||
eval {
|
||||
$tz = DateTime::TimeZone->new(name => 'local')->name(); # Asia/Nicosia
|
||||
};
|
||||
if ($@) {
|
||||
$tz = DateTime::TimeZone->new(name => 'UTC')->name(); # UTC
|
||||
}
|
||||
}
|
||||
}
|
||||
my $locale = DateTime::Locale->load($locale_name);
|
||||
|
||||
Reference in New Issue
Block a user