Schema download page

This commit is contained in:
Jamie Cameron
2010-09-17 16:15:45 -07:00
parent cf2aeec328
commit 25fc52767b
5 changed files with 29 additions and 2 deletions

View File

@ -18,8 +18,6 @@ do 'md5-lib.pl';
%access = &get_module_acl();
$access{'switch'} = 0 if (&is_readonly_mode());
# XXX LDAP support
# XXX schema test / creation?
# XXX CHANGELOG / docs
# XXX test with Virtualmin

View File

@ -73,6 +73,8 @@ push(@ldapgrid,
$text{'sql_groupclass'},
&ui_textbox("ldap_groupclass", $proto eq "ldap" && $args->{'groupclass'} ?
$args->{'groupclass'} : "webminGroup",30));
push(@ldapgrid,
&ui_submit($text{'sql_schema'}, 'schema'), "");
$ldapgrid = &ui_grid_table(\@ldapgrid, 2, 100);
print &ui_table_row(undef,

View File

@ -427,6 +427,7 @@ sql_title3=Create Missing DN
sql_dnerr=User and group database settings are valid, but the LDAP DN needed by Webmin is missing : $1
sql_dnerr2=Click the <b>Create DN</b> button below to have it create automatically, or add it to your LDAP server manually.
sql_makedn=Create DN
sql_schema=Download LDAP Schema
make_title=Create User and Group Tables
make_err=Failed to create user and group tables
@ -442,3 +443,6 @@ makedn_failed=.. creation failed : $1
makedn_done=.. done
makedn_still=Some problems were found even after DN creation : $1
schema_title=Download LDAP Schema
schema_desc=Before Webmin can use an LDAP server to store users and groups it must be configured to use the schema below. This can typically be done by saving the schema definition in <tt>/etc/ldap/schema</tt> or <tt>/etc/openldap/schema</tt> as <tt>webmin.schema</tt>, then configuring the server to load that schema file.
schema_download=Download schema file : <a href=$1>$1</a>

View File

@ -8,6 +8,12 @@ $access{'pass'} || &error($text{'sql_ecannot'});
&error_setup($text{'sql_err'});
$p = $in{'proto'};
if ($in{'schema'}) {
# Redirect to schema download page
&redirect("schema.cgi");
return;
}
# Parse inputs
if ($p eq 'mysql' || $p eq 'postgresql' || $p eq 'ldap') {
gethostbyname($in{$p."_host"}) ||

17
acl/schema.cgi Executable file
View File

@ -0,0 +1,17 @@
#!/usr/local/bin/perl
# Just display the Webmin LDAP schema
require './acl-lib.pl';
$access{'pass'} || &error($text{'sql_ecannot'});
&ui_print_unbuffered_header(undef, $text{'schema_title'}, "");
print $text{'schema_desc'},"<p>\n";
print &ui_table_start(undef, undef, 2);
print &ui_table_row(undef,
"<pre>".&html_escape(&read_file_contents("webmin.schema"))."</pre>", 2);
print &ui_table_end();
print &text('schema_download', 'webmin.schema'),"<p>\n";
&ui_print_footer("", $text{'index_return'});