Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database specific password protection 1

Status
Not open for further replies.

Charli

Technical User
Jun 5, 2002
2
US
I have completed some script to require users entering certain databases to reauthenticate with their password, however, when the enter password box comes up someone can circumvent it by clicking on cancel. How do I stop this and make sure the only way to get in the database is by submitting an authorized password? Appreciate any help!
[ponder]
 
Once upon a time, I found some code here that does this. Here is my modified code that prompts for the Notes password. Hope it helps.

Leslie

Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim ses As New NotesSession
Dim reg As New NotesRegistration
Dim MyID As String
Dim MyDir As String
Dim charPos As Integer

Set uidoc = workspace.currentdocument


'Build the filepath to the existing ID
If uidoc.FieldGetText("Status") = "Pending" Then
If GetRank() >= 1 Then
MyID = ses.GetEnvironmentString("KeyFilename", True)
MyDir = ses.GetEnvironmentString("Directory", True)

Dim nuserName As New NotesName(ses.UserName)
NotesUserName = nuserName.Abbreviated

charPos = Instr(1, MyID, "\")

If charPos = 0 Then ' Not found
build_str = MyDir + "\" + MyID
Else
build_str = MyID
End If

' If the user cancels the password prompt, then an error code will be generated. The On Error statement will redirect the program execution so that the error handling code will be executed. The resume statement will then control where program execution goes when the error handling routine is completed.

' If the valid password for the current user's Notes ID is entered, then no error code will be generated and the program will continue to execute program statements in their normal sequence.

'On Error Goto SomeErrorRoutine

UserName = reg.SwitchToID(build_str)


uidoc.EditMode = True

Call uidoc.FieldSetText("Status", "Complete")
UserName = Cstr(Left(UserName, (Instr(UserName,"/")-1)))
UserName = Cstr(Mid(UserName, (Instr(UserName, "=")+1)))
Call uidoc.FieldSetText("Override", UserName)
Call uidoc.save
Update uidoc.FieldGetText("EventStartDate"), uidoc.FieldGetText("EventStartTime"), uidoc.FieldGetText("Judge")
Call uidoc.close
Else
messagetext = "Your personal ranking does not allow for supervisor overrides." + Chr(10) + "Please contact Info Sys for correction."
Messagebox messagetext, 0 + 64, "Override Error"
End If
End If
End Sub
 
Leslie,
Thanks for the help! I'll try it and see. I still intend to use Notes security in the background, however, because of part 11 (electronic signatures) I have been asked to build this re-authentication function. Again, thanks!
Charli
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top