How to allow the user to delete the iNotes profile in iNotes

Share

Steps:                                                                      
1. Create a database on the server (with any name e.g. BagOTrix)        
2. Create an agent (using the following LotusScript) that is  scheduled to Run “Never” with a target of None                                                                                              
Sub Initialize()                                                        
On Error GoTo ErrorLand                                                
                                                                       
Dim session As New NotesSession                                        
Dim thisDB As NotesDatabase                                            
Dim targetDB As NotesDatabase                                          
                                                                       
Dim targetServer As String                                              
Dim targetDBStr As String                                              
                                                                       
Dim docContext As NotesDocument                                        
Dim prof As NotesDocument                                              
                                                                       
Dim errorStr As String                                                  
errorStr = “”                                                          
                                                                       
Set docContext = session.Documentcontext                                
                                                                       
targetServer = StrRight(docContext.HTTP_Referer(0),”//”) ‘ gets rid of  
http/https                                                              
targetServer = StrLeft(targetServer, “/”)                              
targetDBStr = StrLeft(docContext.HTTP_Referer(0), “.nsf”)              
targetDBStr = StrRight(targetDBStr, targetServer + “/”) + “.nsf”        
‘Print “
targetServer: ” + targetServer + “
targetDB: ” +        

targetDBStr                                                            
                                                                       
Set targetDB = session.Getdatabase(targetServer, targetDBStr, false)    
Set prof = targetDB.Getprofiledocument(“iNotesProfile”)                
‘Print prof.Universalid                                                
Call prof.Remove(True)                                                  
                                                                       
If (errorStr = “”) Then                                                
GoTo Success                                                            
Else                                                                    
GoTo Failure                                                            
End If                                                                  
                                                                       
                                                                       
End                                                                    
ErrorLand:                                                              
errorStr = “Got error ” & Error$ & ” on line ” & CStr(Erl)              
Resume Next                                                            
Success:                                                                
Print “”                                                    
Print “Your profile document has now been deleted from database: ” +    
targetDBStr + ” on server: ” + targetServer                            
Print “”                                                  
End                                                                    
Failure:                                                                
Print “”                                                    
Print “

An error occurred while deleting the profile document from    
database: “_                                                            
+ targetDBStr + ” on server: “_                                        
+ targetServer + “:
” + errorStr + “

”                            
Print “”                                                  
                                                                       
End                                                                    
                                                                       
End Sub                                                                
                                                                       
                                                                       
3. Set Anonymous Access to the database to ‘No access’, and default access to Reader.
4. Send an email to the iNotes user with a link to the agent on the server for e.g http://acme.mul.ie.ibm.com/BagOTrix.nsf/DeleteMyiNotesProfile?Openagent where “acme.mul.ie.ibm.com” will be your servers fully qualified hostname (FQHN) and “BagOTrix.nsf” is the name of the database you created earlier.        
5. When the end user clicks on the link they may be asked to log in again and then the agent will delete the profile document from their mail database

From TN1512367