From bca7d915873bf5bb37ce799a865339f101d06f71 Mon Sep 17 00:00:00 2001 From: Jos Groot Lipman Date: Thu, 12 Oct 2017 10:11:36 +0000 Subject: [PATCH] FSN#45727 App kunnen herkennen in asp en dan geen 'naar classic' tonen svn path=/Website/branches/v2017.2/; revision=35661 --- APPL/AUT/getapptoken.asp | 5 +++++ APPL/AUT/loginTry.asp | 4 +++- APPL/PDA/iface.inc | 2 +- APPL/Shared/Shared.inc | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/APPL/AUT/getapptoken.asp b/APPL/AUT/getapptoken.asp index da872ef212..08add267dc 100644 --- a/APPL/AUT/getapptoken.asp +++ b/APPL/AUT/getapptoken.asp @@ -94,6 +94,11 @@ var JSON_Result = true; "issued_at": Math.floor(cp_data.accessdate.getTime() / 1000) // "refresh_url": HTTP.urlzelf() + "/appl/aut/getapptoken.asp?client_id={0}&auth={1}".format(sp, spp_data.refreshtoken) } + // een accesstoken wordt eventueel weer opgevangen in loginTry via http header X-FACILITOR-ACCESS-TOKEN + + Session("aut_client_key") = cp_data.autclient.id; + Session("aut_client_name") = cp_data.autclient.name; + Response.Write(JSON.stringify(result)); Response.End; %> diff --git a/APPL/AUT/loginTry.asp b/APPL/AUT/loginTry.asp index 1b4a2fce15..2ec4e50dfe 100644 --- a/APPL/AUT/loginTry.asp +++ b/APPL/AUT/loginTry.asp @@ -118,7 +118,7 @@ if (user_key < 0) // Probeer de user_key uit een cookie te halen if (user_key < 0) { - var auth = String(Request.ServerVariables("HTTP_X_FACILITOR_ACCESS_TOKEN")); + var auth = String(Request.ServerVariables("HTTP_X_FACILITOR_ACCESS_TOKEN")); // Deze is aangemaakt in /aut/getapptoken.asp if (auth.match(/^1\$/)) // Mode 1$xxxxxxx { __Log("Found HTTP_X_FACILITOR_ACCESS_TOKEN"); @@ -129,6 +129,8 @@ if (user_key < 0) { doLogin(cp_data.person.id); model_client_perslid.REST_PUT({}, { login: new Date() }, cp_data.id); + Session("aut_client_key") = cp_data.autclient.id; + Session("aut_client_name") = cp_data.autclient.name; } } } diff --git a/APPL/PDA/iface.inc b/APPL/PDA/iface.inc index 246e086d25..b039f947e1 100644 --- a/APPL/PDA/iface.inc +++ b/APPL/PDA/iface.inc @@ -127,7 +127,7 @@ function FOOTER(params) if (params.back) {%><%=L("lcl_back")%><%}%>
<% - if (params.mswitch) + if (params.mswitch && !device.isapp()) var txt = "" + ""+L("lcl_mobile_classicmode")+"" + ""; diff --git a/APPL/Shared/Shared.inc b/APPL/Shared/Shared.inc index db7d9072cb..9d6fb69d0c 100644 --- a/APPL/Shared/Shared.inc +++ b/APPL/Shared/Shared.inc @@ -1615,6 +1615,10 @@ device = else // reset this._devicebits = this._devicebits & (~bits); Session("devicebits") = this._devicebits; + }, + isapp: function () + { + return Session("aut_client_key") > 0; } }