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
}
# 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'} &&
}
# 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'};
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