Remove broken window.data.scriptname (#2650)

This commit is contained in:
Maxime Besson 2022-06-25 11:13:03 +02:00
parent 1986f730a7
commit bc588c8b33
5 changed files with 12 additions and 28 deletions

View File

@ -116,7 +116,7 @@ setKey = (key,val,success,error) ->
# First request to get token
$.ajax
type: "GET"
url: datas['scriptname'] + '/mysession/?gettoken'
url: scriptname + 'mysession/?gettoken'
dataType: 'json'
error: error
# On success, value is set
@ -126,7 +126,7 @@ setKey = (key,val,success,error) ->
d[key] = val
$.ajax
type: "PUT"
url: datas['scriptname'] + '/mysession/persistent'
url: scriptname + 'mysession/persistent'
dataType: 'json'
data: d
success: success
@ -135,14 +135,14 @@ setKey = (key,val,success,error) ->
delKey = (key,sub,success,error) ->
$.ajax
type: "GET"
url: datas['scriptname'] + '/mysession/?gettoken'
url: scriptname + 'mysession/?gettoken'
dataType: 'json'
error: error
# On success, value is set
success: (data) ->
$.ajax
type: "DELETE"
url: "#{datas['scriptname']}/mysession/persistent/#{key}?sub=#{sub}&token=#{data.token}"
url: "#{scriptname}mysession/persistent/#{key}?sub=#{sub}&token=#{data.token}"
dataType: 'json'
success: success
error: error
@ -199,7 +199,7 @@ isHiddenFormValueSet = (option) ->
ping = ->
$.ajax
type: "POST"
url: datas['scriptname']
url: scriptname
data:
ping: 1
dataType: 'json'
@ -229,21 +229,6 @@ setCookie = (name, value, samesite, exdays) ->
d.setTime d.getTime() + exdays*86400000
document.cookie = "#{name}=#{value}; expires=#{d.toUTCString()}; path=/; SameSite=#{samesite}"
# Function to change password using Ajax (instead of POST)
# NOT USED FOR NOW
#changePwd = (event) ->
# event.preventDefault()
# $.ajax
# type: 'POST'
# url: datas['scriptname']
# dataType: 'json'
# data:
# oldpassword: $('#oldpassword').val()
# newpassword: $('#newpassword').val()
# confirmpassword: $('#confirmpassword').val()
# success: (data) ->
# console.log "R", data
# Initialization
datas = {}

View File

@ -135,7 +135,7 @@ LemonLDAP::NG Portal jQuery scripts
setKey = function(key, val, success, error) {
return $.ajax({
type: "GET",
url: datas['scriptname'] + '/mysession/?gettoken',
url: scriptname + 'mysession/?gettoken',
dataType: 'json',
error: error,
success: function(data) {
@ -146,7 +146,7 @@ LemonLDAP::NG Portal jQuery scripts
d[key] = val;
return $.ajax({
type: "PUT",
url: datas['scriptname'] + '/mysession/persistent',
url: scriptname + 'mysession/persistent',
dataType: 'json',
data: d,
success: success,
@ -159,13 +159,13 @@ LemonLDAP::NG Portal jQuery scripts
delKey = function(key, sub, success, error) {
return $.ajax({
type: "GET",
url: datas['scriptname'] + '/mysession/?gettoken',
url: scriptname + 'mysession/?gettoken',
dataType: 'json',
error: error,
success: function(data) {
return $.ajax({
type: "DELETE",
url: datas['scriptname'] + "/mysession/persistent/" + key + "?sub=" + sub + "&token=" + data.token,
url: scriptname + "mysession/persistent/" + key + "?sub=" + sub + "&token=" + data.token,
dataType: 'json',
success: success,
error: error
@ -207,7 +207,7 @@ LemonLDAP::NG Portal jQuery scripts
ping = function() {
return $.ajax({
type: "POST",
url: datas['scriptname'],
url: scriptname,
data: {
ping: 1
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -23,7 +23,6 @@
"login":"<TMPL_VAR NAME="LOGIN">",
"newwindow":<TMPL_VAR NAME="NEWWINDOW" DEFAULT="0">,
"appslistorder":"<TMPL_VAR NAME="APPSLIST_ORDER">",
"scriptname":"<TMPL_VAR NAME="SCRIPT_NAME">",
"activeTimer":<TMPL_VAR NAME="ACTIVE_TIMER" DEFAULT="0">,
"pingInterval":<TMPL_VAR NAME="PING" DEFAULT="0">,
"trOver":<TMPL_VAR NAME="TROVER" DEFAULT="[]">,<TMPL_IF NAME="DISPLAY_PPOLICY">