Added more core functionality
This commit is contained in:
committed by
Ouellette Jonathan (CSC FI SPS MESLEO)
parent
b73aa6b578
commit
9f3dfbfe12
@ -206,3 +206,32 @@ CreateHALItem:
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
API oiwizard.checkidleoisessionvalid.HEAD
|
||||
API oiwizard.checkidleoisessionvalid.GET
|
||||
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSessionIdle', OIWizardID)
|
||||
|
||||
If ValidSession EQ True$ then
|
||||
Expiry = Xlate('OI_WIZARD', OIWizardID, 'EXPIRY_UTC', 'X')
|
||||
LSLUserID = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
||||
HTTP_Services('SetResponseHeaderField', 'Set-Cookie', 'sessionID=':OIWizardID:' ;Expires=':Expiry)
|
||||
HTTP_Services('SetResponseHeaderField', 'Set-Cookie', 'userID=':LSLUserID:' ;Expires=':Expiry, True$)
|
||||
HTTP_Services('SetResponseHeaderField', 'Expires', Expiry)
|
||||
Message = 'Valid session. Expiry updated'
|
||||
StatusCode = 200
|
||||
GoSub CreateHALItem
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
||||
|
Reference in New Issue
Block a user