Syntax
accept [from ["user"][, ["submithost"][, ["command"] [, ["runhost"]]]]] [when conditional-expression] [with optional-statements-before-execution];
reject ["reject-text"] [from ["user"][, ["submithost"] [, ["command"][, ["runhost"]]]]] [when conditional-expression];
Description
The accept statement accepts the job request submitted by a user. The reject statement denies the request. After a command is accepted, nothing else in the configuration script is run. If neither an accept nor reject statement is reached while parsing the configuration file, the command is rejected by default. A default reject message is displayed to the user if no message is specified with the reject statement. If a null string is specified, then the command is rejected silently.
The expanded form of the accept and reject statements make it possible to accept or reject a command based on the criteria "who", "what", and "where" without using conditional statements.
Examples
adminusers = {"dan","robyn"}; adminprogs = {"hostname","kill","csh","ksh"}; if (user in adminusers && command in adminprogs) { runuser = "root"; if (user == "dan" && !officehours) { reject "You can't use “ + runcommand + “ outside office hours\n"; #custom msg } if (user == "robyn" && !officehours) { if (!getuserpasswd(user)) reject ; #use default reject msg } accept; } else { reject ""; #reject silently - no msg displayed to the user }