mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Add support for ACL to prevent editing of allowed search types
This commit is contained in:
1
man/defaultacl
Normal file
1
man/defaultacl
Normal file
@@ -0,0 +1 @@
|
||||
allow=1
|
||||
@@ -62,7 +62,7 @@ print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $text{'index_search'} ] ]);
|
||||
|
||||
# Form to control search from other modules
|
||||
if (!$module_info{'usermin'}) {
|
||||
if (!$module_info{'usermin'} && $access{'allow'}) {
|
||||
@check = $config{'check'} ? split(/\s+/, $config{'check'}) : @search;
|
||||
print &ui_hr();
|
||||
print &ui_form_start("save_check.cgi");
|
||||
|
||||
@@ -74,4 +74,8 @@ perl_title=Perl Module
|
||||
perl_header=Documentation for Perl module $1
|
||||
perl_emod=Invalid Perl module name
|
||||
|
||||
acl_allow=Can edit allowed search types?
|
||||
|
||||
check_ecannot=You are not allowed to edit allowed search types
|
||||
|
||||
__norefs=1
|
||||
|
||||
@@ -10,6 +10,7 @@ if ($module_info{'usermin'}) {
|
||||
$google_host = "www.google.com";
|
||||
$google_port = 80;
|
||||
$google_page = "/search";
|
||||
%access = &get_module_acl();
|
||||
|
||||
# Get the paths to perl and perldoc
|
||||
$perl_path = &get_perl_path();
|
||||
|
||||
1
man/safeacl
Normal file
1
man/safeacl
Normal file
@@ -0,0 +1 @@
|
||||
allow=0
|
||||
@@ -4,6 +4,7 @@
|
||||
# from help_search_link()
|
||||
|
||||
require './man-lib.pl';
|
||||
$access{'allow'} || &error($text{'check_ecannot'});
|
||||
&ReadParse();
|
||||
&lock_file("$module_config_directory/config");
|
||||
@check = split(/\0/, $in{'check'});
|
||||
|
||||
Reference in New Issue
Block a user