--- /dev/null
+#!/usr/local/bin/perl
+# Move a schema include down (later)
+
+require './ldap-server-lib.pl';
+&local_ldap_server() == 1 || &error($text{'slapd_elocal'});
+&ReadParse();
+
+# Find it includes
+&lock_file($config{'config_file'});
+$conf = &get_config();
+@incs = &find_value("include", $conf);
+$idx = &indexof($in{'file'}, @incs);
+$idx > 0 || &error($text{'schema_emove'});
+
+# Move up
+($incs[$idx+1], $incs[$idx]) = ($incs[$idx], $incs[$idx+1]);
+&save_directive($conf, "include", @incs);
+&flush_file_lines($config{'config_file'});
+&unlock_file($config{'config_file'});
+
+&webmin_log("sup", undef, $in{'file'});
+&redirect("edit_schema.cgi");
+
schema_path=Full filename
schema_edesc=This page allows you to manually edit an LDAP schema file. This should only be done if you are familiar with the file format, as no checking is done by Webmin.
schema_return=schema list
+schema_emove=Could not find schema file to move!
acl_title=LDAP Access Control
log_schema=Changed enabled LDAP schemas
log_gencert=Generated new SSL certificate
log_sfile=Modified schema file $1
+log_sup=Moved up schema file $1
+log_sdown=Moved down schema file $1
gencert_title=Generate SSL Certificate
gencert_header=New SSL certificate details
return &text('log_'.$action.'_attrs', $object,
"<tt>".&html_escape($p->{'dn'})."</tt>");
}
-elsif ($type eq 'sfile') {
- return &text('log_sfile', "<tt>".&html_escape($object)."</tt>");
+elsif ($action eq 'sfile' || $action eq 'sup' || $action eq 'sdown') {
+ return &text('log_'.$action, "<tt>".&html_escape($object)."</tt>");
}
else {
return $text{'log_'.$action};
--- /dev/null
+#!/usr/local/bin/perl
+# Move a schema include up (earlier)
+
+require './ldap-server-lib.pl';
+&local_ldap_server() == 1 || &error($text{'slapd_elocal'});
+&ReadParse();
+
+# Find it includes
+&lock_file($config{'config_file'});
+$conf = &get_config();
+@incs = &find_value("include", $conf);
+$idx = &indexof($in{'file'}, @incs);
+$idx > 0 || &error($text{'schema_emove'});
+
+# Move up
+($incs[$idx-1], $incs[$idx]) = ($incs[$idx], $incs[$idx-1]);
+&save_directive($conf, "include", @incs);
+&flush_file_lines($config{'config_file'});
+&unlock_file($config{'config_file'});
+
+&webmin_log("sup", undef, $in{'file'});
+&redirect("edit_schema.cgi");
+