<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
require 'cluster-passwd-lib.pl';

# acl_security_form(&amp;options)
# Output HTML for editing security options for the passwd module
sub acl_security_form
{
print "&lt;tr&gt; &lt;td valign=top&gt;&lt;b&gt;$passwd::text{'acl_users'}&lt;/b&gt;&lt;/td&gt; &lt;td colspan=3&gt;\n";
printf "&lt;input type=radio name=mode value=0 %s&gt; %s\n",
	$_[0]-&gt;{'mode'} == 0 ? 'checked' : '', $passwd::text{'acl_mode0'};

printf "&lt;input type=radio name=mode value=3 %s&gt; %s&lt;br&gt;\n",
	$_[0]-&gt;{'mode'} == 3 ? 'checked' : '', $passwd::text{'acl_mode3'};

printf "&lt;input type=radio name=mode value=1 %s&gt; %s\n",
	$_[0]-&gt;{'mode'} == 1 ? 'checked' : '', $passwd::text{'acl_mode1'};
printf "&lt;input name=users1 size=40 value='%s'&gt; %s&lt;br&gt;\n",
	$_[0]-&gt;{'mode'} == 1 ? $_[0]-&gt;{'users'} : '',
	&amp;user_chooser_button("users1", 1);

printf "&lt;input type=radio name=mode value=2 %s&gt; %s\n",
	$_[0]-&gt;{'mode'} == 2 ? 'checked' : '', $passwd::text{'acl_mode2'};
printf "&lt;input name=users2 size=40 value='%s'&gt; %s&lt;br&gt;\n",
	$_[0]-&gt;{'mode'} == 2 ? $_[0]-&gt;{'users'} : '',
	&amp;user_chooser_button("users2", 1);

printf "&lt;input type=radio name=mode value=4 %s&gt; %s\n",
	$_[0]-&gt;{'mode'} == 4 ? 'checked' : '', $passwd::text{'acl_mode4'};
printf "&lt;input name=low size=8 value='%s'&gt; -\n",
	$_[0]-&gt;{'mode'} == 4 ? $_[0]-&gt;{'low'} : '';
printf "&lt;input name=high size=8 value='%s'&gt;&lt;br&gt;\n",
	$_[0]-&gt;{'mode'} == 4 ? $_[0]-&gt;{'high'} : '';

printf "&lt;input type=radio name=mode value=5 %s&gt; %s\n",
	$_[0]-&gt;{'mode'} == 5 ? 'checked' : '', $passwd::text{'acl_mode5'};
printf "&lt;input name=groups size=20 value='%s'&gt; %s&lt;br&gt;\n",
	$_[0]-&gt;{'mode'} == 5 ? $_[0]-&gt;{'users'} : '',
	&amp;group_chooser_button("groups", 1);
printf "%s &lt;input type=checkbox name=sec value=1 %s&gt; %s&lt;br&gt;\n",
        "&amp;nbsp;" x 5, $_[0]-&gt;{'sec'} ? 'checked' : '',$passwd::text{'acl_sec'};

printf "&lt;input type=radio name=mode value=6 %s&gt; %s\n",
	$_[0]-&gt;{'mode'} == 6 ? 'checked' : '', $passwd::text{'acl_mode6'};
printf "&lt;input name=match size=15 value='%s'&gt;&lt;/td&gt; &lt;/tr&gt;\n",
	$_[0]-&gt;{'mode'} == 6 ? $_[0]-&gt;{'users'} : '';

print "&lt;tr&gt; &lt;td&gt;&lt;b&gt;$passwd::text{'acl_repeat'}&lt;/b&gt;&lt;/td&gt; &lt;td colspan=3&gt;\n";
printf "&lt;input type=radio name=repeat value=1 %s&gt; $passwd::text{'yes'}\n",
	$_[0]-&gt;{'repeat'} ? "checked" : "";
printf "&lt;input type=radio name=repeat value=0 %s&gt; $passwd::text{'no'}&lt;/td&gt; &lt;/tr&gt;\n",
	$_[0]-&gt;{'repeat'} ? "" : "checked";

print "&lt;td&gt;&lt;b&gt;$passwd::text{'acl_others'}&lt;/b&gt;&lt;/td&gt; &lt;td colspan=3&gt;\n";
printf "&lt;input type=radio name=others value=1 %s&gt; $passwd::text{'yes'}\n",
	$_[0]-&gt;{'others'} == 1 ? "checked" : "";
printf "&lt;input type=radio name=others value=2 %s&gt; $passwd::text{'acl_opt'}\n",
	$_[0]-&gt;{'others'} == 2 ? "checked" : "";
printf "&lt;input type=radio name=others value=0 %s&gt; $passwd::text{'no'}&lt;/td&gt; &lt;/tr&gt;\n",
	$_[0]-&gt;{'others'} == 0 ? "checked" : "";

print "&lt;tr&gt; &lt;td&gt;&lt;b&gt;$passwd::text{'acl_old'}&lt;/b&gt;&lt;/td&gt; &lt;td colspan=3&gt;\n";
printf "&lt;input type=radio name=old value=1 %s&gt; $passwd::text{'yes'}\n",
	$_[0]-&gt;{'old'} == 1 ? "checked" : "";
printf "&lt;input type=radio name=old value=2 %s&gt; $passwd::text{'acl_old_this'}\n",
	$_[0]-&gt;{'old'} == 2 ? "checked" : "";
printf "&lt;input type=radio name=old value=0 %s&gt; $passwd::text{'no'}&lt;/td&gt; &lt;/tr&gt;\n",
	$_[0]-&gt;{'old'} == 0 ? "checked" : "";
}

# acl_security_save(&amp;options)
# Parse the form for security options for the bind8 module
sub acl_security_save
{
$_[0]-&gt;{'mode'} = $in{'mode'};
$_[0]-&gt;{'users'} = $in{'mode'} == 1 ? $in{'users1'} :
		   $in{'mode'} == 2 ? $in{'users2'} :
		   $in{'mode'} == 5 ? $in{'groups'} :
		   $in{'mode'} == 6 ? $in{'match'} : undef;
$_[0]-&gt;{'low'} = $in{'low'};
$_[0]-&gt;{'high'} = $in{'high'};
$_[0]-&gt;{'repeat'} = $in{'repeat'};
$_[0]-&gt;{'old'} = $in{'old'};
$_[0]-&gt;{'others'} = $in{'others'};
$_[0]-&gt;{'expire'} = $in{'expire'};
$_[0]-&gt;{'sec'} = $in{'sec'};
}

</pre></body></html>