Generate Logins from Unencrypted Passwords using the MembershipWebService in iMIS15

Frequently, customers have a previous website where they have logins and passwords they would like to preserve in a new iMIS based website.

The following is sample Coldfusion code on how to access the new i15 MembershipWebService and user the RegisterWebUser method to load logins and passwords into iMIS in bulk.

This can also be modifled to replace the Generate Logins functionality of e-SEries by pre assigning logins and passwords based on a formula.

The RegisterWebUser method may be used anonymously and has limitations. If the site is still using e-Series, or uses e-Series security groups for Content Manager security, this method appears to make all users in the same security group, Anonymous. So code would have to be applied after generating the logins to update the Security Groups.

Also, the method enforces unique logins. It will throw an error if it encounters any duplicate login names.

Of course similar code can be created in ASP.NET to call the service, if any of you figure that out, please post so we have both methods. This is just an example of a transitional process to ease into ASP.NET public views.

Also attached code as attachment. It is wrapped in comment tags.

To view code, click on attachment then click on Edit>>ViewSource

Otherwise the code is hidden.

<!---<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Bulk Assign Passwords</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<cfquery name="GetOldPasswords" datasource="CF_iMIS">
select n.ID contactID2, n.Member_Type, e.userLogin, e.userPassword, n.email 
from Name n, Name_UD_Demographics d, eResourceContacts e, Name_Security ns
 where n.ID = d.ID and e.oldContactID = d.PERSON_ER_ID 
and ns.ID = n.ID and ns.WEB_LOGIN = ''
and n.MEMBER_TYPE <> 'STAFF' and e.userLogin <> '' 
and n.Member_Type = 'INDIV' 


</cfquery>


<cfoutput>
<cfloop query="GetOldPasswords">

<cftry>

       <cfinvoke webservice="http://www.xyz.com/imis15/AsiCommon/Services/Membership/MembershipWebservice.asmx?wsdl" 

method="RegisterWebUser" returnvariable="results">
 <cfinvokeargument name="contactID" value=#contactID2#>
              <cfinvokeargument name="username" value=#userLogin#>
              <cfinvokeargument name="password" value=#userPassword#>
              <cfinvokeargument name="email" value=#email#>
			  <cfinvokeargument name="passwordQuestion" value="">
			  <cfinvokeargument name="passwordAnswer" value="">
			  <cfinvokeargument name="isApproved" value="True">
</cfinvoke>

       <cfcatch>

              <cfoutput>

       <cflog text="#cfcatch.message#" log="APPLICATION" type="Error" thread="yes" date="yes" time="yes" 

application="yes">

              <script>

              alert('MembershipWebservice Error \(ValidateUser\) #cfcatch.message# #contactID2#');

              history.go (-1);

              </script>

              <cfabort>

              </cfoutput>

       </cfcatch>

</cftry>
</cfloop>
</cfoutput>
</body>
</html>
--->
AttachmentSize
GenerateLoginsCode.txt1.75 KB