Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking password within form
Message
From
04/08/1999 21:57:11
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00250033
Message ID:
00250037
Views:
25
>I want to check a password whenever the user selects new, delete, or save from command buttons. I'm not certain how to do it. If these buttons are selected, I then set visible to .t. for the password textbox. Where do I check that the password is correct? Only 1 password is allowed for all users. How do I allow for 3 tries to enter the password. Do I write a function to do this? Where do I put it? I know how to do it in DOS but not in Windows.
>
>Thanks.




In File Section, there are many tools can make access right function, you can download them to try first!

If you want to make your own one,
You can add a new procedure at Form Designer Form Menu Option!!

Then, you can simply put the code at that new function and call it when needed!

* Form.cmdNew.Click
IF ThisForm.GetAccess()
* success to add new
Else
* Don't have permission to add!
Endif

* Form.GetAccess()
Local lAccessOK

Do Form FGetPass To lAccessOK

Return lAccessOK

*--------------------------------------------
* At FGetPass.Destroy()

Return lAllowAccess




What I suggest is, you use a Global Variable/FormSet New Property to carry the access right information.
So, only the first time the user need to login the application, their access right has been set.
You only need to check the Global Variable to see if he/she can access New, Delete, Update...
What you may afraid that if the user need to go around, someone may use his/her access to do task,
then, you can make a button to recall the Login Screen!
Unless ppl knows other passwords, the problem can mainly solved!!

Besides, in case the staff need to do the action higher than his/her access right.
Just recall the Login Form to change user!!




Another suggestion is to make a Worklog (In File Section), which make a log to carry ALL
action to table:
- Add Blank and Update
- Insert Record with nonempty value
- Delete Record
- Recall Record
- Simply Update

It even carry more info such as action time, action machine,
action username(this info need you fill in beginning)...

Surely you can know what has happened on table!

^_~ Good Luck!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Reply
Map
View

Click here to load this message in the networking platform