require 'mailboxes-lib.pl'; # acl_security_form(&options) # Output HTML for editing security options for the sendmail module sub acl_security_form { my ($o) = @_; # Users whose mail can be read print " $text{'acl_read'} \n"; printf " $text{'acl_none'}\n", $o->{'mmode'} == 0 ? "checked" : ""; printf " $text{'acl_same'}\n", $o->{'mmode'} == 4 ? "checked" : ""; printf " $text{'acl_all'}
\n", $o->{'mmode'} == 1 ? "checked" : ""; printf " $text{'acl_users'}\n", $o->{'mmode'} == 2 ? "checked" : ""; printf " %s
\n", $o->{'mmode'} == 2 ? $o->{'musers'} : "", &user_chooser_button("musers", 1); printf " $text{'acl_userse'}\n", $o->{'mmode'} == 3 ? "checked" : ""; printf " %s
\n", $o->{'mmode'} == 3 ? $o->{'musers'} : "", &user_chooser_button("muserse", 1); printf " $text{'acl_usersg'}\n", $o->{'mmode'} == 5 ? "checked" : ""; printf " %s\n", $o->{'mmode'} == 5 ? join(" ", map { scalar(getgrgid($_)) } split(/\s+/, $o->{'musers'})) : "", &group_chooser_button("musersg", 1); printf " %s
\n", $o->{'msec'} ? "checked" : "", $text{'acl_sec'}; printf " $text{'acl_usersu'}\n", $o->{'mmode'} == 7 ? "checked" : ""; printf " -\n", $o->{'mmode'} == 7 ? $o->{'musers'} : ""; printf "
\n", $o->{'mmode'} == 7 ? $o->{'musers2'} : ""; printf " $text{'acl_usersm'}\n", $o->{'mmode'} == 6 ? "checked" : ""; printf " \n", $o->{'mmode'} == 6 ? $o->{'musers'} : ""; # Directory for arbitrary files print " $text{'acl_dir'} \n"; print &ui_opt_textbox("dir", $o->{'dir'}, 40, $text{'acl_dirauto'}."
"); print " \n"; # Allowed From: addresses print " $text{'acl_from'} \n"; printf " $text{'acl_any'}
\n", $o->{'fmode'} == 0 ? "checked" : ""; printf " $text{'acl_fdoms'}\n", $o->{'fmode'} == 1 ? "checked" : ""; printf "
\n", $o->{'fmode'} == 1 ? $o->{'from'} : ''; printf " $text{'acl_faddrs'}\n", $o->{'fmode'} == 2 ? "checked" : ""; printf "
\n", $o->{'fmode'} == 2 ? $o->{'from'} : ''; printf " $text{'acl_fdom'}\n", $o->{'fmode'} == 3 ? "checked" : ""; printf "
\n", $o->{'fmode'} == 3 ? $o->{'from'} : ''; print " \n"; print " $text{'acl_fromname'}\n"; print " \n"; print " $text{'acl_attach'} \n"; printf " %s\n", $o->{'attach'}<0 ? 'checked' : '', $text{'acl_unlimited'}; printf "\n", $o->{'attach'}<0 ? '' : 'checked'; printf " kB\n", $o->{'attach'}<0 ? '' : $o->{'attach'}; print " \n"; print " $text{'acl_canattach'}\n"; printf " %s\n", $o->{'canattach'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $o->{'canattach'} ? '' : 'checked', $text{'no'}; print " $text{'acl_candetach'}\n"; printf " %s\n", $o->{'candetach'} ? 'checked' : '', $text{'yes'}; printf " %s \n", $o->{'candetach'} ? '' : 'checked', $text{'no'}; } # acl_security_save(&options) # Parse the form for security options for the sendmail module sub acl_security_save { my ($o) = @_; $o->{'mmode'} = $in{'mmode'}; $o->{'musers'} = $in{'mmode'} == 2 ? $in{'musers'} : $in{'mmode'} == 3 ? $in{'muserse'} : $in{'mmode'} == 5 ? join(" ", map { scalar(getgrnam($_)) } split(/\s+/, $in{'musersg'})) : $in{'mmode'} == 6 ? $in{'musersm'} : $in{'mmode'} == 7 ? $in{'musersu1'} : ""; $o->{'musers2'} = $in{'mmode'} == 7 ? $in{'musersu2'} : ""; $o->{'msec'} = $in{'msec'}; $o->{'fmode'} = $in{'fmode'}; $o->{'from'} = $in{'fmode'} == 0 ? undef : $in{'fmode'} == 1 ? $in{'fdoms'} : $in{'fmode'} == 2 ? $in{'faddrs'} : $in{'fdom'}; $o->{'fromname'} = $in{'fromname'}; $o->{'attach'} = $in{'attach_def'} ? -1 : $in{'attach'}; $o->{'canattach'} = $in{'canattach'}; $o->{'candetach'} = $in{'candetach'}; $o->{'dir'} = $in{'dir_def'} ? undef : $in{'dir'}; }