Online documentation - Websydian v6.5 |
To implement the 'update at login' solution for Websydian 2.0, 2.1, and 2.5 for the iSeries platform the steps in the following sections must be applied.
In the example the implemented user management pattern is named AcmeUserControl. All references to AcmeUserControl should be replaced with the name of your user management pattern.
This function should be modified so it generates a new password signature for users whose password signature has not been updated.
Add the triples displayed in the table below to the model:
AcmeUserControl.Service.WebLoginPage.Login | local FLD ...for |
WSYUSER/Password OBJECTS/Local |
local FLD ...for |
MyLastLogin OBJECTS/Local |
|
local FLD ...for |
WSYBASE/FieldsToSignature OBJECTS/Local |
|
local FLD ...for |
WSYBASE/Signature OBJECTS/Local |
|
local FLD ...for |
WSYBASE/PropertyValue OBJECTS/Local |
|
local FLD ...for |
WSYBASE/FieldLength OBJECTS/Local |
|
local FLD ...for |
WSYBASE/LengthOfFieldsToSign OBJECTS/Local |
|
OldMD2 | type SYS | API |
dual FLD ...for |
WSYBASE/Signature OBJECTS/Input |
|
input FLD ...for |
WSYBASE/FieldsToSignature OBJECTS/Input |
|
input FLD ...for |
WSYBASE/LengthOfFieldsToSign OBJECTS/Input |
|
file name NME | OLDMD2 | |
impl name NME | OLDMD2 | |
MyLastLogin | is a FLD | WSYUSER/LastLogin |
value VAL | DeploymentDate | |
impl name NME | mylogin |
Insert the following code into the pre point Start validate password in the function WebLoginPage.Login:
Call AcmeUserControl.Data.User.Fetch.SingleFetch
// Map with WebInput<UserLoginName>
If
AcmeUserControl.Data.User.Fetch.SingleFetch/FetchedData<LastLogin>
<<
<MyLastLogin.DeploymentDate>
Cast Local<PropertyValue>,
WebInput<Password.PasswordDisplayed>
API Call Source code: WSYBASE/GetFieldLength
Map with Local<FieldLength>
Local<PropertyValue>
Cast
Local<FieldsToSignature>,
WebInput<Password.PasswordDisplayed>
Cast Local<LengthOfFieldsToSign>,
Local<FieldLength>
Call OldMD2
Map with Local<Signature>
Local<FieldsToSignature>
Local<LengthOfFieldsToSign>
Cast Local<Password>,
Local<Signature>
if Local<Password> ==
AcmeUserControl.Data.User.Fetch.SingleFetch/FetchedData<Password>
Call AcmeUserControl.Data.User.Update.UpdateRow
// Map with output from AcmeUserControl.Data.User.Fetch.SingleFetch
// - except for Password that is mapped with WebInput<Password>
The literal value of the value object <MyLastLogin.DeploymentDate> should contain the timestamp for when the MD2 update was deployed. The format of the literal value is 'yyyymmddhhmmss000000'. The first 'mm' is the month and the second 'mm' is minutes.
Generate and build the function AcmeUserControl.Service.WebLoginPage.Login.