I am looking to create an Xpage self registration site that registers users onto the Domino name and address book. I am just doing a proof of concept.
I will put the code below, but it is a fairly simple matter of capturing the user details, dropping their details and password into the NAB and then, hey presto the user should be able to immediately log into the app.nsf.
At the moment I am manually putting the user into a group that is listed in the ACL as manager on app.nsf (for testing, I am putting them in the group prior to creating the user - just mentioning it in case it is important).
It basically works, BUT, there is a rather large delay. As in, it takes many minutes and sometimes more. After some research I discovered the console command "show nlcache reset" and a lotusscript/java/javascript code version of it. But it seems to have no effect, either coded or manually from the console - (there is also no response from the console that the command has been initiated, just a new line, is this normal?).
The only quirky thing is that the OU=99123456789 (or something similar, it is a company identifier). So a user will look something like this Fred Citizen/99123456789/Domain (don't think this should matter). The user will however log in as "Fred Citizen" and password.
Any ideas?
We are running 9.0.1
Thanks in advance. Cheers Damien
Code Below:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.data>
<xp:dominoDocument var="userreg" databaseName="names.nsf"
formName="Person">
</xp:dominoDocument>
</xp:this.data>
<fieldset class="userreg">
<label for="FirstName">First Name</label>
<xp:inputText id="FirstName" value="#{userreg.FirstName}">
</xp:inputText>
<br />
<label for="LastName">Last Name</label>
<xp:inputText id="LastName" value="#{userreg.LastName}">
</xp:inputText>
<br />
<label for="CompanyName">Company Name - ABN</label>
<xp:inputText id="CompanyName" value="#{userreg.CompanyName}">
</xp:inputText>
<br />
<label for="Level0_1">Service ID</label>
<xp:inputText id="Level0_1" value="#{userreg.Level0_1}">
</xp:inputText>
<br />
<label for="HTTPPassword">Password</label>
<xp:inputText id="HTTPPassword" value="#{userreg.HTTPPassword}"
password="true">
</xp:inputText>
<br />
<label for="InternetAddress">Email Address</label>
<xp:inputText id="InternetAddress" value="#{userreg.InternetAddress}">
</xp:inputText>
<br />
<xp:text escape="true" id="type" value="#{userreg.type}"
rendered="false">
</xp:text>
<xp:button value="Register" id="userreg_submit">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp:actionGroup>
<xp:actionGroup>
<xp:modifyField name="type" value="Person">
</xp:modifyField>
<xp:modifyField name="FullName">
<xp:this.value><![CDATA[#{javascript:var fullNameArray = new Array();
var first = getComponent("FirstName").getValue();
var last = getComponent("LastName").getValue();
var abn = getComponent("CompanyName").getValue();
fullNameArray[0]= "CN=" + first + " " + last + "/OU=" + abn + "/O=RR1";
fullNameArray[1] = first + " " + last;
return fullNameArray;
}]]></xp:this.value>
</xp:modifyField>
<xp:saveDocument></xp:saveDocument>
</xp:actionGroup>
</xp:actionGroup>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:br></xp:br>
<xp:br></xp:br></fieldset></xp:view>
show nlcache resetshouldn't be necessary: as Sven mentioned: do a refresh of the$Usersview in the directory (and optionally the$Groupsview). BTW: I don't agree with the two comments above on creating person docs directly, although you might want to add an activation step to the process (send link to email to require activation) and check for duplicate email addresses. I would also consider registering these users in (at least) a separate OU and optionally a secondary directory. - Mark Leusink