Normal Topic Security question - can search be locked? (Read 863 times)
esgage
Junior Member
**
Offline


No personal text

Posts: 55
Joined: Dec 8th, 2005
Security question - can search be locked?
Jun 11th, 2008 at 1:55pm
Print Post Print Post  
To whom it may concern:

I need help securing one of my applications. I have a time clock application. I have a button the workers push to punch out for the day, etc. I have this application secure in certain areas no problem. I do have 2 questions. The first question is I have the following program example:

Var VMenu1 as Int
Var VMenu3 as Int
Var VSuccess as INT
Var Vdate as date
Var Vtime as time
   
   
         vMenu3 = @SelectTreeItem("CLOCK!Forms!Search/Update!Clock!Time Clock")
         VSuccess = @SelectTreeItem("Search Menu!Clear Form (F3)")      
     Vtime = @time
         Vdate = @date
         VSuccess = @SelectTreeItem("Search Update Menu!Search (F7)")
         FormFieldValue("Time Clock", "TimeClockName", 0, "..EXAMPLE..")
         FormFieldValue("Time Clock", "TimeClockDate", 0, Vdate)
         FormFieldValue("Time Clock", "TimeClocktimeout", 0, "=")            
         VSuccess = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")
         @exit
 

The problem I have with the example above is if the user hits the button and the result set does not find any records, it remains in the search screen. The user can then change the search spec to find any other worker or date and search for it. I do not want this to happen. I would like the program to go back to the main menu if the search result does not find any new records. I tried to add the following:

If @Mode() = 2 Then
     SetDefaultTab("Add Data Menu")
               vMenu1 = @SelectTreeItem("Clock!Forms!Add Data!Clock!Menu")

However, this would go back to the main menu every time.


My second question, is there anyway to prevent the operator from hitting “F7” to initiate a search if they are already in update mode?

Any advice or help would be greatly appreciated.

Thanks,

Kevin
E & S Gage
  
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Security question - can search be locked?
Reply #1 - Jun 11th, 2008 at 3:19pm
Print Post Print Post  
Try using the following:
Code
Select All
If @Mode() = 2 Then
     {
	   SetDefaultTab("Add Data Menu")
	   vMenu1 = @SelectTreeItem("Clock!Forms!Add Data!Clock!Menu")
     }
 


  
Back to top
IP Logged
 
esgage
Junior Member
**
Offline


No personal text

Posts: 55
Joined: Dec 8th, 2005
Re: Security question - can search be locked?
Reply #2 - Jun 11th, 2008 at 3:32pm
Print Post Print Post  
Ben:

Thank you for the suggestion. However, I just tried it and it did the same thing. It immediately went back to the main menu before the operator could clock out. With or without a found search spec. It pretty much did what my example did. Also, if you know of a way in security to disallow search mode that would be a great help.

Thanks.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Security question - can search be locked?
Reply #3 - Jun 11th, 2008 at 3:34pm
Print Post Print Post  
Which version of Sesame are you using?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
esgage
Junior Member
**
Offline


No personal text

Posts: 55
Joined: Dec 8th, 2005
Re: Security question - can search be locked?
Reply #4 - Jun 11th, 2008 at 3:59pm
Print Post Print Post  
2.0.6
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Security question - can search be locked?
Reply #5 - Jun 11th, 2008 at 5:06pm
Print Post Print Post  
1. Make your Menu the start up form instead of using SetDefaultTab.

2. Do the whole business with the new XResultSet commands instead of opening and exiting forms.

Much cleaner and far more controllable and predicatable.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
esgage
Junior Member
**
Offline


No personal text

Posts: 55
Joined: Dec 8th, 2005
Re: Security question - can search be locked?
Reply #6 - Jun 11th, 2008 at 5:15pm
Print Post Print Post  
Hammer:

OK, thanks for the advice, I will do that, and I really appreciate your time to help. So I guess what you are saying is there is no way in security or in a programming statement to prevent a user from being in the Update mode and hitting F7 on the keyboard to enter the search mode. Even if I do as you suggest, it seems to me once they are working in the update mode of their current record, they could still press "F7" and enter the search mode. That is what I am trying to avoid. Perhaps I am not getting my question across properly. I want all searches to be controlled by the command buttons and not by them manipulating it with "F7."


Thanks again!!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Security question - can search be locked?
Reply #7 - Jun 11th, 2008 at 5:21pm
Print Post Print Post  
esgage wrote on Jun 11th, 2008 at 5:15pm:
Hammer:

OK, thanks for the advice, I will do that, and I really appreciate your time to help. So I guess what you are saying is there is no way in security or in a programming statement to prevent a user from being in the Update mode and hitting F7 on the keyboard to enter the search mode. Even if I do as you suggest, it seems to me once they are working in the update mode of their current record, they could still press "F7" and enter the search mode. That is what I am trying to avoid. Perhaps I am not getting my question across properly. I want all searches to be controlled by the command buttons and not by them manipulating it with "F7."


Thanks again!!


Using XResultSet means that they are never in Search mode in the first place to hit F7. You find the correct record and manipulate the values in code. User never sees a form.

If you do need to disable particular keystrokes, you can use IgnoreKey().

You can also put a bit of code in On Retrieve Spec Open that only allows the retrieve spec to be used if a flag (like a ClientLocalValue) is set. Otherwise, it closes.

But, for what you are describing, using XResultSet is by far the better solution.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
esgage
Junior Member
**
Offline


No personal text

Posts: 55
Joined: Dec 8th, 2005
Re: Security question - can search be locked?
Reply #8 - Jun 11th, 2008 at 5:37pm
Print Post Print Post  
Hammer:

Thank you very much again. I will play around with XResultSet and see what I come up with.
  
Back to top
 
IP Logged