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

@ -37,6 +37,8 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_view');
$this->canEdit = $this->canDo->get('admin_view.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewAdmins_custom_tabs extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_custom_tabs');
$this->canEdit = $this->canDo->get('admin_custom_tabs.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields');
$this->canEdit = $this->canDo->get('admin_fields.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
$this->canEdit = $this->canDo->get('admin_fields_conditions.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewAdmins_fields_relations extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations');
$this->canEdit = $this->canDo->get('admin_fields_relations.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
$this->canEdit = $this->canDo->get('component_admin_views.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_config extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_config');
$this->canEdit = $this->canDo->get('component_config.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
$this->canEdit = $this->canDo->get('component_custom_admin_menus.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
$this->canEdit = $this->canDo->get('component_custom_admin_views.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
$this->canEdit = $this->canDo->get('component_dashboard.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
$this->canEdit = $this->canDo->get('component_files_folders.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
$this->canEdit = $this->canDo->get('component_mysql_tweaks.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_site_views');
$this->canEdit = $this->canDo->get('component_site_views.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_updates');
$this->canEdit = $this->canDo->get('component_updates.edit');

View File

@ -97,7 +97,7 @@ $edit = "index.php?option=com_componentbuilder&view=custom_admin_views&task=cust
<td class="nowrap">
<div class="name">
<?php if ($this->user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->main_get)): ?>
<a href="index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id=<?php echo $item->main_get; ?>&ref=custom_admin_views"><?php echo $this->escape($item->main_get_name); ?></a>
<a href="index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id=<?php echo $item->main_get; ?>&return=<?php echo $this->return_here; ?>"><?php echo $this->escape($item->main_get_name); ?></a>
<?php else: ?>
<?php echo $this->escape($item->main_get_name); ?>
<?php endif; ?>

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('custom_admin_view');
$this->canEdit = $this->canDo->get('core.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('custom_code');
$this->canEdit = $this->canDo->get('custom_code.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('dynamic_get');
$this->canEdit = $this->canDo->get('dynamic_get.edit');

View File

@ -75,7 +75,7 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";
<td class="nowrap">
<div class="name">
<?php if ($this->user->authorise('fieldtype.edit', 'com_componentbuilder.fieldtype.' . (int)$item->fieldtype)): ?>
<a href="index.php?option=com_componentbuilder&view=fieldtypes&task=fieldtype.edit&id=<?php echo $item->fieldtype; ?>&ref=fields"><?php echo $this->escape($item->fieldtype_name); ?></a>
<a href="index.php?option=com_componentbuilder&view=fieldtypes&task=fieldtype.edit&id=<?php echo $item->fieldtype; ?>&return=<?php echo $this->return_here; ?>"><?php echo $this->escape($item->fieldtype_name); ?></a>
<?php else: ?>
<?php echo $this->escape($item->fieldtype_name); ?>
<?php endif; ?>

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewFields extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('field');
$this->canEdit = $this->canDo->get('field.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('fieldtype');
$this->canEdit = $this->canDo->get('fieldtype.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('help_document');
$this->canEdit = $this->canDo->get('help_document.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_component');
$this->canEdit = $this->canDo->get('joomla_component.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewLanguage_translations extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('language_translation');
$this->canEdit = $this->canDo->get('language_translation.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewLanguages extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('language');
$this->canEdit = $this->canDo->get('language.edit');

View File

@ -85,7 +85,7 @@ $edit = "index.php?option=com_componentbuilder&view=layouts&task=layout.edit";
<td class="nowrap">
<div class="name">
<?php if ($this->user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->dynamic_get)): ?>
<a href="index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id=<?php echo $item->dynamic_get; ?>&ref=layouts"><?php echo $this->escape($item->dynamic_get_name); ?></a>
<a href="index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id=<?php echo $item->dynamic_get; ?>&return=<?php echo $this->return_here; ?>"><?php echo $this->escape($item->dynamic_get_name); ?></a>
<?php else: ?>
<?php echo $this->escape($item->dynamic_get_name); ?>
<?php endif; ?>

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewLayouts extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('layout');
$this->canEdit = $this->canDo->get('core.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewLibraries extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('library');
$this->canEdit = $this->canDo->get('library.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewLibraries_config extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('library_config');
$this->canEdit = $this->canDo->get('library_config.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewLibraries_files_folders_urls extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls');
$this->canEdit = $this->canDo->get('library_files_folders_urls.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewServers extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('server');
$this->canEdit = $this->canDo->get('server.edit');

View File

@ -97,7 +97,7 @@ $edit = "index.php?option=com_componentbuilder&view=site_views&task=site_view.ed
<td class="nowrap">
<div class="name">
<?php if ($this->user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->main_get)): ?>
<a href="index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id=<?php echo $item->main_get; ?>&ref=site_views"><?php echo $this->escape($item->main_get_name); ?></a>
<a href="index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id=<?php echo $item->main_get; ?>&return=<?php echo $this->return_here; ?>"><?php echo $this->escape($item->main_get_name); ?></a>
<?php else: ?>
<?php echo $this->escape($item->main_get_name); ?>
<?php endif; ?>

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewSite_views extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('site_view');
$this->canEdit = $this->canDo->get('core.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewSnippet_types extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('snippet_type');
$this->canEdit = $this->canDo->get('snippet_type.edit');

View File

@ -84,7 +84,7 @@ $edit = "index.php?option=com_componentbuilder&view=snippets&task=snippet.edit";
<td class="nowrap">
<div class="name">
<?php if ($this->user->authorise('library.edit', 'com_componentbuilder.library.' . (int)$item->library)): ?>
<a href="index.php?option=com_componentbuilder&view=libraries&task=library.edit&id=<?php echo $item->library; ?>&ref=snippets"><?php echo $this->escape($item->library_name); ?></a>
<a href="index.php?option=com_componentbuilder&view=libraries&task=library.edit&id=<?php echo $item->library; ?>&return=<?php echo $this->return_here; ?>"><?php echo $this->escape($item->library_name); ?></a>
<?php else: ?>
<?php echo $this->escape($item->library_name); ?>
<?php endif; ?>

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewSnippets extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('snippet');
$this->canEdit = $this->canDo->get('core.edit');

View File

@ -85,7 +85,7 @@ $edit = "index.php?option=com_componentbuilder&view=templates&task=template.edit
<td class="nowrap">
<div class="name">
<?php if ($this->user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->dynamic_get)): ?>
<a href="index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id=<?php echo $item->dynamic_get; ?>&ref=templates"><?php echo $this->escape($item->dynamic_get_name); ?></a>
<a href="index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id=<?php echo $item->dynamic_get; ?>&return=<?php echo $this->return_here; ?>"><?php echo $this->escape($item->dynamic_get_name); ?></a>
<?php else: ?>
<?php echo $this->escape($item->dynamic_get_name); ?>
<?php endif; ?>

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewTemplates extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('template');
$this->canEdit = $this->canDo->get('core.edit');

View File

@ -37,6 +37,8 @@ class ComponentbuilderViewValidation_rules extends JViewLegacy
$this->listOrder = $this->escape($this->state->get('list.ordering'));
$this->listDirn = $this->escape($this->state->get('list.direction'));
$this->saveOrder = $this->listOrder == 'ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('validation_rule');
$this->canEdit = $this->canDo->get('validation_rule.edit');