2 # Save global policy settings
4 require './rbac-lib.pl';
5 $access{'policy'} || &error($text{'policy_ecannot'});
6 &error_setup($text{'policy_err'});
8 $conf = &get_policy_config();
11 # Validate and save inputs
12 $auths = &auths_parse("auths");
13 &save_policy($conf, "AUTHS_GRANTED", $auths);
14 $profs = &profiles_parse("profs");
15 &save_policy($conf, "PROFS_GRANTED", $profs);
17 if ($in{'allow_def'}) {
18 &save_policy($conf, "CRYPT_ALGORITHMS_ALLOW", undef);
21 $allow = join(",", split(/\0/, $in{'allow'}));
22 $allow || &error($text{'policy_eallow'});
23 $in{'deprecate_def'} || &error($text{'policy_eclash'});
24 &save_policy($conf, "CRYPT_ALGORITHMS_ALLOW", $allow);
27 if ($in{'default_def'}) {
28 &save_policy($conf, "CRYPT_DEFAULT", undef);
31 &save_policy($conf, "CRYPT_DEFAULT", $in{'default'});
34 if ($in{'deprecate_def'}) {
35 &save_policy($conf, "CRYPT_ALGORITHMS_DEPRECATE", undef);
38 &save_policy($conf, "CRYPT_ALGORITHMS_DEPRECATE", $in{'deprecate'});
43 &webmin_log("policy");