- - - SOLUTION ! ! - - - : 5 minutes to wait after Web Password Change

I found a solution to the issue of not being able to use the new password immediately when the http password is changed.

In R5, all you had to do was refresh the ($Users) & ($ServerAccess) views.

In R6, you still have to refresh these two views, but to ensure that the user can login immediately, you have to send a server console command for AdminP.

The command that needs to be sent is

    "Tell Adminp Process Interval"

and this is how you do it.


(Declarations)

Declare Sub OSMemFree Lib “nnotes.dll” (Byval hBuffer As Long)

Declare Function OSLockObject Lib “nnotes.dll” (Byval hBuffer As Long) As String

Declare Sub OSUnlockObject Lib “nnotes.dll” (Byval hBuffer As Long)

Declare Function NSFRemoteConsole Lib “nnotes.dll” (Byval ServerName As String, Byval ConsoleCommand As String, rethBuffer As Long) As Long

(Initialize)

Sub Initialize

Dim hBuf As Long

Dim pBuf As String

Dim result As Long

Dim updall$

Dim session As NotesSession

Dim db As NotesDatabase

Set Session = New NotesSession

Set db = Session.CurrentDatabase

updall$ = {Tell Adminp Process Interval}

result = NSFRemoteConsole(db.server,updall$, hBuf)

pBuf = OSLockObject(hBuf)

Call OSUnlockObject(hBuf)

Call OSMemFree(hBuf)

End Sub


Subject: - - - SOLUTION ! ! - - - : 5 minutes to wait after Web Password Change

Great tip, but it may be better to write it using the new SendConsoleCommand function (so it will also work on non-windows servers):

Call notesSession.SendConsoleCommand( db.server, {Tell Adminp Process Interval})

cheers,

Tom

Subject: RE: - - - SOLUTION ! ! - - - : 5 minutes to wait after Web Password Change

That’s nice to know. We’re only upgrading our servers right now, so I’m still working with the R5 client and didn’t know that existed.

It makes the code much cleaner.

Subject: RE: - - - SOLUTION ! ! - - - : 5 minutes to wait after Web Password Change

Hmm.

This did allow me to login immediatly, but it did not fix my problems with name changes for web users. If I change a user’s name in the NAB it is not properly reflected for about 5 minutes with @UserName and alike.

Any more ideas?

Subject: RE: - - - SOLUTION ! ! - - - : 5 minutes to wait after Web Password Change

Have people been having consistent success with this solution? I tried it to no avail. I still often get the delay before a new web password will work.

I have tried calling “Tell Adminp Process Interval” via NotesSession.SendConsoleCommand() as well as using the nnotes.dll functions. I have also tried refreshing views as described here:

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/b1be81b4d689887685256d27002a1b00?OpenDocument

Nothing has had any effect.

The person documents are stored in a secondary address book, so I am refreshing the ($ServerAccess) view in the primary address book and ($LDAPCN) in the secondary address book (I also tried refreshing ($Users) just for kicks, still no effect).

Subject: RE: - - - SOLUTION ! ! - - - : 5 minutes to wait after Web Password Change

Try it:

show nlcache reset

It refreshes login/pwd cache.

Subject: -Add sleep time - 5 minutes to wait after Web Password Change

I only got the solution to work if I did both… tell adminp Process people and show nlcache reset, and added a sleep time between the two. If you update the username/password cache before adminp is done processing people, you still get to wait.

'-------------

strOutput = notesSession.SendConsoleCommand(“”, “Tell Adminp Process People” )

Sleep 10

strOutput = notesSession.SendConsoleCommand(“”, “Show nlcache reset” )

'-----------------

Now all I’ve got to do is to get my hosting company to sign the agent and let me call it from my new user registration agent. Oh yea, I also haven’t tested with my new users in a secondary address book.

Subject: RE: -Add sleep time - 5 minutes to wait after Web Password Change

Jon - How do you get this to run - where do you put this code

thanks

Brian

Subject: RE: -Add sleep time - 5 minutes to wait after Web Password Change

Did anyone try this on windows server?

Declare Sub NAMELookup Lib “nnotes.dll” _

(Byval serverName As Integer, _

Byval flags As Integer, _

Byval numNameSpaces As Integer, _

Byval nameSpaces As String, _

Byval numNames As Integer, _

Byval names As String, _

Byval numItems As Integer, _

Byval items As String, _

rethBuffer As Long _

)

Declare Sub OSMemFree Lib “nnotes.dll” (Byval hBuffer As Long)

Dim hBuf As Long

Call NAMELookup(0, 0, 1, “$Users”, 1, UserName, 1, “HTTPPassword”, hBuf)

Call OSMemFree(hBuf)

Call NAMELookup(0, 0, 1, “$ServerAccess”, 1, UserName , 1, “ListName”, hBuf)

Call OSMemFree(hBuf)

Peter Närlund

http://domainpatrol.org