require 'cron-lib.pl'; do '../ui-lib.pl'; # acl_security_form(&options) # Output HTML for editing security options for the cron module sub acl_security_form { print " $text{'acl_users'} \n"; printf " $text{'acl_all'}
\n", $_[0]->{'mode'} == 0 ? "checked" : ""; printf " $text{'acl_this'}
\n", $_[0]->{'mode'} == 3 ? "checked" : ""; printf " $text{'acl_only'}\n", $_[0]->{'mode'} == 1 ? "checked" : ""; printf " %s
\n", $_[0]->{'mode'} == 1 ? $_[0]->{'users'} : "", &user_chooser_button("userscan", 1); printf " $text{'acl_except'}\n", $_[0]->{'mode'} == 2 ? "checked" : ""; printf " %s
\n", $_[0]->{'mode'} == 2 ? $_[0]->{'users'} : "", &user_chooser_button("userscannot", 1); printf " $text{'acl_gid'}\n", $_[0]->{'mode'} == 5 ? "checked" : ""; printf " %s
\n", $_[0]->{'mode'} == 5 ? scalar(getgrgid($_[0]->{'users'})) : "", &group_chooser_button("gid", 0); printf " $text{'acl_uid'}\n", $_[0]->{'mode'} == 4 ? "checked" : ""; printf " -\n", $_[0]->{'mode'} == 4 ? $_[0]->{'uidmin'} : ""; printf " \n", $_[0]->{'mode'} == 4 ? $_[0]->{'uidmax'} : ""; print " $text{'acl_control'}\n"; print "",&ui_radio("allow", $_[0]->{'allow'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"\n"; print "$text{'acl_command'}\n"; print "",&ui_radio("command", $_[0]->{'command'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])," \n"; print " $text{'acl_create'}\n"; print "",&ui_radio("create", $_[0]->{'create'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"\n"; print "$text{'acl_delete'}\n"; print "",&ui_radio("delete", $_[0]->{'delete'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])," \n"; print " $text{'acl_move'}\n"; print "",&ui_radio("move", $_[0]->{'move'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ]),"\n"; print "$text{'acl_kill'}\n"; print "",&ui_radio("kill", $_[0]->{'kill'}, [ [ 1, $text{'yes'} ], [ 0, $text{'no'} ] ])," \n"; print "\n"; } # acl_security_save(&options) # Parse the form for security options for the cron module sub acl_security_save { $_[0]->{'mode'} = $in{'mode'}; $_[0]->{'users'} = $in{'mode'} == 0 || $in{'mode'} == 3 || $in{'mode'} == 4 ? "" : $in{'mode'} == 5 ? scalar(getgrnam($in{'gid'})) : $in{'mode'} == 1 ? $in{'userscan'} : $in{'userscannot'}; $_[0]->{'uidmin'} = $in{'mode'} == 4 ? $in{'uidmin'} : ""; $_[0]->{'uidmax'} = $in{'mode'} == 4 ? $in{'uidmax'} : ""; $_[0]->{'allow'} = $in{'allow'}; $_[0]->{'command'} = $in{'command'}; $_[0]->{'create'} = $in{'create'}; $_[0]->{'delete'} = $in{'delete'}; $_[0]->{'move'} = $in{'move'}; $_[0]->{'kill'} = $in{'kill'}; }