https://dataflex.wiki/index.php?title=Using_your_own_user_table_in_WebApps&feed=atom&action=historyUsing your own user table in WebApps - Revision history2024-03-29T00:59:11ZRevision history for this page on the wikiMediaWiki 1.41.0https://dataflex.wiki/index.php?title=Using_your_own_user_table_in_WebApps&diff=3420&oldid=prevHsymington: Formatting changes.2021-05-05T09:42:13Z<p>Formatting changes.</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 10:42, 5 May 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l11">Line 11:</td>
<td colspan="2" class="diff-lineno">Line 11:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Step 2. From {''DataFlexInstalledLocation''}\Pkg:====</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Step 2. From {''DataFlexInstalledLocation''}\Pkg:====</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div># Copy cWebSessionManagerStandard.pkg (note: <u>not</u> cWebSessionManager.pkg) to your AppSrc directory, renaming it to cWebSessionManager{''YourSystemName''}.pkg</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div># Copy <ins style="font-weight: bold; text-decoration: none;">[https://docs.dataaccess.com/dataflexhelp/mergedProjects/VDFClassRef/cWebSessionManagerStandard.htm </ins>cWebSessionManagerStandard.pkg<ins style="font-weight: bold; text-decoration: none;">] </ins>(note: <u>not</u> cWebSessionManager.pkg) to your AppSrc directory, renaming it to cWebSessionManager{''YourSystemName''}.pkg</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div># Copy cWebAppUserDataDictionary.pkg and cWebAppSessionDataDictionary.pkg to your DDSrc directory (the former will not actually be used, but will be modified by the next step of the process, so best to copy it too)</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div># Copy <ins style="font-weight: bold; text-decoration: none;">[https://docs.dataaccess.com/dataflexhelp/index.htm#t=mergedProjects%2FVDFClassRef%2FcWebAppUserDataDictionary.htm&rhsearch=cWebAppUserDataDictionary.pkg&rhhlterm=cWebAppUserDataDictionary.pkg&rhsyns=%20 </ins>cWebAppUserDataDictionary.pkg<ins style="font-weight: bold; text-decoration: none;">] </ins>and <ins style="font-weight: bold; text-decoration: none;">[https://docs.dataaccess.com/dataflexhelp/index.htm#t=mergedProjects%2FVDFClassRef%2FcWebAppSessionDataDictionary.htm&rhsearch=cWebAppSessionDataDictionary&rhhlterm=cWebAppSessionDataDictionary&rhsyns=%20 </ins>cWebAppSessionDataDictionary.pkg<ins style="font-weight: bold; text-decoration: none;">] </ins>to your DDSrc directory (the former will not actually be used, but will be modified by the next step of the process, so best to copy it too)</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Step 3. Change the relationship of WebAppSession to WebAppUser to point to your user table instead:====</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Step 3. Change the relationship of WebAppSession to WebAppUser to point to your user table instead:====</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l21">Line 21:</td>
<td colspan="2" class="diff-lineno">Line 21:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Step 4. Modify your cWebSessionManager sub-class:====</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Step 4. Modify your cWebSessionManager sub-class:====</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#Change the use statement: "Use cWebSessionManager.pkg" to "Use cWebSessionManagerStandard.pkg"</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>#Change the use statement:<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>"Use cWebSessionManager.pkg"<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>to<ins style="font-weight: bold; text-decoration: none;">:<br /> </ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Use cWebSessionManagerStandard.pkg<ins style="font-weight: bold; text-decoration: none;">'''</ins>" </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#Replace the use statement: <del style="font-weight: bold; text-decoration: none;">replace </del>"Use cWebAppUserDataDictionary.dd" with "Use c{''YourUserTable''}DataDictionary.dd"</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>#Replace the use statement:<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>"Use cWebAppUserDataDictionary.dd"<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>with<ins style="font-weight: bold; text-decoration: none;">: <br /></ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Use c{''YourUserTable''}DataDictionary.dd<ins style="font-weight: bold; text-decoration: none;">'''</ins>"</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#Change the classname: <del style="font-weight: bold; text-decoration: none;">from </del>"Class cWebSessionManagerStandard is a cWebSessionManager" to "Class cWebSessionManager{''YourSystemName''} is a cWebSessionManagerStandard" (so sub-classing cWebSessionManagerStandard)</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>#Change the classname:<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>"Class cWebSessionManagerStandard is a cWebSessionManager" <ins style="font-weight: bold; text-decoration: none;"><br /></ins>to<ins style="font-weight: bold; text-decoration: none;">: <br /> </ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Class cWebSessionManager{''YourSystemName''} is a cWebSessionManagerStandard<ins style="font-weight: bold; text-decoration: none;">'''</ins>" (so sub-classing cWebSessionManagerStandard)</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#Change the user data dictionary instance: in the '''Construct_Object''' procedure <del style="font-weight: bold; text-decoration: none;">change </del>"Get Create (RefClass(cWebAppUserDataDictionary)) to hoUserDD" to "Get Create (RefClass(c{''YourUserTable''}DataDictionary)) to hoUserDD"</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>#Change the user data dictionary instance: in the '''Construct_Object''' procedure <ins style="font-weight: bold; text-decoration: none;"><br /></ins>"Get Create (RefClass(cWebAppUserDataDictionary)) to hoUserDD" <ins style="font-weight: bold; text-decoration: none;"><br /></ins>to<ins style="font-weight: bold; text-decoration: none;">: <br /></ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Get Create (RefClass(c{''YourUserTable''}DataDictionary)) to hoUserDD<ins style="font-weight: bold; text-decoration: none;">'''</ins>"</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#Modify the '''UserLogin''' function:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#Modify the '''UserLogin''' function:</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: "Move sLoginName to WebAppUser.LoginName" with "Move sLoginName to {''YourUserTable''}.{''YourIdCol''}</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: <ins style="font-weight: bold; text-decoration: none;"><br /></ins>"Move sLoginName to WebAppUser.LoginName" <ins style="font-weight: bold; text-decoration: none;"><br /></ins>with<ins style="font-weight: bold; text-decoration: none;">: <br /></ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Move sLoginName to {''YourUserTable''}.{''YourIdCol''}<ins style="font-weight: bold; text-decoration: none;">'''"</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: "If (Found and (Lowercase(sLoginName) = Lowercase(Trim(WebAppUser.LoginName)))) Begin" with "If (Found and (Lowercase(sLoginName) = Lowercase(Trim({''YourUserTable''}.{''YourIdCol''})))) Begin"</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: <ins style="font-weight: bold; text-decoration: none;"><br /></ins>"If (Found and (Lowercase(sLoginName) = Lowercase(Trim(WebAppUser.LoginName)))) Begin" <ins style="font-weight: bold; text-decoration: none;"><br /></ins>with<ins style="font-weight: bold; text-decoration: none;">: <br /></ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>If (Found and (Lowercase(sLoginName) = Lowercase(Trim({''YourUserTable''}.{''YourIdCol''})))) Begin<ins style="font-weight: bold; text-decoration: none;">'''</ins>"</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: "Get Field_Current_Value of hoUserDD Field WebAppUser.Password to sUserPassword" with "Get Field_Current_Value of hoUserDD Field {''YourUserTable''}.{''YourPasswordCol''} to sUserPassword"</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: <ins style="font-weight: bold; text-decoration: none;"><br /></ins>"Get Field_Current_Value of hoUserDD Field WebAppUser.Password to sUserPassword"<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>with<ins style="font-weight: bold; text-decoration: none;">: <br /></ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Get Field_Current_Value of hoUserDD Field {''YourUserTable''}.{''YourPasswordCol''} to sUserPassword<ins style="font-weight: bold; text-decoration: none;">'''</ins>"</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: "Set Field_Changed_Value of hoUserDD Field WebAppUser.LastLogin to (CurrentDateTime())" with "Set Field_Changed_Value of hoUserDD Field {''YourUserTable''}.{''YourLastLoginCol''} to (CurrentDateTime())" // This one is optional<del style="font-weight: bold; text-decoration: none;">. You </del>may not have such a column (a date, by default) and if you do not wish to create one just remove the line</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>##<ins style="font-weight: bold; text-decoration: none;">Optional. </ins>Replace the line: <ins style="font-weight: bold; text-decoration: none;"><br /></ins>"Set Field_Changed_Value of hoUserDD Field WebAppUser.LastLogin to (CurrentDateTime())"<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>with<ins style="font-weight: bold; text-decoration: none;">:<br /> </ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Set Field_Changed_Value of hoUserDD Field {''YourUserTable''}.{''YourLastLoginCol''} to (CurrentDateTime())<ins style="font-weight: bold; text-decoration: none;">'''</ins>" // This one is optional <ins style="font-weight: bold; text-decoration: none;">because you </ins>may not have such a column (a date, by default) and if you do not wish to create one just remove the line<ins style="font-weight: bold; text-decoration: none;">.</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#Modify the '''UpdateSessionProperties''' function:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#Modify the '''UpdateSessionProperties''' function:</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line "Set psUsername to (Trim(WebAppUser.FullName))" with "Set psUsername to (Trim({''YourUserTable''}.{''YourUserFullname''}))" <del style="font-weight: bold; text-decoration: none;">// Optional - otherwise just remove the line</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>##<ins style="font-weight: bold; text-decoration: none;">Optional - otherwise just remove the line. </ins>Replace the line<ins style="font-weight: bold; text-decoration: none;">:<br /> </ins>"Set psUsername to (Trim(WebAppUser.FullName))"<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>with<ins style="font-weight: bold; text-decoration: none;">:<br /> </ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Set psUsername to (Trim({''YourUserTable''}.{''YourUserFullname''}))<ins style="font-weight: bold; text-decoration: none;">'''</ins>" </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line "Set psLoginName to (Trim(WebAppUser.LoginName))" with "Set psLoginName to (Trim({''YourUserTable''}.{''YourIdColumn''}))</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line<ins style="font-weight: bold; text-decoration: none;">:<br /> </ins>"Set psLoginName to (Trim(WebAppUser.LoginName))"<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>with<ins style="font-weight: bold; text-decoration: none;">: <br /></ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Set psLoginName to (Trim({''YourUserTable''}.{''YourIdColumn''}))<ins style="font-weight: bold; text-decoration: none;">'''"</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: "Set piUserRights to WebAppUser.Rights" with "Set piUserRights to {''YourUserTable''}.{''YourRightsColumn''} // <del style="font-weight: bold; text-decoration: none;">Optional - if you don</del>'<del style="font-weight: bold; text-decoration: none;">t have a rights column, remove the line. </del>Note: if you use an ASCII column, rather than a numeric one for this, you will need to add a different property in the Construct_Object procedure of the class - something like "Property String psUserType" and "Set" that instead</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>##<ins style="font-weight: bold; text-decoration: none;">Optional - if you don't have a rights column, remove the line. </ins>Replace the line:<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>"Set piUserRights to WebAppUser.Rights"<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>with<ins style="font-weight: bold; text-decoration: none;">:<br /> </ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Set piUserRights to {''YourUserTable''}.{''YourRightsColumn''}<ins style="font-weight: bold; text-decoration: none;">'''" </ins> // <ins style="font-weight: bold; text-decoration: none;"> ''</ins>'Note:<ins style="font-weight: bold; text-decoration: none;">''' </ins>if you use an ASCII column, rather than a numeric one for this, you will need to add a different property in the Construct_Object procedure of the class - something like "Property String psUserType" and "Set" that instead</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#Remove all the other methods from your sub-class (they are covered in its super-class cWebSessionManagerStandard):</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#Remove all the other methods from your sub-class (they are covered in its super-class cWebSessionManagerStandard):</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##CreateSession</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##CreateSession</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l45">Line 45:</td>
<td colspan="2" class="diff-lineno">Line 45:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Step 5. Modify SessionManager.wo to use your sub-class:====</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Step 5. Modify SessionManager.wo to use your sub-class:====</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#Change: "Use cWebSessionManagerStandard.pkg" to "Use cWebSessionManager{''YourSystemName''}.pkg"</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>#Change:<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>"Use cWebSessionManagerStandard.pkg"<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>to<ins style="font-weight: bold; text-decoration: none;">:<br /> </ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Use cWebSessionManager{''YourSystemName''}.pkg<ins style="font-weight: bold; text-decoration: none;">'''</ins>"</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#Change: "Object oSessionManager is a cWebSessionManagerStandard" to "Object oSessionManager is a cWebSessionManager{''YourSystemName''}"</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>#Change:<ins style="font-weight: bold; text-decoration: none;"><br /> </ins>"Object oSessionManager is a cWebSessionManagerStandard" <ins style="font-weight: bold; text-decoration: none;"><br /></ins>to<ins style="font-weight: bold; text-decoration: none;">:<br /> </ins>"<ins style="font-weight: bold; text-decoration: none;">'''</ins>Object oSessionManager is a cWebSessionManager{''YourSystemName''}<ins style="font-weight: bold; text-decoration: none;">'''</ins>"</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Now you should be good to go and users of your Windows app will/can also be users of your WebApp!</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Now you should be good to go and users of your Windows app will/can also be users of your WebApp!</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category: Web Applications]]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category: Web Applications]]</div></td></tr>
</table>Hsymingtonhttps://dataflex.wiki/index.php?title=Using_your_own_user_table_in_WebApps&diff=3419&oldid=prevHsymington: Added to Web Applications category2021-05-05T07:56:44Z<p>Added to Web Applications category</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:56, 5 May 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l49">Line 49:</td>
<td colspan="2" class="diff-lineno">Line 49:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Now you should be good to go and users of your Windows app will/can also be users of your WebApp!</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Now you should be good to go and users of your Windows app will/can also be users of your WebApp!</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category: Web Applications]]</ins></div></td></tr>
</table>Hsymingtonhttps://dataflex.wiki/index.php?title=Using_your_own_user_table_in_WebApps&diff=3418&oldid=prevMikepeat: UserLogin2021-05-02T10:38:13Z<p>UserLogin</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:38, 2 May 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l3">Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Actually it is reasonably simple, but I'm going to go through it line-by-line, so it will seem like a lot, but it really isn't.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Actually it is reasonably simple, but I'm going to go through it line-by-line, so it will seem like a lot, but it really isn't.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The instructions below assume that your system has a user table; that it has a userID column of some sort; that column is the primary (unique) key; and that column is the sole element of Index.1 on that table. (If that last is <u>not</u> the case, you will have to also modify the "Send Find of hoUserDD EQ Index.1" line in the <del style="font-weight: bold; text-decoration: none;">Userlogin </del>procedure in your sub-class to use the correct index.)</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The instructions below assume that your system has a user table; that it has a userID column of some sort; that column is the primary (unique) key; and that column is the sole element of Index.1 on that table. (If that last is <u>not</u> the case, you will have to also modify the "Send Find of hoUserDD EQ Index.1" line in the <ins style="font-weight: bold; text-decoration: none;">UserLogin </ins>procedure in your sub-class to use the correct index.)</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Text in {''italics''} should be replaced with the appropriate values for your own system.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Text in {''italics''} should be replaced with the appropriate values for your own system.</div></td></tr>
</table>Mikepeathttps://dataflex.wiki/index.php?title=Using_your_own_user_table_in_WebApps&diff=3417&oldid=prevMikepeat: Minor edit2021-04-30T14:02:04Z<p>Minor edit</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 15:02, 30 April 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l34">Line 34:</td>
<td colspan="2" class="diff-lineno">Line 34:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line "Set psLoginName to (Trim(WebAppUser.LoginName))" with "Set psLoginName to (Trim({''YourUserTable''}.{''YourIdColumn''}))</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line "Set psLoginName to (Trim(WebAppUser.LoginName))" with "Set psLoginName to (Trim({''YourUserTable''}.{''YourIdColumn''}))</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: "Set piUserRights to WebAppUser.Rights" with "Set piUserRights to {''YourUserTable''}.{''YourRightsColumn''} // Optional - if you don't have a rights column, remove the line. Note: if you use an ASCII column, rather than a numeric one for this, you will need to add a different property in the Construct_Object procedure of the class - something like "Property String psUserType" and "Set" that instead</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: "Set piUserRights to WebAppUser.Rights" with "Set piUserRights to {''YourUserTable''}.{''YourRightsColumn''} // Optional - if you don't have a rights column, remove the line. Note: if you use an ASCII column, rather than a numeric one for this, you will need to add a different property in the Construct_Object procedure of the class - something like "Property String psUserType" and "Set" that instead</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>#Remove all the other methods from your sub-class (they are covered in cWebSessionManagerStandard) :</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>#Remove all the other methods from your sub-class (they are covered in <ins style="font-weight: bold; text-decoration: none;">its super-class </ins>cWebSessionManagerStandard):</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##CreateSession</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##CreateSession</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##ValidateSession</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##ValidateSession</div></td></tr>
</table>Mikepeathttps://dataflex.wiki/index.php?title=Using_your_own_user_table_in_WebApps&diff=3416&oldid=prevMikepeat: Typo2021-04-30T13:48:41Z<p>Typo</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:48, 30 April 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l33">Line 33:</td>
<td colspan="2" class="diff-lineno">Line 33:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line "Set psUsername to (Trim(WebAppUser.FullName))" with "Set psUsername to (Trim({''YourUserTable''}.{''YourUserFullname''}))" // Optional - otherwise just remove the line</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line "Set psUsername to (Trim(WebAppUser.FullName))" with "Set psUsername to (Trim({''YourUserTable''}.{''YourUserFullname''}))" // Optional - otherwise just remove the line</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line "Set psLoginName to (Trim(WebAppUser.LoginName))" with "Set psLoginName to (Trim({''YourUserTable''}.{''YourIdColumn''}))</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line "Set psLoginName to (Trim(WebAppUser.LoginName))" with "Set psLoginName to (Trim({''YourUserTable''}.{''YourIdColumn''}))</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: "Set piUserRights to WebAppUser.Rights" with "Set piUserRights to {''YourUserTable''}.{''<del style="font-weight: bold; text-decoration: none;">YourRightColumn</del>''} // Optional - if you don't have a rights column, remove the line. Note: if you use an ASCII column, rather than a numeric one for this, you will need to add a different property in the Construct_Object procedure of the class - something like "Property String psUserType" and "Set" that instead</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>##Replace the line: "Set piUserRights to WebAppUser.Rights" with "Set piUserRights to {''YourUserTable''}.{''<ins style="font-weight: bold; text-decoration: none;">YourRightsColumn</ins>''} // Optional - if you don't have a rights column, remove the line. Note: if you use an ASCII column, rather than a numeric one for this, you will need to add a different property in the Construct_Object procedure of the class - something like "Property String psUserType" and "Set" that instead</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#Remove all the other methods from your sub-class (they are covered in cWebSessionManagerStandard) :</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#Remove all the other methods from your sub-class (they are covered in cWebSessionManagerStandard) :</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##CreateSession</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>##CreateSession</div></td></tr>
</table>Mikepeathttps://dataflex.wiki/index.php?title=Using_your_own_user_table_in_WebApps&diff=3415&oldid=prevMikepeat: Creating2021-04-30T13:16:46Z<p>Creating</p>
<p><b>New page</b></p><div>In most cases when creating a WebApp for an existing (Windows) system, that system will already have a mechanism for checking user credentials (i.e. user-name and password) in existance. The Data Access supplied mechanism for WebApps uses its own tables for this and for session management within that. So how do we integrate the two?<br />
<br />
Actually it is reasonably simple, but I'm going to go through it line-by-line, so it will seem like a lot, but it really isn't.<br />
<br />
The instructions below assume that your system has a user table; that it has a userID column of some sort; that column is the primary (unique) key; and that column is the sole element of Index.1 on that table. (If that last is <u>not</u> the case, you will have to also modify the "Send Find of hoUserDD EQ Index.1" line in the Userlogin procedure in your sub-class to use the correct index.)<br />
<br />
Text in {''italics''} should be replaced with the appropriate values for your own system.<br />
<br />
====Step 1. If you have not already done it, Create a WebApp Project in your workspace.====<br />
<br />
====Step 2. From {''DataFlexInstalledLocation''}\Pkg:====<br />
<br />
# Copy cWebSessionManagerStandard.pkg (note: <u>not</u> cWebSessionManager.pkg) to your AppSrc directory, renaming it to cWebSessionManager{''YourSystemName''}.pkg<br />
# Copy cWebAppUserDataDictionary.pkg and cWebAppSessionDataDictionary.pkg to your DDSrc directory (the former will not actually be used, but will be modified by the next step of the process, so best to copy it too)<br />
<br />
====Step 3. Change the relationship of WebAppSession to WebAppUser to point to your user table instead:====<br />
<br />
#The relationship needs to be on identically defined columns (same type and size). I don't think that we ought to impact the existing system when that can be avoided, so if a change is needed (and it usually will be) the change should be at the WebAppSession table end. Modify (in the Studio, right-click WebAppSession in the Table Explorer pane/tab, select "Edit Table" and make the required change to the LoginName column) that so that it matches the (unique) primary key (the user ID) of your current user table. (So if your current user table has a column - say, UserID - which is ASCII 10, modify WebAppSession.LoginName to be ASCII 10 from its original ASCII 20.)<br />
#In the "Relationships" tab, delete the relationship to WebAppUser (the only one there) and add a replacement pointing to your user table, from LoginName on WebAppSession, to whatever the user ID column is on your user table.<br />
<br />
====Step 4. Modify your cWebSessionManager sub-class:====<br />
<br />
#Change the use statement: "Use cWebSessionManager.pkg" to "Use cWebSessionManagerStandard.pkg"<br />
#Replace the use statement: replace "Use cWebAppUserDataDictionary.dd" with "Use c{''YourUserTable''}DataDictionary.dd"<br />
#Change the classname: from "Class cWebSessionManagerStandard is a cWebSessionManager" to "Class cWebSessionManager{''YourSystemName''} is a cWebSessionManagerStandard" (so sub-classing cWebSessionManagerStandard)<br />
#Change the user data dictionary instance: in the '''Construct_Object''' procedure change "Get Create (RefClass(cWebAppUserDataDictionary)) to hoUserDD" to "Get Create (RefClass(c{''YourUserTable''}DataDictionary)) to hoUserDD"<br />
#Modify the '''UserLogin''' function:<br />
##Replace the line: "Move sLoginName to WebAppUser.LoginName" with "Move sLoginName to {''YourUserTable''}.{''YourIdCol''}<br />
##Replace the line: "If (Found and (Lowercase(sLoginName) = Lowercase(Trim(WebAppUser.LoginName)))) Begin" with "If (Found and (Lowercase(sLoginName) = Lowercase(Trim({''YourUserTable''}.{''YourIdCol''})))) Begin"<br />
##Replace the line: "Get Field_Current_Value of hoUserDD Field WebAppUser.Password to sUserPassword" with "Get Field_Current_Value of hoUserDD Field {''YourUserTable''}.{''YourPasswordCol''} to sUserPassword"<br />
##Replace the line: "Set Field_Changed_Value of hoUserDD Field WebAppUser.LastLogin to (CurrentDateTime())" with "Set Field_Changed_Value of hoUserDD Field {''YourUserTable''}.{''YourLastLoginCol''} to (CurrentDateTime())" // This one is optional. You may not have such a column (a date, by default) and if you do not wish to create one just remove the line<br />
#Modify the '''UpdateSessionProperties''' function:<br />
##Replace the line "Set psUsername to (Trim(WebAppUser.FullName))" with "Set psUsername to (Trim({''YourUserTable''}.{''YourUserFullname''}))" // Optional - otherwise just remove the line<br />
##Replace the line "Set psLoginName to (Trim(WebAppUser.LoginName))" with "Set psLoginName to (Trim({''YourUserTable''}.{''YourIdColumn''}))<br />
##Replace the line: "Set piUserRights to WebAppUser.Rights" with "Set piUserRights to {''YourUserTable''}.{''YourRightColumn''} // Optional - if you don't have a rights column, remove the line. Note: if you use an ASCII column, rather than a numeric one for this, you will need to add a different property in the Construct_Object procedure of the class - something like "Property String psUserType" and "Set" that instead<br />
#Remove all the other methods from your sub-class (they are covered in cWebSessionManagerStandard) :<br />
##CreateSession<br />
##ValidateSession<br />
##IsLoggedIn<br />
##ComparePasswords<br />
##OnSessionPropertiesSet<br />
##OnSessionPropertiesClear<br />
##EndSession<br />
<br />
====Step 5. Modify SessionManager.wo to use your sub-class:====<br />
<br />
#Change: "Use cWebSessionManagerStandard.pkg" to "Use cWebSessionManager{''YourSystemName''}.pkg"<br />
#Change: "Object oSessionManager is a cWebSessionManagerStandard" to "Object oSessionManager is a cWebSessionManager{''YourSystemName''}"<br />
<br />
Now you should be good to go and users of your Windows app will/can also be users of your WebApp!</div>Mikepeat