Created the new Blocked Hosts and Users page to show blocks currently in force, and allow them to be cleared.
---- Changes since 1.360 ----
Separated the Configure Module page into tabs, to make it clearer which options are global and which are default user preferences.
+---- Changes since 1.370 ----
+The format for dates displayed by Webmin can be changed by a new option on the User Interface page.
$uconfig{'hostnamemode'} = $in{'hostnamemode'};
$uconfig{'hostnamedisplay'} = $in{'hostnamedisplay'};
$uconfig{'notabs'} = $in{'notabs'};
+$uconfig{'dateformat'} = $in{'dateformat'};
&write_file($usermin_config, \%uconfig);
&unlock_file($usermin_config);
&webmin_log('ui', undef, undef, \%in);
printf "<input name=notabs type=radio value=1 %s> %s</td> </tr>\n",
$uconfig{'notabs'} ? 'checked' : '', $text{'no'};
+print "<tr> <td><b>$webmin::text{'ui_dateformat'}</b></td> <td>\n";
+print &ui_select("dateformat", $uconfig{'dateformat'} || "dd/mon/yyyy",
+ [ map { [ $_, $webmin::text{'ui_dateformat_'.$_} ] }
+ @webmin_date_formats ]));
+print "</td> </tr>\n";
+
print "</table></td></tr></table>\n";
print "<input type=submit value=\"$text{'save'}\"></form>\n";
# Converts a Unix date/time in seconds to a human-readable form
sub make_date
{
-local @tm = localtime($_[0]);
-if ($_[1]) {
- return sprintf "%d/%s/%d",
+local ($secs, $only) = @_;
+local @tm = localtime($secs);
+local $date;
+local $fmt = $gconfig{'dateformat'} || 'dd/mon/yyyy';
+if ($fmt eq 'dd/mon/yyyy') {
+ $date = sprintf "%2.2d/%s/%4.4d",
$tm[3], $text{"smonth_".($tm[4]+1)}, $tm[5]+1900;
}
-else {
- return sprintf "%d/%s/%d %2.2d:%2.2d",
- $tm[3], $text{"smonth_".($tm[4]+1)},
- $tm[5]+1900, $tm[2], $tm[1];
+elsif ($fmt eq 'dd/mm/yyyy') {
+ $date = sprintf "%2.2d/%2.2d/%4.4d", $tm[3], $tm[4]+1, $tm[5]+1900;
+ }
+elsif ($fmt eq 'mm/dd/yyyy') {
+ $date = sprintf "%2.2d/%2.2d/%4.4d", $tm[4]+1, $tm[3], $tm[5]+1900;
+ }
+elsif ($fmt eq 'yyyy/mm/dd') {
+ $date = sprintf "%4.4d/%2.2d/%2.2d", $tm[5]+1900, $tm[4]+1, $tm[3];
+ }
+if (!$only) {
+ $date .= sprintf " %2.2d:%2.2d", $tm[2], $tm[1];
}
+return $date;
}
# file_chooser_button(input, type, [form], [chroot], [addmode])
Added an option to the Ports and Addresses page to control if Webmin attempts to to reverse-resolve the connected-to IP address when issuing redirects, such as from non-SSL to SSL mode.
---- Changes since 1.360 ----
Added a field to the Advanced Options page to control the number of days that files in /tmp/.webmin are kept before automatic deletion.
+---- Changes since 1.370 ----
+The format for dates displayed by Webmin can be changed by a new option on the User Interface page.
$gconfig{'hostnamedisplay'} = $in{'hostnamedisplay'};
$gconfig{'feedback_to'} = $in{'feedback_def'} ? undef : $in{'feedback'};
$gconfig{'nofeedbackcc'} = $in{'nofeedbackcc'};
+$gconfig{'dateformat'} = $in{'dateformat'};
$in{'width_def'} || $in{'width'} =~ /^\d+$/ || &error($text{'ui_ewidth'});
$gconfig{'help_width'} = $in{'width'};
[ [ 0, $text{'yes'} ], [ 1, $text{'ui_feednocc'} ],
[ 2, $text{'no'} ] ]));
-# XXX date display format
+print &ui_table_row($text{'ui_dateformat'},
+ &ui_select("dateformat", $gconfig{'dateformat'} || "dd/mon/yyyy",
+ [ map { [ $_, $text{'ui_dateformat_'.$_} ] }
+ @webmin_date_formats ]));
print &ui_table_row($text{'ui_width'},
&ui_opt_textbox("width", $gconfig{'help_width'}, 5,
ui_edbwidth=Missing or invalid chooser window width
ui_edbheight=Missing or invalid chooser window height
ui_showlogin=Prepend username to page titles?
+ui_dateformat=Format for displayed dates
+ui_dateformat_dd/mon/yyyy=dd/mon/yyyy (ie. 16/Sep/2001)
+ui_dateformat_dd/mm/yyyy=dd/mm/yyyy (ie. 16/09/2001)
+ui_dateformat_mm/dd/yyyy=mm/dd/yyyy (ie. 09/16/2001)
+ui_dateformat_yyyy/mm/dd=yyyy/mm/dd (ie. 2001/09/16)
mods_title=Webmin Modules
mods_desc1=Webmin modules can be added after installation by using the form to the right. Modules are typically distributed in <tt>.wbm</tt> files, each of which can contain one or more modules. Modules can also be installed from RPM files if supported by your operating system.
$detect_operating_system_cache = "$module_config_directory/oscache";
+@webmin_date_formats = ( "dd/mon/yyyy", "dd/mm/yyyy",
+ "mm/dd/yyyy", "yyyy/mm/dd" );
+
sub setup_ca
{
local $adir = &module_root_directory("acl");