mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Make webmin post-login notifications generic
This commit is contained in:
@@ -130,22 +130,10 @@ if ($level == 0) {
|
||||
print "</table>\n";
|
||||
|
||||
# Check for incorrect OS
|
||||
if (&foreign_available("webmin")) {
|
||||
if (&foreign_check("webmin")) {
|
||||
&foreign_require("webmin", "webmin-lib.pl");
|
||||
%realos = &webmin::detect_operating_system(undef, 1);
|
||||
if ($realos{'os_version'} ne $gconfig{'os_version'} ||
|
||||
$realos{'os_type'} ne $gconfig{'os_type'}) {
|
||||
print "<form action=webmin/fix_os.cgi>\n";
|
||||
print "<p><center>",&webmin::text('os_incorrect',
|
||||
$realos{'real_os_type'},
|
||||
$realos{'real_os_version'}),"<p>\n";
|
||||
print "<input type=submit ",
|
||||
"value='$webmin::text{'os_fix'}'>\n";
|
||||
print "</center>\n";
|
||||
print "</form>\n";
|
||||
}
|
||||
&webmin::show_webmin_notifications();
|
||||
}
|
||||
|
||||
}
|
||||
elsif ($level == 3) {
|
||||
# Show Usermin user's information
|
||||
|
||||
15
index.cgi
15
index.cgi
@@ -180,20 +180,9 @@ else {
|
||||
}
|
||||
|
||||
# Check for incorrect OS
|
||||
if (&foreign_available("webmin")) {
|
||||
if (&foreign_check("webmin")) {
|
||||
&foreign_require("webmin", "webmin-lib.pl");
|
||||
%realos = &webmin::detect_operating_system(undef, 1);
|
||||
if ($realos{'os_version'} ne $gconfig{'os_version'} ||
|
||||
$realos{'os_type'} ne $gconfig{'os_type'}) {
|
||||
print "<form action=webmin/fix_os.cgi>\n";
|
||||
print "<p><center>",&webmin::text('os_incorrect',
|
||||
$realos{'real_os_type'},
|
||||
$realos{'real_os_version'}),"<p>\n";
|
||||
print "<input type=submit ",
|
||||
"value='$webmin::text{'os_fix'}'>\n";
|
||||
print "</center>\n";
|
||||
print "</form>\n";
|
||||
}
|
||||
&webmin::show_webmin_notifications();
|
||||
}
|
||||
|
||||
if ($miniserv{'logout'} && !$gconfig{'alt_startpage'} &&
|
||||
|
||||
@@ -138,21 +138,9 @@ if ($miniserv{'logout'} && !$gconfig{'alt_startpage'} &&
|
||||
}
|
||||
|
||||
# Check for incorrect OS
|
||||
if (&foreign_available("webmin")) {
|
||||
if (&foreign_check("webmin")) {
|
||||
&foreign_require("webmin", "webmin-lib.pl");
|
||||
%realos = &webmin::detect_operating_system(undef, 1);
|
||||
if ($realos{'os_version'} ne $gconfig{'os_version'} ||
|
||||
$realos{'os_type'} ne $gconfig{'os_type'}) {
|
||||
print "<form action=webmin/fix_os.cgi>\n";
|
||||
print "<table width=95% align=center><tr><td width=100%><b><font color='#FFFFFF'> ";
|
||||
print &webmin::text('os_incorrect',
|
||||
$realos{'real_os_type'},
|
||||
$realos{'real_os_version'}),"\n";
|
||||
print "<input type=submit ",
|
||||
"value='$webmin::text{'os_fix'}'>\n";
|
||||
print "</tr></table>\n";
|
||||
print "</form>\n";
|
||||
}
|
||||
&webmin::show_webmin_notifications();
|
||||
}
|
||||
|
||||
print $text{'main_footer'};
|
||||
|
||||
@@ -829,6 +829,27 @@ $rv{'time'} = time();
|
||||
return %rv;
|
||||
}
|
||||
|
||||
# show_webmin_notifications()
|
||||
# Print various notifications for the current user, if needed
|
||||
sub show_webmin_notifications
|
||||
{
|
||||
# Need OS upgrade
|
||||
local %realos = &detect_operating_system(undef, 1);
|
||||
if (($realos{'os_version'} ne $gconfig{'os_version'} ||
|
||||
$realos{'os_type'} ne $gconfig{'os_type'}) &&
|
||||
&foreign_available("webmin")) {
|
||||
print "<center>\n";
|
||||
print &ui_form_start("$gconfig{'webprefix'}/webmin/fix_os.cgi");
|
||||
print &text('os_incorrect', $realos{'real_os_type'},
|
||||
$realos{'real_os_version'}),"<p>\n";
|
||||
print &ui_form_end([ [ undef, $text{'os_fix'} ] ]);
|
||||
print "</center>\n";
|
||||
}
|
||||
|
||||
# Password close to expiry
|
||||
# XXX
|
||||
}
|
||||
|
||||
# get_system_uptime()
|
||||
# Returns the number of seconds the system has been up, or undef if un-available
|
||||
sub get_system_uptime
|
||||
|
||||
Reference in New Issue
Block a user