4 files updated
This commit is contained in:
parent
f4a28f3b51
commit
06ff2bdecd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -38,6 +38,22 @@ if (mobile) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def agovSkipAskingMobileCookieValue = 'missing'
|
||||||
|
|
||||||
|
if (getHeader('cookie') != null) {
|
||||||
|
def cookies = getHeader('cookie')
|
||||||
|
if (cookies.matches('^.*agovSkipAskingMobile=([^;]+).*$')) {
|
||||||
|
agovSkipAskingMobileCookieValue = cookies.replaceAll('^.*agovSkipAskingMobile=([^;]+).*$', '$1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (agovSkipAskingMobileCookieValue == 'true') {
|
||||||
|
// Don't aske the user again...
|
||||||
|
LOG.info("Event='SKIPPEDMOBILENUMBER', Requester='${requester}', RequestId='${requestId}', User=${user}, SourceIp=${sourceIp}, UserAgent='${userAgent}'")
|
||||||
|
response.setResult('done')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!inargs['submit'] && (!inargs['mobile'] || !inargs['mobile'].isEmpty()) && inargs['language'] && inargs['language'] != session['ch.nevis.session.user.language']) {
|
if (!inargs['submit'] && (!inargs['mobile'] || !inargs['mobile'].isEmpty()) && inargs['language'] && inargs['language'] != session['ch.nevis.session.user.language']) {
|
||||||
// language switch, nothing else to do, just display again the GUI
|
// language switch, nothing else to do, just display again the GUI
|
||||||
response.setStatus(AuthResponse.AUTH_CONTINUE)
|
response.setStatus(AuthResponse.AUTH_CONTINUE)
|
||||||
|
@ -58,23 +74,15 @@ if (inargs['submit'] && (!inargs['mobile'] || inargs['mobile'].isEmpty()) && ina
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
def agovSkipAskingMobileCookie = 'missing'
|
|
||||||
|
|
||||||
if (getHeader('cookie') != null) {
|
|
||||||
def cookies = getHeader('cookie')
|
|
||||||
if (cookies.matches('^.*agovSkipAskingMobile=([^;]+).*$')) {
|
|
||||||
agovSkipAskingMobileCookie = cookies.replaceAll('^.*agovSkipAskingMobile=([^;]+).*$', '$1')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (agovSkipAskingMobileCookie == 'true') {
|
|
||||||
// Don't aske the user again...
|
|
||||||
LOG.info("Event='SKIPPEDMOBILENUMBER', Requester='${requester}', RequestId='${requestId}', User=${user}, SourceIp=${sourceIp}, UserAgent='${userAgent}'")
|
|
||||||
response.setResult('done')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (inargs['submit'] && inargs['mobile'] && !inargs['mobile'].isEmpty()) {
|
if (inargs['submit'] && inargs['mobile'] && !inargs['mobile'].isEmpty()) {
|
||||||
|
// IMPORTANT/haburger/2024-DEC-09: the pattern must be the same as ch.adnovum.agov.common.util.InputPatterns.PHONE_NUMBER_PATTERN
|
||||||
|
if (!inargs['mobile'].replaceAll('\\s', '').matches('^(?:\\+[0-9]+)?$')) {
|
||||||
|
LOG.warn("Event='MOBILEFAILED', Requester='${requester}', RequestId='${requestId}', User=${user}, SourceIp=${sourceIp}, UserAgent='${userAgent}', reason='User provided invalid number (${inargs['mobile']})'")
|
||||||
|
response.setResult('done')
|
||||||
|
return
|
||||||
|
}
|
||||||
String result
|
String result
|
||||||
|
|
||||||
def patchBdy = "{\"contacts\":{\"mobile\":\"${inargs['mobile']?.trim()}\"},\"modificationComment\":\"added mobile number from user during request ${requestId}\"}"
|
def patchBdy = "{\"contacts\":{\"mobile\":\"${inargs['mobile']?.trim()}\"},\"modificationComment\":\"added mobile number from user during request ${requestId}\"}"
|
||||||
|
|
Loading…
Reference in New Issue