fixed issue that caused some custom code not to export for a JCB packages if found in anther custom code area. Made some corrections to the router helper class. Added return_here value admin views to improve the return values in url redirection. Improved the open valid base64 method to make use of default string. Update many ajax calls to not use jsonp, and infact be more secure.

This commit is contained in:
2018-12-29 16:56:06 +02:00
parent 17ba6c4a89
commit b7a5cb7285
59 changed files with 245 additions and 127 deletions

View File

@ -1330,16 +1330,16 @@ function checkAliasField() {
}
function checkAliasField_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.checkAliasField&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.checkAliasField&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
var request = 'token='+token+'&type=' + type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -1354,16 +1354,16 @@ function getAjaxDisplay(type){
}
function getAjaxDisplay_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && type.length > 0){
var request = 'token='+token+'&type=' + type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -1372,16 +1372,16 @@ function addData(result,where){
}
function addButtonID_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&raw=true&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0 && size > 0){
var request = 'token='+token+'&type='+type+'&size='+size;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function addButtonID(type, where, size){
@ -1397,16 +1397,16 @@ function addButtonID(type, where, size){
}
function addButton_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
var request = 'token='+token+'&type='+type+'&size='+size;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function addButton(type, where, size){
@ -1424,16 +1424,16 @@ function addButton(type, where, size){
}
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
var request = 'token='+token+'&type='+type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -1446,16 +1446,16 @@ function getLinked(){
}
function getTableColumns_server(tableName){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && tableName.length > 0){
var request = 'token='+token+'&table='+tableName;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -1477,16 +1477,16 @@ function getTableColumns(fieldKey, table_, nr_){
}
function getDynamicScripts_server(typpe){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicScripts&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicScripts&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && typpe.length > 0){
var request = 'token='+token+'&type='+typpe;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}

View File

@ -443,16 +443,16 @@ jQuery(document).ready(function()
});
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
var request = 'token='+token+'&type='+type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -610,16 +610,16 @@ jQuery(document).ready(function($)
});
function getSnippets_server(libraries){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&format=json";
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&raw=true&format=json";
if(token.length > 0 && libraries.length > 0){
var request = 'token='+token+'&libraries='+JSON.stringify(libraries);
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function getSnippets(){

View File

@ -1485,16 +1485,16 @@ jQuery(document).ready(function()
});
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
var request = 'token='+token+'&type='+type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -1508,7 +1508,7 @@ function getLinked(){
function getViewTableColumns_server(viewId,asKey,rowType)
{
var getUrl = "index.php?option=com_componentbuilder&task=ajax.viewTableColumns&format=json";
var getUrl = "index.php?option=com_componentbuilder&task=ajax.viewTableColumns&format=json&raw=true";
if (token.length > 0 && viewId > 0 && asKey.length > 0)
{
var request = 'token='+token+'&as='+asKey+'&type='+rowType+'&id='+viewId;
@ -1516,9 +1516,9 @@ function getViewTableColumns_server(viewId,asKey,rowType)
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -1538,7 +1538,7 @@ function getViewTableColumns(id,asKey,key,rowType,main, table_, nr_)
function getDbTableColumns_server(name,asKey,rowType)
{
var getUrl = "index.php?option=com_componentbuilder&task=ajax.dbTableColumns&format=json";
var getUrl = "index.php?option=com_componentbuilder&task=ajax.dbTableColumns&format=json&raw=true";
if (token.length > 0 && name.length > 0 && asKey.length > 0)
{
var request = 'token='+token+'&as='+asKey+'&type='+rowType+'&name='+name;
@ -1546,9 +1546,9 @@ function getDbTableColumns_server(name,asKey,rowType)
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -1628,16 +1628,16 @@ function updateSubItems(fieldName, fieldNr, table_, nr_){
}
function getDynamicScripts_server(typpe){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicScripts&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicScripts&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && typpe.length > 0){
var request = 'token='+token+'&type='+typpe;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}

View File

@ -522,16 +522,16 @@ jQuery(document).ready(function()
});
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
var request = 'token='+token+'&type='+type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -544,16 +544,16 @@ function getLinked(){
}
function addButton_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
var request = 'token='+token+'&type='+type+'&size='+size;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function addButton(type, where, size){
@ -574,16 +574,16 @@ function addButton(type, where, size){
var rowIdKey = 'properties';
function getFieldOptions_server(fieldtype){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && fieldtype > 0){
var request = 'token='+token+'&id='+fieldtype;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -734,31 +734,31 @@ function propertyIsSet(prop, id, targetForm) {
}
function getFieldPropertyDesc_server(fieldtype, property){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getFieldPropertyDesc&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getFieldPropertyDesc&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && (fieldtype > 0 || fieldtype.length > 0)&& property.length > 0){
var request = 'token='+token+'&fieldtype='+fieldtype+'&property='+property;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function getValidationRulesTable_server(){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getValidationRulesTable&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getValidationRulesTable&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0){
var request = 'token='+token+'&id=1';
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}

View File

@ -979,16 +979,16 @@ function getAjaxDisplay(type){
}
function getAjaxDisplay_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && type.length > 0){
var request = 'token='+token+'&type=' + type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -1012,16 +1012,16 @@ function dasboardSwitch(value){
function addButtonID_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&raw=true&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0 && size > 0){
var request = 'token='+token+'&type='+type+'&size='+size;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function addButtonID(type, where, size){
@ -1037,16 +1037,16 @@ function addButtonID(type, where, size){
}
function addButton_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
var request = 'token='+token+'&type='+type+'&size='+size;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function addButton(type, where, size){
@ -1061,5 +1061,4 @@ function addButton(type, where, size){
}
}
})
}
}

View File

@ -21,16 +21,16 @@ function addData(result,where){
}
function addButton_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
var request = 'token='+token+'&type='+type+'&size='+size;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function addButton(type, where, size){

View File

@ -208,16 +208,16 @@ jQuery(document).ready(function($)
});
function getSnippets_server(libraries){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&format=json";
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&raw=true&format=json";
if(token.length > 0 && libraries.length > 0){
var request = 'token='+token+'&libraries='+JSON.stringify(libraries);
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function getSnippets(){

View File

@ -417,16 +417,16 @@ function addData(result,where){
}
function addButtonID_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&raw=true&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0 && size > 0){
var request = 'token='+token+'&type='+type+'&size='+size;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function addButtonID(type, where, size){
@ -442,16 +442,16 @@ function addButtonID(type, where, size){
}
function addButton_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
var request = 'token='+token+'&type='+type+'&size='+size;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function addButton(type, where, size){
@ -469,16 +469,16 @@ function addButton(type, where, size){
}
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
var request = 'token='+token+'&type='+type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -501,30 +501,30 @@ function getAjaxDisplay(type){
}
function getAjaxDisplay_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&raw=true&vdm="+vastDevMod;
if (token.length > 0 && type.length > 0) {
var request = 'token='+token+'&type=' + type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function getFieldSelectOptions_server(fieldId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json";
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json&raw=true";
if (token.length > 0 && fieldId > 0) {
var request = 'token='+token+'&id='+fieldId;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}

View File

@ -484,16 +484,16 @@ jQuery(document).ready(function()
});
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
var request = 'token='+token+'&type='+type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
@ -651,16 +651,16 @@ jQuery(document).ready(function($)
});
function getSnippets_server(libraries){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&format=json";
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&raw=true&format=json";
if(token.length > 0 && libraries.length > 0){
var request = 'token='+token+'&libraries='+JSON.stringify(libraries);
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function getSnippets(){

View File

@ -234,16 +234,16 @@ jQuery(document).ready(function($)
});
function getSnippets_server(libraries){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&format=json";
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&raw=true&format=json";
if(token.length > 0 && libraries.length > 0){
var request = 'token='+token+'&libraries='+JSON.stringify(libraries);
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}
function getSnippets(){