Subject: Restricting admin rights for key users
“on submit” event used to create new accounts :*********
'Dim session As New NotesSession
Dim reg As New NotesRegistration
' COMMON PROPERTIES
reg.EnforceUniqueShortName = False' default is False True indicates that the short name must be different from all others.
reg.Expiration = Datenumber(Year(Today)+1, Month(Today), Day(Today))
reg.IDType = ID_HIERARCHICAL
reg.IsNorthAmerican = False
reg.MailInternetAddress = InetAddress ' genere auto si pas utilise
reg.MailQuotaSizeLimit = 400
reg.MailQuotaWarningThreshold = 350
'reg.MailReplicaServers = variant 'for cluster
reg.MailTemplateName = Source.FieldGetText("Template")
reg.MinPasswordLength = 6 ' password strength
'reg.OrgUnit = "AceHardwareNE" 'pas utilisé...
reg.PolicyName = Source.FieldGetText("Policy")
reg.RegistrationLog = "Certlog.nsf"
reg.ShortName = SN 'default FMLastname
reg.StoreIDInAddressBook = True
reg.SynchInternetPassword = True
reg.UpdateAddressBook = True
reg.CreateMailDb = True ' create mailbox in same time that user account in address book
' END OF COMMON PROPERTIES
If Strcomp( Action, "CreateByCA", 1 ) = 0 Or bUseCA Then
' User created in using the CA process
reg.UseCertificateAuthority = True
reg.CertifierName = Source.FieldGetText("CertAuthority")
reg.RegistrationServer = sRegSrv
' reg.CreateMailDb = False --> the mail db is not create at all
Call reg.RegisterNewUser(LN, _ ' last name
"", _ ' file to be created
Source.FieldGetText("HomeServer"), _ ' mail server
FN, _ ' first name
MN, _ ' middle initial
"", _ ' certifier password
Location, _ ' location field
"Created with Toolbox and Certification Authority", _ ' comment field
MailFile, _ ' mail file
"", _ ' forwarding domain
"LotusNotes", _ ' user password
NOTES_FULL_CLIENT) ' user type
Else
' User NOT created with the CA process
reg.CertifierIDFile = Source.FieldGetText("CertFile")
reg.RegistrationServer = sRegSrv
' reg.CreateMailDb = True --> now declared in common properties above !
Call reg.RegisterNewUser(LN, _ ' last name
"", _ ' file to be created
Source.FieldGetText("HomeServer"), _ ' mail server
FN, _ ' first name
MN, _ ' middle initial
"xxxx", _ ' certifier password
Location, _ ' location field
"Created with Toolbox", _ ' comment field
MailFile, _ ' mail file
"", _ ' forwarding domain
"LotusNotes", _ ' user password
NOTES_FULL_CLIENT) ' user type
%REM - Disable ID creation on file server
Call reg.RegisterNewUser(LN, _ ' last name
"\\FileServer\IDS\" + SN +".id", _ ' file to be created
Source.FieldGetText("HomeServer"), _ ' mail server
FN, _ ' first name
MN, _ ' middle initial
"hola:goodbye", _ ' certifier password
Location, _ ' location field
"Created with Toolbox", _ ' comment field
MailFile, _ ' mail file
"", _ ' forwarding domain
"LotusNotes", _ ' user password
NOTES_FULL_CLIENT) ' user type
%END REM
End If
' July 13, 2006 : adding alert message if it's a test user
Messagebox("User successfully registered " & sAddInfoMsg )
' updating current document after good execution of registration
' reset action field to know it's done
'Call Source.FieldSetText("Action","")
'Call Source.FieldSetText("NextApprovers","None")
'Call Source.FieldSetText("Substitutes","None")
'Call Source.FieldSetText("Status","Closed")
' new version - v2.1 - april 2006 :
With Source.Document
.Action = ""
.NextApprovers = "None"
.Substitutes = "None"
Call .Save( True, False )
End With