Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. Sub Initialize
  2. ' this agent use on [register] button locate on [request form] xpages
  3.  
  4. Dim s As New NotesSession, db As NotesDatabase, a As NotesAgent
  5. Dim doc As NotesDocument
  6. Set db = s.Currentdatabase
  7. Set a = s.Currentagent
  8. Set doc = s.Documentcontext ' uidoc
  9.  
  10. Dim certid As String 'full path of cert id
  11. Dim certpasswd As String
  12. Dim OU As String
  13. Dim lastname As String
  14. Dim firstname As String
  15. Dim middleinit As String
  16. Dim usrIdpath As String
  17. Dim mailsvr As String
  18. Dim mailfile As String
  19. Dim userpasswd As String
  20. Dim internetpath As String
  21.  
  22. Dim depvw As NotesView, depdoc As NotesDocument
  23. Set depvw = db.Getview("Department sort by dept")
  24. Set depdoc = depvw.Getdocumentbykey(doc.Dept(0), True)
  25. If Not depdoc Is Nothing Then
  26. certid = depdoc.IdPath(0) ' full path of cert id
  27. certpasswd = depdoc.IdPassword(0) ' Cert id password(password)
  28. OU = "" '
  29. lastname= doc.Name(0) ' current document selected mail (person)
  30. firstname = "" ' [din't used]
  31. middleinit = "" ' [din't used]
  32. usrIdpath = depdoc.DptIdStor(0) +doc.SelectMail(0)+ ".id" ' user path
  33. mailsvr = depdoc.MailSvr(0) ' mail svr
  34. mailfile = depdoc.MailLocation(0)+doc.SelectMail(0) ' MailPerson
  35. userpasswd= depdoc.UserPassword(0) ' User password
  36. internetpath = doc.SelectMail(0)+depdoc.InternetPath(0) ' mail address
  37.  
  38. End If
  39.  
  40. Dim reg As New NotesRegistration
  41. Dim dt As Variant
  42. dt = DateNumber(Year(Today)+1, Month(Today), Day(Today))
  43.  
  44. reg.RegistrationServer = mailsvr '"CN=ServerOne/O=dev"
  45. reg.CreateMailDb = True '
  46. reg.CertifierIDFile = certid '"C:IBMDominodataoffice.id"
  47. reg.Expiration = dt
  48. reg.IDType = ID_HIERARCHICAL
  49. reg.MinPasswordLength = 1 ' password strength
  50. reg.IsNorthAmerican = True
  51. reg.OrgUnit = OU ' "" empty ..will just follow certid registration
  52. reg.RegistrationLog = "log.nsf"
  53. reg.UpdateAddressBook = True
  54. reg.StoreIDInAddressBook = True
  55. reg.MailInternetAddress = internetpath
  56.  
  57.  
  58. Call reg.RegisterNewUser(lastname, _ ' last name
  59. usridpath, _ '"C:IBMDominodata +name+.id" ' file to be created
  60. mailsvr, _ '"CN=ServerOne/O=dev" ' mail server
  61. firstname, _ ' first name
  62. middleInit, _ ' middle initial
  63. certpasswd, _ '"office" ' certifier password
  64. "", _ ' location field
  65. "", _ ' comment field
  66. mailfile, _ '"mailperson.nsf" ' mail file
  67. "", _ ' Forwarding domain
  68. userpasswd, _ '"password", _ ' user password
  69. NOTES_DESKTOP_CLIENT) ' user type
  70.  
  71. Print "Please wait ...... Registration in progress"
  72. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement