mirror of
https://github.com/webmin/webmin.git
synced 2026-06-20 11:20:30 +01:00
Show real version on main page
This commit is contained in:
@@ -21,3 +21,5 @@ Added fields to set the permissions and group ownership of new shared directorie
|
||||
---- Changes since 1.430 ----
|
||||
The 'Password never expires' flag can be set for user accounts, thanks to a patch from Juan Miguel Corral.
|
||||
Allow the server description to be set to explicitly nothing.
|
||||
---- Changes since 1.500 ----
|
||||
Show the real Samba version number on the main page.
|
||||
|
||||
@@ -21,7 +21,7 @@ if (!-x $config{'samba_server'}) {
|
||||
}
|
||||
|
||||
# Check the samba version
|
||||
if ($samba_version = &get_samba_version(\$out)) {
|
||||
if ($samba_version = &get_samba_version(\$out, 0)) {
|
||||
# Save version number
|
||||
&open_tempfile(VERSION, ">$module_config_directory/version");
|
||||
&print_tempfile(VERSION, $samba_version,"\n");
|
||||
@@ -30,14 +30,15 @@ if ($samba_version = &get_samba_version(\$out)) {
|
||||
else {
|
||||
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
|
||||
&help_search_link("samba", "man", "doc", "google"));
|
||||
print &text('error_version', $config{'samba_server'}, "$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
|
||||
print &text('error_version', $config{'samba_server'},
|
||||
"$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
|
||||
print "<pre>$out</pre>\n";
|
||||
&ui_print_footer("/", $text{'index'});
|
||||
exit;
|
||||
}
|
||||
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
|
||||
&help_search_link("samba", "man", "doc", "google"), undef, undef,
|
||||
&text('index_version', $samba_version));
|
||||
&text('index_version', &get_samba_version(\$out, 1)));
|
||||
|
||||
@empty = &list_shares();
|
||||
if (!@empty && (-r $config{alt_smb_conf})) {
|
||||
|
||||
@@ -879,7 +879,8 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
# get_samba_version(&out)
|
||||
# get_samba_version(&out, [keep-original-format])
|
||||
# Returns the Samba version
|
||||
sub get_samba_version
|
||||
{
|
||||
local $flag;
|
||||
@@ -888,7 +889,9 @@ foreach $flag ("-V", "-v") {
|
||||
if (${$_[0]} =~ /(Version|Samba)\s+(CVS\s+)?[^0-9 ]*(\d+)\.(\S+)/i) {
|
||||
local $v1 = $3;
|
||||
local $v2 = $4;
|
||||
$v2 =~ s/[^0-9]//g;
|
||||
if (!$_[1]) {
|
||||
$v2 =~ s/[^0-9]//g;
|
||||
}
|
||||
return "$v1.$v2";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user