Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: Регистрация пользователей в скриптах
Форум программистов > Hard & Soft > Исходники/Codebase > Lotus > Дизайн > Библиотеки скриптов
Morpheus
Пример

 
...
   Dim uReg As NotesRegistration
   Set uReg = New NotesRegistration
   With uReg
      Dim nLen As Integer
      nLen = Len(uDocument.idfile(0))
      
      .CertifierIDFile = sLocalCertID
      .CreateMailDb = True
      .Expiration = Cdat("01.01.2007")
      .IDType = ID_HIERARCHICAL
      .IsNorthAmerican = False
      .MailACLManager = uSession.UserName
      .MailOwnerAccess = REG_MAIL_OWNER_ACL_MANAGER
      .MailTemplateName = sMailTemplate
      .MinPasswordLength = 3
      .OrgUnit = uDocument.OrgUnit(0)
      .RegistrationServer = Canonicalize(uDocument.regserver(0))
      .ShortName = Left(uDocument.idfile(0), nLen - 3)
      .StoreIDInAddressbook = True
      .UpdateAddressbook = False
      
      Dim sComment As String
      Dim sLocation As String
      Dim sMailFile As String
      sComment = "Automatically Created"
      sLocation = "Office"
      sMailFile = uDocument.maildbpath(0)
      If (Right(sMailFile, 4) = ".nsf") Then
         sMailFile = Left(sMailFile, Len(sMailFile)-4)
      End If
      sMailFile = sMailFile & ".nsf"
      
      If Not(.RegisterNewUser(_
      F.LastName, _          ' Last Name
      sLocalUserIDDirectory & "\" & _
      uDocument.idfile(0), _ ' ID-file to be created
      .RegistrationServer,_  ' Mail Server
      F.FirstName, _         ' First Name
      F.MiddleInit, _        ' Middle Initial
      sCertPassword, _       ' Certifier Password
      sLocation, _           ' Location Field
      sComment, _            ' Comment Field
      sMailFile, _           ' Mail File
      "", _                  ' Forwarding Domain
      uDocument.userpw(0), _ ' User Password
      NOTES_FULL_CLIENT, _   ' User Type
      , _                    ' Alternate Name
      "ru"_                  ' Alternate Language
      )) Then
         uLog sError & "RegisterUser: uReg.RegisterNewUser: FAILED"
         Exit Function
      Else
         uLog sNote & "RegisterUser: uReg.RegisterNewUser: OK"
      End If
      
      If Not(.AddUserToAddressbook(_
      sLocalUserIDDirectory & "\" & _
      uDocument.idfile(0), _ ' ID-file
      F.FullName, _          ' Full Name
      F.LastName, _          ' Last Name
      uDocument.userpw(0), _ ' User Password
      F.FirstName, _         ' First Name
      F.MiddleInit, _        ' Middle Initial
      .RegistrationServer, _ ' Mail Server
      sMailFile, _           ' Mail File
      "", _                  ' Forwarding Address
      sLocation, _           ' Location Field
      sComment _             ' Comment Field
      )) Then
         uLog sError & "RegisterUser: uReg.AddUserToAddressbook: FAILED"
         Exit Function
      Else
         uLog sNote & "RegisterUser: uReg.AddUserToAddressbook: OK"
      End If
   End With
    
   If Not(SetPersonFullName(uReg.RegistrationServer, _
   F.LastName, F.FirstName, F.MiddleInit, uReg)) Then
      uLog sError & "RegisterUser: SetPersonFullName: FAILED"
      Exit Function
   Else
      uLog sNote & "RegisterUser: SetPersonFullName: OK"
   End If
   ...
Function SetPersonFullName(sRegServer As String, sLastName As String, sFirstName As String, sMiddleInit As String, uReg As NotesRegistration) As Variant
   On Error Goto Error_
   SetPersonFullName = False
    
   Dim uPerson As NotesDocument
   Set uPerson = GetPersonDoc(sRegServer, sLastName, sFirstName, sMiddleInit)
   If (uPerson Is Nothing) Then
      uLog sError & "Пользователь """ & sLastName & " " & sFirstName & " " & sMiddleInit & """ не найден в адресной книге на сервере """ & sRegServer & """"
      Exit Function
   End If
    
   With uPerson
      .FullName = Canonicalize(.FullName(0))
      .ShortName = uReg.ShortName
      SetPersonFullName = .Save(True, True)
   End With
    
Exit_:
   Exit Function
    
Error_:
   uLog sError & "SetPersonFullName: (#" & Err() & ", #" & Erl() & ") " & Error()
   Resume Exit_
End Function


]]>Ссылка]]> на обсуждение

Автор - ]]>Wakko]]>
Lina
Кто-нибудь применял этот скрипт? что такое uLog?

Morpheus
судя по всему внешняя ф-ция логирования
думаю что Вы можете её не использовать
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Форум IP.Board © 2001-2009 IPS, Inc.