Keeping operators from closing the program

Top  Previous  Next

Here is an example of using the new Events customizations in version 4.0 to prevent non-manager operators from closing Campground Master accidentally.  Of course they could always shut off the computer if they want to shut it down, but this may help avoid accidental closures due to "fumbles" with the mouse or keyboard, for instance.

 

1. The first step is to add an Event Action.  Go to Maintenance / Advanced Customizations / Event Actions, and click "Add event action".

 

2. Give it a name, such as "Avoid shut-down".

 

3. For the Event Trigger, select "Program Shutdown".

 

4. We only want to prevent it for non-managers, so enter the following expression in the Condition (note that Manager access is level 4):

 

 CurrentOpLevel() < 4

 

5. We want to show them that it's not allowed, and also make sure the action is aborted, so enter this in the Action expression:

 

 Eval(MessageBox("You are not allowed to close this program"), .F.)

 

6. Finally, make sure the "Abort..." box is checked -- since the action expression above always returns False, the shut-down will always be aborted (assuming the Condition is met to trigger the action in the first place).

 

 


Page URL http://CampgroundMaster.com/help/keepingoperatorsfromclosing.html

Campground Master Home