Stable Release #758

Merged
Llewellyn merged 11 commits from staging into master 2021-06-15 00:03:51 +00:00
144 changed files with 9454 additions and 8327 deletions

9
.editorconfig Normal file
View File

@ -0,0 +1,9 @@
# EditorConfig is awesome: https://EditorConfig.org
# Unix-style newlines with a newline ending every file
[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

View File

@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.9) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.10) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -143,11 +143,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 10th March, 2021
+ *Version*: 2.12.9
+ *Last Build*: 14th June, 2021
+ *Version*: 2.12.10
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **292188**
+ *Line count*: **291956**
+ *Field count*: **1629**
+ *File count*: **1935**
+ *Folder count*: **322**

View File

@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.9) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.10) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -143,11 +143,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 10th March, 2021
+ *Version*: 2.12.9
+ *Last Build*: 14th June, 2021
+ *Version*: 2.12.10
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **292188**
+ *Line count*: **291956**
+ *Field count*: **1629**
+ *File count*: **1935**
+ *Folder count*: **322**

View File

@ -92,12 +92,6 @@ class ###Component###Model###View### extends JModelAdmin
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}###METHOD_GET_ITEM###
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_###component###.###view###');
}
}###LINKEDVIEWGLOBAL###
return $item;
@ -127,7 +121,7 @@ class ###Component###Model###View### extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_###component###/models/forms/###view###.js';
return 'media/com_###component###/js/###view###.js';
}
/**

View File

@ -92,12 +92,6 @@ class ###Component###Model###View### extends JModelAdmin
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}###METHOD_GET_ITEM###
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_###component###.###view###');
}
}###LINKEDVIEWGLOBAL###
return $item;
@ -127,7 +121,7 @@ class ###Component###Model###View### extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_###component###/models/forms/###view###.js';
return 'media/com_###component###/js/###view###.js';
}
/**

View File

@ -280,7 +280,7 @@
"type": "single"
},
"module_forms.js": {
"path": "c0mp0n3nt/admin/models/forms",
"path": "c0mp0n3nt/media/js",
"rename": "module_forms",
"type": "single"
},

View File

@ -51,7 +51,7 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
// set page redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_DOWNLOAD_THE_COMPILER_ANIMATIONS');
// currently only administrators can compile a component
// currently only those with permissions can get these images
if($user->authorise('compiler.compiler_animations', 'com_componentbuilder'))
{
// get the model
@ -78,8 +78,8 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// check if user has the right
$user = JFactory::getUser();
// currently only administrators can compile a component
if($user->authorise('core.admin', 'com_componentbuilder'))
// currently only those with admin access can compile a component
if($user->authorise('core.manage', 'com_componentbuilder'))
{
// get the post values
$jinput = JFactory::getApplication()->input;
@ -303,8 +303,8 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
// set page redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THESE_EXTENSIONS');
// currently only administrators can install a component via JCB
if($user->authorise('core.admin'))
// currently only those with admin access can install a component via JCB
if($user->authorise('core.manage'))
{
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_EXTENSIONS');
$_message = array('success' => array(), 'error' => array());
@ -365,8 +365,8 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
// set page redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_COMPONENT');
// currently only administrators can install a component via JCB
if($user->authorise('core.admin'))
// currently only those with admin access can install a component via JCB
if($user->authorise('core.manage'))
{
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_COMPONENT');
$app = JFactory::getApplication();
@ -403,8 +403,8 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
// set page redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_MODULE');
// currently only administrators can install a molule via JCB
if($user->authorise('core.admin'))
// currently only those with admin access can install a molule via JCB
if($user->authorise('core.manage'))
{
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_MODULE');
$app = JFactory::getApplication();
@ -446,8 +446,8 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
// set page redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_PLUGIN');
// currently only administrators can install a plugin via JCB
if($user->authorise('core.admin'))
// currently only those with admin access can install a plugin via JCB
if($user->authorise('core.manage'))
{
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_PLUGIN');
$app = JFactory::getApplication();
@ -560,7 +560,7 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
// set page redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_CLEAR_THE_TMP_FOLDER');
if($user->authorise('compiler.clear_tmp', 'com_componentbuilder') && $user->authorise('core.options', 'com_componentbuilder'))
if($user->authorise('compiler.clear_tmp', 'com_componentbuilder') && $user->authorise('core.manage', 'com_componentbuilder'))
{
// get the model
$model = $this->getModel('compiler');

View File

@ -161,7 +161,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
// set page redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false);
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_CLEAR_THE_TMP_FOLDER');
if($user->authorise('joomla_components.clear_tmp', 'com_componentbuilder') && $user->authorise('core.options', 'com_componentbuilder'))
if($user->authorise('joomla_components.clear_tmp', 'com_componentbuilder') && $user->authorise('core.manage', 'com_componentbuilder'))
{
// get the model
$model = $this->getModel('compiler');

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
/*! UIkit 3.1.2 | http://www.getuikit.com | (c) 2014 - 2018 YOOtheme | MIT License */
/*! UIkit 3.6.22 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define('uikiticons', factory) :
(global = global || self, global.UIkitIcons = factory());
}(this, function () { 'use strict';
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkitIcons = factory());
}(this, (function () { 'use strict';
function plugin(UIkit) {
@ -48,8 +48,10 @@
"credit-card": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect fill=\"none\" stroke=\"#000\" x=\"1.5\" y=\"4.5\" width=\"17\" height=\"12\"/><rect x=\"1\" y=\"7\" width=\"18\" height=\"3\"/></svg>",
"database": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><ellipse fill=\"none\" stroke=\"#000\" cx=\"10\" cy=\"4.64\" rx=\"7.5\" ry=\"3.14\"/><path fill=\"none\" stroke=\"#000\" d=\"M17.5,8.11 C17.5,9.85 14.14,11.25 10,11.25 C5.86,11.25 2.5,9.84 2.5,8.11\"/><path fill=\"none\" stroke=\"#000\" d=\"M17.5,11.25 C17.5,12.99 14.14,14.39 10,14.39 C5.86,14.39 2.5,12.98 2.5,11.25\"/><path fill=\"none\" stroke=\"#000\" d=\"M17.49,4.64 L17.5,14.36 C17.5,16.1 14.14,17.5 10,17.5 C5.86,17.5 2.5,16.09 2.5,14.36 L2.5,4.64\"/></svg>",
"desktop": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"8\" y=\"15\" width=\"1\" height=\"2\"/><rect x=\"11\" y=\"15\" width=\"1\" height=\"2\"/><rect x=\"5\" y=\"16\" width=\"10\" height=\"1\"/><rect fill=\"none\" stroke=\"#000\" x=\"1.5\" y=\"3.5\" width=\"17\" height=\"11\"/></svg>",
"discord": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><path d=\"M16.074,4.361a14.243,14.243,0,0,0-3.61-1.134,10.61,10.61,0,0,0-.463.96,13.219,13.219,0,0,0-4,0,10.138,10.138,0,0,0-.468-.96A14.206,14.206,0,0,0,3.919,4.364,15.146,15.146,0,0,0,1.324,14.5a14.435,14.435,0,0,0,4.428,2.269A10.982,10.982,0,0,0,6.7,15.21a9.294,9.294,0,0,1-1.494-.727c.125-.093.248-.19.366-.289a10.212,10.212,0,0,0,8.854,0c.119.1.242.2.366.289a9.274,9.274,0,0,1-1.5.728,10.8,10.8,0,0,0,.948,1.562,14.419,14.419,0,0,0,4.431-2.27A15.128,15.128,0,0,0,16.074,4.361Zm-8.981,8.1a1.7,1.7,0,0,1-1.573-1.79A1.689,1.689,0,0,1,7.093,8.881a1.679,1.679,0,0,1,1.573,1.791A1.687,1.687,0,0,1,7.093,12.462Zm5.814,0a1.7,1.7,0,0,1-1.573-1.79,1.689,1.689,0,0,1,1.573-1.791,1.679,1.679,0,0,1,1.573,1.791A1.688,1.688,0,0,1,12.907,12.462Z\"/></svg>",
"download": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" points=\"14,10 9.5,14.5 5,10\"/><rect x=\"3\" y=\"17\" width=\"13\" height=\"1\"/><line fill=\"none\" stroke=\"#000\" x1=\"9.5\" y1=\"13.91\" x2=\"9.5\" y2=\"3\"/></svg>",
"dribbble": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" d=\"M1.3,8.9c0,0,5,0.1,8.6-1c1.4-0.4,2.6-0.9,4-1.9 c1.4-1.1,2.5-2.5,2.5-2.5\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" d=\"M3.9,16.6c0,0,1.7-2.8,3.5-4.2 c1.8-1.3,4-2,5.7-2.2C16,10,19,10.6,19,10.6\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" d=\"M6.9,1.6c0,0,3.3,4.6,4.2,6.8 c0.4,0.9,1.3,3.1,1.9,5.2c0.6,2,0.9,4.4,0.9,4.4\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" cx=\"10\" cy=\"10\" r=\"9\"/></svg>",
"etsy": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><path d=\"M8,4.26C8,4.07,8,4,8.31,4h4.46c.79,0,1.22.67,1.53,1.91l.25,1h.76c.14-2.82.26-4,.26-4S13.65,3,12.52,3H6.81L3.75,2.92v.84l1,.2c.73.11.9.27,1,1,0,0,.06,2,.06,5.17s-.06,5.14-.06,5.14c0,.59-.23.81-1,.94l-1,.2v.84l3.06-.1h5.11c1.15,0,3.82.1,3.82.1,0-.7.45-3.88.51-4.22h-.73l-.76,1.69a2.25,2.25,0,0,1-2.45,1.47H9.4c-1,0-1.44-.4-1.44-1.24V10.44s2.16,0,2.86.06c.55,0,.85.19,1.06,1l.23,1H13L12.9,9.94,13,7.41h-.85l-.28,1.13c-.16.74-.28.84-1,1-1,.1-2.89.09-2.89.09Z\"/></svg>",
"expand": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polygon points=\"13 2 18 2 18 7 17 7 17 3 13 3\"/><polygon points=\"2 13 3 13 3 17 7 17 7 18 2 18\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M11,9 L17,3\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M3,17 L9,11\"/></svg>",
"facebook": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11,10h2.6l0.4-3H11V5.3c0-0.9,0.2-1.5,1.5-1.5H14V1.1c-0.3,0-1-0.1-2.1-0.1C9.6,1,8,2.4,8,5v2H5.5v3H8v8h3V10z\"/></svg>",
"file-edit": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"#000\" d=\"M18.65,1.68 C18.41,1.45 18.109,1.33 17.81,1.33 C17.499,1.33 17.209,1.45 16.98,1.68 L8.92,9.76 L8,12.33 L10.55,11.41 L18.651,3.34 C19.12,2.87 19.12,2.15 18.65,1.68 L18.65,1.68 L18.65,1.68 Z\"/><polyline fill=\"none\" stroke=\"#000\" points=\"16.5 8.482 16.5 18.5 3.5 18.5 3.5 1.5 14.211 1.5\"/></svg>",
@ -62,11 +64,10 @@
"foursquare": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M15.23,2 C15.96,2 16.4,2.41 16.5,2.86 C16.57,3.15 16.56,3.44 16.51,3.73 C16.46,4.04 14.86,11.72 14.75,12.03 C14.56,12.56 14.16,12.82 13.61,12.83 C13.03,12.84 11.09,12.51 10.69,13 C10.38,13.38 7.79,16.39 6.81,17.53 C6.61,17.76 6.4,17.96 6.08,17.99 C5.68,18.04 5.29,17.87 5.17,17.45 C5.12,17.28 5.1,17.09 5.1,16.91 C5.1,12.4 4.86,7.81 5.11,3.31 C5.17,2.5 5.81,2.12 6.53,2 L15.23,2 L15.23,2 Z M9.76,11.42 C9.94,11.19 10.17,11.1 10.45,11.1 L12.86,11.1 C13.12,11.1 13.31,10.94 13.36,10.69 C13.37,10.64 13.62,9.41 13.74,8.83 C13.81,8.52 13.53,8.28 13.27,8.28 C12.35,8.29 11.42,8.28 10.5,8.28 C9.84,8.28 9.83,7.69 9.82,7.21 C9.8,6.85 10.13,6.55 10.5,6.55 C11.59,6.56 12.67,6.55 13.76,6.55 C14.03,6.55 14.23,6.4 14.28,6.14 C14.34,5.87 14.67,4.29 14.67,4.29 C14.67,4.29 14.82,3.74 14.19,3.74 L7.34,3.74 C7,3.75 6.84,4.02 6.84,4.33 C6.84,7.58 6.85,14.95 6.85,14.99 C6.87,15 8.89,12.51 9.76,11.42 L9.76,11.42 Z\"/></svg>",
"future": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polyline points=\"19 2 18 2 18 6 14 6 14 7 19 7 19 2\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M18,6.548 C16.709,3.29 13.354,1 9.6,1 C4.6,1 0.6,5 0.6,10 C0.6,15 4.6,19 9.6,19 C14.6,19 18.6,15 18.6,10\"/><rect x=\"9\" y=\"4\" width=\"1\" height=\"7\"/><path d=\"M13.018,14.197 L9.445,10.625\" fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\"/></svg>",
"git-branch": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"7\" cy=\"3\" r=\"2\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"14\" cy=\"6\" r=\"2\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"7\" cy=\"17\" r=\"2\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"2\" d=\"M14,8 C14,10.41 12.43,10.87 10.56,11.25 C9.09,11.54 7,12.06 7,15 L7,5\"/></svg>",
"git-fork": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"5.79\" cy=\"2.79\" r=\"1.79\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"14.19\" cy=\"2.79\" r=\"1.79\"/><ellipse fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"10.03\" cy=\"16.79\" rx=\"1.79\" ry=\"1.79\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"2\" d=\"M5.79,4.57 L5.79,6.56 C5.79,9.19 10.03,10.22 10.03,13.31 C10.03,14.86 10.04,14.55 10.04,14.55 C10.04,14.37 10.04,14.86 10.04,13.31 C10.04,10.22 14.2,9.19 14.2,6.56 L14.2,4.57\"/></svg>",
"git-fork": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"5.79\" cy=\"2.79\" r=\"1.79\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"14.19\" cy=\"2.79\" r=\"1.79\"/><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" cx=\"10.03\" cy=\"16.79\" r=\"1.79\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"2\" d=\"M5.79,4.57 L5.79,6.56 C5.79,9.19 10.03,10.22 10.03,13.31 C10.03,14.86 10.04,14.55 10.04,14.55 C10.04,14.37 10.04,14.86 10.04,13.31 C10.04,10.22 14.2,9.19 14.2,6.56 L14.2,4.57\"/></svg>",
"github-alt": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10,0.5 C4.75,0.5 0.5,4.76 0.5,10.01 C0.5,15.26 4.75,19.51 10,19.51 C15.24,19.51 19.5,15.26 19.5,10.01 C19.5,4.76 15.25,0.5 10,0.5 L10,0.5 Z M12.81,17.69 C12.81,17.69 12.81,17.7 12.79,17.69 C12.47,17.75 12.35,17.59 12.35,17.36 L12.35,16.17 C12.35,15.45 12.09,14.92 11.58,14.56 C12.2,14.51 12.77,14.39 13.26,14.21 C13.87,13.98 14.36,13.69 14.74,13.29 C15.42,12.59 15.76,11.55 15.76,10.17 C15.76,9.25 15.45,8.46 14.83,7.8 C15.1,7.08 15.07,6.29 14.75,5.44 L14.51,5.42 C14.34,5.4 14.06,5.46 13.67,5.61 C13.25,5.78 12.79,6.03 12.31,6.35 C11.55,6.16 10.81,6.05 10.09,6.05 C9.36,6.05 8.61,6.15 7.88,6.35 C7.28,5.96 6.75,5.68 6.26,5.54 C6.07,5.47 5.9,5.44 5.78,5.44 L5.42,5.44 C5.06,6.29 5.04,7.08 5.32,7.8 C4.7,8.46 4.4,9.25 4.4,10.17 C4.4,11.94 4.96,13.16 6.08,13.84 C6.53,14.13 7.05,14.32 7.69,14.43 C8.03,14.5 8.32,14.54 8.55,14.55 C8.07,14.89 7.82,15.42 7.82,16.16 L7.82,17.51 C7.8,17.69 7.7,17.8 7.51,17.8 C4.21,16.74 1.82,13.65 1.82,10.01 C1.82,5.5 5.49,1.83 10,1.83 C14.5,1.83 18.17,5.5 18.17,10.01 C18.18,13.53 15.94,16.54 12.81,17.69 L12.81,17.69 Z\"/></svg>",
"github": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10,1 C5.03,1 1,5.03 1,10 C1,13.98 3.58,17.35 7.16,18.54 C7.61,18.62 7.77,18.34 7.77,18.11 C7.77,17.9 7.76,17.33 7.76,16.58 C5.26,17.12 4.73,15.37 4.73,15.37 C4.32,14.33 3.73,14.05 3.73,14.05 C2.91,13.5 3.79,13.5 3.79,13.5 C4.69,13.56 5.17,14.43 5.17,14.43 C5.97,15.8 7.28,15.41 7.79,15.18 C7.87,14.6 8.1,14.2 8.36,13.98 C6.36,13.75 4.26,12.98 4.26,9.53 C4.26,8.55 4.61,7.74 5.19,7.11 C5.1,6.88 4.79,5.97 5.28,4.73 C5.28,4.73 6.04,4.49 7.75,5.65 C8.47,5.45 9.24,5.35 10,5.35 C10.76,5.35 11.53,5.45 12.25,5.65 C13.97,4.48 14.72,4.73 14.72,4.73 C15.21,5.97 14.9,6.88 14.81,7.11 C15.39,7.74 15.73,8.54 15.73,9.53 C15.73,12.99 13.63,13.75 11.62,13.97 C11.94,14.25 12.23,14.8 12.23,15.64 C12.23,16.84 12.22,17.81 12.22,18.11 C12.22,18.35 12.38,18.63 12.84,18.54 C16.42,17.35 19,13.98 19,10 C19,5.03 14.97,1 10,1 L10,1 Z\"/></svg>",
"gitter": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"3.5\" y=\"1\" width=\"1.531\" height=\"11.471\"/><rect x=\"7.324\" y=\"4.059\" width=\"1.529\" height=\"15.294\"/><rect x=\"11.148\" y=\"4.059\" width=\"1.527\" height=\"15.294\"/><rect x=\"14.971\" y=\"4.059\" width=\"1.529\" height=\"8.412\"/></svg>",
"google-plus": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.9,9c0,2.7-0.6,5-3.2,6.3c-3.7,1.8-8.1,0.2-9.4-3.6C-1.1,7.6,1.9,3.3,6.1,3c1.7-0.1,3.2,0.3,4.6,1.3 c0.1,0.1,0.3,0.2,0.4,0.4c-0.5,0.5-1.2,1-1.7,1.6c-1-0.8-2.1-1.1-3.5-0.9C5,5.6,4.2,6,3.6,6.7c-1.3,1.3-1.5,3.4-0.5,5 c1,1.7,2.6,2.3,4.6,1.9c1.4-0.3,2.4-1.2,2.6-2.6H6.9V9H12.9z\"/><polygon points=\"20,9 20,11 18,11 18,13 16,13 16,11 14,11 14,9 16,9 16,7 18,7 18,9\"/></svg>",
"google": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.86,9.09 C18.46,12.12 17.14,16.05 13.81,17.56 C9.45,19.53 4.13,17.68 2.47,12.87 C0.68,7.68 4.22,2.42 9.5,2.03 C11.57,1.88 13.42,2.37 15.05,3.65 C15.22,3.78 15.37,3.93 15.61,4.14 C14.9,4.81 14.23,5.45 13.5,6.14 C12.27,5.08 10.84,4.72 9.28,4.98 C8.12,5.17 7.16,5.76 6.37,6.63 C4.88,8.27 4.62,10.86 5.76,12.82 C6.95,14.87 9.17,15.8 11.57,15.25 C13.27,14.87 14.76,13.33 14.89,11.75 L10.51,11.75 L10.51,9.09 L17.86,9.09 L17.86,9.09 Z\"/></svg>",
"grid": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"2\" y=\"2\" width=\"3\" height=\"3\"/><rect x=\"8\" y=\"2\" width=\"3\" height=\"3\"/><rect x=\"14\" y=\"2\" width=\"3\" height=\"3\"/><rect x=\"2\" y=\"8\" width=\"3\" height=\"3\"/><rect x=\"8\" y=\"8\" width=\"3\" height=\"3\"/><rect x=\"14\" y=\"8\" width=\"3\" height=\"3\"/><rect x=\"2\" y=\"14\" width=\"3\" height=\"3\"/><rect x=\"8\" y=\"14\" width=\"3\" height=\"3\"/><rect x=\"14\" y=\"14\" width=\"3\" height=\"3\"/></svg>",
"happy": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"13\" cy=\"7\" r=\"1\"/><circle cx=\"7\" cy=\"7\" r=\"1\"/><circle fill=\"none\" stroke=\"#000\" cx=\"10\" cy=\"10\" r=\"8.5\"/><path fill=\"none\" stroke=\"#000\" d=\"M14.6,11.4 C13.9,13.3 12.1,14.5 10,14.5 C7.9,14.5 6.1,13.3 5.4,11.4\"/></svg>",
@ -130,6 +131,7 @@
"tablet": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"#000\" d=\"M5,18.5 C4.2,18.5 3.5,17.8 3.5,17 L3.5,3 C3.5,2.2 4.2,1.5 5,1.5 L16,1.5 C16.8,1.5 17.5,2.2 17.5,3 L17.5,17 C17.5,17.8 16.8,18.5 16,18.5 L5,18.5 L5,18.5 L5,18.5 Z\"/><circle cx=\"10.5\" cy=\"16.3\" r=\".8\"/></svg>",
"tag": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M17.5,3.71 L17.5,7.72 C17.5,7.96 17.4,8.2 17.21,8.39 L8.39,17.2 C7.99,17.6 7.33,17.6 6.93,17.2 L2.8,13.07 C2.4,12.67 2.4,12.01 2.8,11.61 L11.61,2.8 C11.81,2.6 12.08,2.5 12.34,2.5 L16.19,2.5 C16.52,2.5 16.86,2.63 17.11,2.88 C17.35,3.11 17.48,3.4 17.5,3.71 L17.5,3.71 Z\"/><circle cx=\"14\" cy=\"6\" r=\"1\"/></svg>",
"thumbnails": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect fill=\"none\" stroke=\"#000\" x=\"3.5\" y=\"3.5\" width=\"5\" height=\"5\"/><rect fill=\"none\" stroke=\"#000\" x=\"11.5\" y=\"3.5\" width=\"5\" height=\"5\"/><rect fill=\"none\" stroke=\"#000\" x=\"11.5\" y=\"11.5\" width=\"5\" height=\"5\"/><rect fill=\"none\" stroke=\"#000\" x=\"3.5\" y=\"11.5\" width=\"5\" height=\"5\"/></svg>",
"tiktok": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.24,6V8.82a6.79,6.79,0,0,1-4-1.28v5.81A5.26,5.26,0,1,1,8,8.1a4.36,4.36,0,0,1,.72.05v2.9A2.57,2.57,0,0,0,7.64,11a2.4,2.4,0,1,0,2.77,2.38V2h2.86a4,4,0,0,0,1.84,3.38A4,4,0,0,0,17.24,6Z\"/></svg>",
"trash": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" points=\"6.5 3 6.5 1.5 13.5 1.5 13.5 3\"/><polyline fill=\"none\" stroke=\"#000\" points=\"4.5 4 4.5 18.5 15.5 18.5 15.5 4\"/><rect x=\"8\" y=\"7\" width=\"1\" height=\"9\"/><rect x=\"11\" y=\"7\" width=\"1\" height=\"9\"/><rect x=\"2\" y=\"3\" width=\"16\" height=\"1\"/></svg>",
"triangle-down": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polygon points=\"5 7 15 7 10 12\"/></svg>",
"triangle-left": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polygon points=\"12 5 7 10 12 15\"/></svg>",
@ -138,6 +140,7 @@
"tripadvisor": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19.021,7.866C19.256,6.862,20,5.854,20,5.854h-3.346C14.781,4.641,12.504,4,9.98,4C7.363,4,4.999,4.651,3.135,5.876H0\tc0,0,0.738,0.987,0.976,1.988c-0.611,0.837-0.973,1.852-0.973,2.964c0,2.763,2.249,5.009,5.011,5.009\tc1.576,0,2.976-0.737,3.901-1.879l1.063,1.599l1.075-1.615c0.475,0.611,1.1,1.111,1.838,1.451c1.213,0.547,2.574,0.612,3.825,0.15\tc2.589-0.963,3.913-3.852,2.964-6.439c-0.175-0.463-0.4-0.876-0.675-1.238H19.021z M16.38,14.594\tc-1.002,0.371-2.088,0.328-3.06-0.119c-0.688-0.317-1.252-0.817-1.657-1.438c-0.164-0.25-0.313-0.52-0.417-0.811\tc-0.124-0.328-0.186-0.668-0.217-1.014c-0.063-0.689,0.037-1.396,0.339-2.043c0.448-0.971,1.251-1.71,2.25-2.079\tc2.075-0.765,4.375,0.3,5.14,2.366c0.762,2.066-0.301,4.37-2.363,5.134L16.38,14.594L16.38,14.594z M8.322,13.066\tc-0.72,1.059-1.935,1.76-3.309,1.76c-2.207,0-4.001-1.797-4.001-3.996c0-2.203,1.795-4.002,4.001-4.002\tc2.204,0,3.999,1.8,3.999,4.002c0,0.137-0.024,0.261-0.04,0.396c-0.067,0.678-0.284,1.313-0.648,1.853v-0.013H8.322z M2.472,10.775\tc0,1.367,1.112,2.479,2.476,2.479c1.363,0,2.472-1.11,2.472-2.479c0-1.359-1.11-2.468-2.472-2.468\tC3.584,8.306,2.473,9.416,2.472,10.775L2.472,10.775z M12.514,10.775c0,1.367,1.104,2.479,2.471,2.479\tc1.363,0,2.474-1.108,2.474-2.479c0-1.359-1.11-2.468-2.474-2.468c-1.364,0-2.477,1.109-2.477,2.468H12.514z M3.324,10.775\tc0-0.893,0.726-1.618,1.614-1.618c0.889,0,1.625,0.727,1.625,1.618c0,0.898-0.725,1.627-1.625,1.627\tc-0.901,0-1.625-0.729-1.625-1.627H3.324z M13.354,10.775c0-0.893,0.726-1.618,1.627-1.618c0.886,0,1.61,0.727,1.61,1.618\tc0,0.898-0.726,1.627-1.626,1.627s-1.625-0.729-1.625-1.627H13.354z M9.977,4.875c1.798,0,3.425,0.324,4.849,0.968\tc-0.535,0.015-1.061,0.108-1.586,0.3c-1.264,0.463-2.264,1.388-2.815,2.604c-0.262,0.551-0.398,1.133-0.448,1.72\tC9.79,7.905,7.677,5.873,5.076,5.82C6.501,5.208,8.153,4.875,9.94,4.875H9.977z\"/></svg>",
"tumblr": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.885,8.598c0,0,0,3.393,0,4.996c0,0.282,0,0.66,0.094,0.942c0.377,1.509,1.131,2.545,2.545,3.11 c1.319,0.472,2.356,0.472,3.676,0c0.565-0.188,1.132-0.659,1.132-0.659l-0.849-2.263c0,0-1.036,0.378-1.603,0.283 c-0.565-0.094-1.226-0.66-1.226-1.508c0-1.603,0-4.902,0-4.902h2.828V5.771h-2.828V2H8.205c0,0-0.094,0.66-0.188,0.942 C7.828,3.791,7.262,4.733,6.603,5.394C5.848,6.147,5,6.43,5,6.43v2.168H6.885z\"/></svg>",
"tv": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"7\" y=\"16\" width=\"6\" height=\"1\"/><rect fill=\"none\" stroke=\"#000\" x=\".5\" y=\"3.5\" width=\"19\" height=\"11\"/></svg>",
"twitch": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.23,1,2,4.23V15.85H5.88v3.23L9.1,15.85h2.59L17.5,10V1Zm11,8.4L13.62,12H11L8.78,14.24V12H5.88V2.29H16.21Z\"/><rect x=\"12.98\" y=\"4.55\" width=\"1.29\" height=\"3.88\"/><rect x=\"9.43\" y=\"4.55\" width=\"1.29\" height=\"3.88\"/></svg>",
"twitter": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19,4.74 C18.339,5.029 17.626,5.229 16.881,5.32 C17.644,4.86 18.227,4.139 18.503,3.28 C17.79,3.7 17.001,4.009 16.159,4.17 C15.485,3.45 14.526,3 13.464,3 C11.423,3 9.771,4.66 9.771,6.7 C9.771,6.99 9.804,7.269 9.868,7.539 C6.795,7.38 4.076,5.919 2.254,3.679 C1.936,4.219 1.754,4.86 1.754,5.539 C1.754,6.82 2.405,7.95 3.397,8.61 C2.79,8.589 2.22,8.429 1.723,8.149 L1.723,8.189 C1.723,9.978 2.997,11.478 4.686,11.82 C4.376,11.899 4.049,11.939 3.713,11.939 C3.475,11.939 3.245,11.919 3.018,11.88 C3.49,13.349 4.852,14.419 6.469,14.449 C5.205,15.429 3.612,16.019 1.882,16.019 C1.583,16.019 1.29,16.009 1,15.969 C2.635,17.019 4.576,17.629 6.662,17.629 C13.454,17.629 17.17,12 17.17,7.129 C17.17,6.969 17.166,6.809 17.157,6.649 C17.879,6.129 18.504,5.478 19,4.74\"/></svg>",
"uikit": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><polygon points=\"14.4,3.1 11.3,5.1 15,7.3 15,12.9 10,15.7 5,12.9 5,8.5 2,6.8 2,14.8 9.9,19.5 18,14.8 18,5.3\"/><polygon points=\"9.8,4.2 6.7,2.4 9.8,0.4 12.9,2.3\"/></svg>",
"unlock": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect fill=\"none\" stroke=\"#000\" x=\"3.5\" y=\"8.5\" width=\"13\" height=\"10\"/><path fill=\"none\" stroke=\"#000\" d=\"M6.5,8.5 L6.5,4.9 C6.5,3 8.1,1.5 10,1.5 C11.9,1.5 13.5,3 13.5,4.9\"/></svg>",
@ -163,4 +166,4 @@
return plugin;
}));
})));

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -2099,12 +2099,12 @@ class Structure extends Get
// set message that this was done (will still add a tutorial link later)
$this->app->enqueueMessage(
JText::_(
'<hr /><h3>Dynamic folder/s were detected.</h3>'
'<hr /><h3>Dynamic folder(s) were detected.</h3>'
), 'Notice'
);
$this->app->enqueueMessage(
JText::sprintf(
'A method (setDynamicF0ld3rs) was added to the install <b>script.php</b> of this package to insure that the folder/s are copied into the correct place when this componet is installed!'
'A method (setDynamicF0ld3rs) was added to the install <b>script.php</b> of this package to insure that the folder(s) are copied into the correct place when this component is installed!'
), 'Notice'
);
}

View File

@ -4578,6 +4578,12 @@ class Fields extends Structure
$nameListCode, $name, $view, $field, $typeName, $multiple,
$custom = false, $options = false
) {
// check if this is a tag field
if ($typeName === 'tag')
{
// set tags for this view but don't load to DB
$this->tagsBuilder[$nameSingleCode] = $nameSingleCode;
}
// dbSwitch
$dbSwitch = true;
if (isset($field['list']) && $field['list'] == 2)
@ -4585,11 +4591,6 @@ class Fields extends Structure
// do not add this field to the database
$dbSwitch = false;
}
elseif ($typeName === 'tag')
{
// set tags for this view but don't load to DB
$this->tagsBuilder[$nameSingleCode] = $nameSingleCode;
}
elseif (isset($field['settings']->datatype))
{
// insure default not none if number type
@ -6135,7 +6136,7 @@ class Fields extends Structure
{
$fieldData['component'] = $local_component;
}
// check that the componet has the com_ value in it
// check that the component has the com_ value in it
if (strpos($fieldData['component'], 'com_') === false
|| strpos(
$fieldData['component'], '='

View File

@ -1567,7 +1567,8 @@ class Interpretation extends Fields
if ($this->addEximport)
{
// we use the company name set in the GUI
$company_name = $this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh];
$company_name = $this->fileContentStatic[$this->hhh . 'COMPANYNAME'
. $this->hhh];
// start building the xml function
$exel = array();
$exel[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**";
@ -5786,10 +5787,20 @@ class Interpretation extends Fields
{
// just to check if the submission script is manually added
if (!isset($view['settings']->php_document)
|| strpos(
implode(' ', $view['settings']->php_document),
'/submitbutton.js'
) === false)
|| (ComponentbuilderHelper::checkArray(
$view['settings']->php_document
)
&& strpos(
implode(' ', $view['settings']->php_document),
'/submitbutton.js'
) === false)
|| (ComponentbuilderHelper::checkString(
$view['settings']->php_document
)
&& strpos(
$view['settings']->php_document,
'/submitbutton.js'
) === false))
{
// set the custom get form method JAVASCRIPT_FOR_BUTTONS
$this->fileContentDynamic[$view['settings']->code][$this->hhh
@ -7288,6 +7299,8 @@ class Interpretation extends Fields
// get the component name
$Component = $this->fileContentStatic[$this->hhh . 'Component'
. $this->hhh];
$component = $this->fileContentStatic[$this->hhh . 'component'
. $this->hhh];
// go from base64 to string
if (isset($this->base64Builder[$view])
&& ComponentbuilderHelper::checkArray($this->base64Builder[$view]))
@ -7442,7 +7455,21 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(3) . "}";
}
}
// add the tag get options
if (isset($this->tagsBuilder[$view]))
{
$script .= PHP_EOL . PHP_EOL . $this->_t(3)
. "if (!empty(\$item->id))";
$script .= PHP_EOL . $this->_t(3) . "{";
$script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(
__LINE__
) . " Get Tag IDs.";
$script .= PHP_EOL . $this->_t(4) . "\$item->tags"
. " = new JHelperTags;";
$script .= PHP_EOL . $this->_t(4)
. "\$item->tags->getTagIds(\$item->id, 'com_$component.$view');";
$script .= PHP_EOL . $this->_t(3) . "}";
}
// add custom php to getitem method
$script .= $this->getCustomScriptBuilder(
'php_getitem', $view, PHP_EOL . PHP_EOL
@ -21694,6 +21721,41 @@ class Interpretation extends Fields
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"
. PHP_EOL;
}
// add the tags if needed
if (isset($this->tagsBuilder[$nameSingleCode]))
{
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//"
. $this->setLine(
__LINE__
) . " Add the tags";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3)
. "\$item->tags = new JHelperTags;";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3)
. "\$item->tags->getTagIds(";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4)
. "\$item->id, 'com_"
. $this->fileContentStatic[$this->hhh . 'component'
. $this->hhh] . ".$nameSingleCode'";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . ");";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3)
. "if (\$item->tags->tags)";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4)
. "\$item->tags = implode(', ',";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5)
. "\$item->tags->getTagNames(";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6)
. "explode(',', \$item->tags->tags)";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . ")";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . ");";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3)
. "else";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4)
. "\$item->tags = '';";
$fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}";
}
// get the correct array
if ($export || $all)
{

View File

@ -1116,7 +1116,7 @@ abstract class ComponentbuilderHelper
{
// we must first store the current woking directory
$joomla = getcwd();
// we are changing the working directory to the componet path
// we are changing the working directory to the component path
chdir($folder);
// make sure we have file type filter
if (self::checkArray($fileTypes))

View File

@ -863,12 +863,14 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_HINT="Name Here"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_LABEL="Name"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_LIST_DESCRIPTION="The name of the list of records in this view"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_LIST_HINT="List of Records Name Here"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_LIST_LABEL="Name (list of records)"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_LIST_LABEL="Name (list of records)<br />
<small><a href=&quot;https://docs.joomla.org/J3.x:File_Structure_and_Naming_Conventions&quot; target=&quot;_blank&quot;>Naming Conventions</a></small>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_LIST_MESSAGE="Error! Please add list of records name here."
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_MESSAGE="Error! Please add name here."
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_DESCRIPTION="Type null if single record view is not to be set"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_HINT="Single Record Name Here"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_LABEL="Name (single record)"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_LABEL="Name (single record)<br />
<small><a href=&quot;https://docs.joomla.org/J3.x:File_Structure_and_Naming_Conventions&quot; target=&quot;_blank&quot;>Naming Conventions</a></small>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_MESSAGE="Error! Please add single record name here."
COM_COMPONENTBUILDER_ADMIN_VIEW_NEW="A New Admin View"
COM_COMPONENTBUILDER_ADMIN_VIEW_NEW_TAB="New Tab"
@ -2510,7 +2512,8 @@ COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_MODIFIED_DATE_DESC="The date t
COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_MODIFIED_DATE_LABEL="Modified Date"
COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_CODE_DESCRIPTION="Add Name in Code Here"
COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_CODE_HINT="codename"
COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_CODE_LABEL="Name in Code"
COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_CODE_LABEL="Name in Code<br />
<small><a href=&quot;https://docs.joomla.org/J3.x:File_Structure_and_Naming_Conventions&quot; target=&quot;_blank&quot;>Naming Conventions</a></small>"
COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_CODE_MESSAGE="Error! Please add name in code here."
COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_DESCRIPTION="Enter Name Here"
COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_HINT="Name Here"
@ -3431,7 +3434,9 @@ COM_COMPONENTBUILDER_CONFIG_MANUAL_SELECTION="Manual Selection"
COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_DESCRIPTION="Add the prefix you would like to use. Make sure that it is HTML Character Entities since it is being used in XML."
COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_HINT="&#187;"
COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_LABEL="Prefix<br />
<small><a href='https://dev.w3.org/html5/html-author/charref' target='_blank'>check this list out</a></small>"
<small>Check out these lists:<br />
<a href='https://dev.w3.org/html5/html-author/charref' target='_blank'>Char-ref</a> or
<a href='https://unicode.org/emoji/charts/full-emoji-list.html' target='_blank'>Emoji</a></small>"
COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_MESSAGE="Error! Please add some text here."
COM_COMPONENTBUILDER_CONFIG_MINIFY_DESCRIPTION="Should the JavaScript be minified when compiled."
COM_COMPONENTBUILDER_CONFIG_MINIFY_LABEL="Minify JS"
@ -3696,7 +3701,8 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CLOCK="Clock"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CMD="CMD"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CODENAME_DESCRIPTION="Add Name in Code Here"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CODENAME_HINT="codename"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CODENAME_LABEL="Name in Code"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CODENAME_LABEL="Name in Code<br />
<small><a href=&quot;https://docs.joomla.org/J3.x:File_Structure_and_Naming_Conventions&quot; target=&quot;_blank&quot;>Naming Conventions</a></small>"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CODENAME_MESSAGE="Error! Please add name in code here."
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_COG="Cog"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_COGS="Cogs"
@ -5156,10 +5162,14 @@ COM_COMPONENTBUILDER_FILTER_MODIFIED_DATE_ASCENDING="Modified Date ascending"
COM_COMPONENTBUILDER_FILTER_MODIFIED_DATE_DESCENDING="Modified Date descending"
COM_COMPONENTBUILDER_FILTER_NAME_ASCENDING="Name ascending"
COM_COMPONENTBUILDER_FILTER_NAME_DESCENDING="Name descending"
COM_COMPONENTBUILDER_FILTER_NAME_IN_CODE_ASCENDING="Name in Code ascending"
COM_COMPONENTBUILDER_FILTER_NAME_IN_CODE_DESCENDING="Name in Code descending"
COM_COMPONENTBUILDER_FILTER_NAME_SINGLE_RECORD_ASCENDING="Name (single record) ascending"
COM_COMPONENTBUILDER_FILTER_NAME_SINGLE_RECORD_DESCENDING="Name (single record) descending"
COM_COMPONENTBUILDER_FILTER_NAME_IN_CODE_NAMING_CONVENTIONS_ASCENDING="Name in Code
Naming Conventions ascending"
COM_COMPONENTBUILDER_FILTER_NAME_IN_CODE_NAMING_CONVENTIONS_DESCENDING="Name in Code
Naming Conventions descending"
COM_COMPONENTBUILDER_FILTER_NAME_SINGLE_RECORD_NAMING_CONVENTIONS_ASCENDING="Name (single record)
Naming Conventions ascending"
COM_COMPONENTBUILDER_FILTER_NAME_SINGLE_RECORD_NAMING_CONVENTIONS_DESCENDING="Name (single record)
Naming Conventions descending"
COM_COMPONENTBUILDER_FILTER_NULL_SWITCH_ASCENDING="Null Switch ascending"
COM_COMPONENTBUILDER_FILTER_NULL_SWITCH_DESCENDING="Null Switch descending"
COM_COMPONENTBUILDER_FILTER_PROTOCOL_ASCENDING="Protocol ascending"
@ -5767,7 +5777,9 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LOCK_DOWN_USE_USED_TO_VERIFY_OWNERSHIP="Lo
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MENU_PREFIX_DESCRIPTION="Add the prefix you would like to use. Make sure that it is HTML Character Entities since it is being used in XML."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MENU_PREFIX_HINT="&#187;"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MENU_PREFIX_LABEL="Prefix<br />
<small><a href='https://dev.w3.org/html5/html-author/charref' target='_blank'>check this list out</a></small>"
<small>Check out these lists:<br />
<a href='https://dev.w3.org/html5/html-author/charref' target='_blank'>Char-ref</a> or
<a href='https://unicode.org/emoji/charts/full-emoji-list.html' target='_blank'>Emoji</a></small>"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MENU_PREFIX_MESSAGE="Error! Please add some text here."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MODIFIED_BY_DESC="The last user that modified this Joomla Component."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MODIFIED_BY_LABEL="Modified By"
@ -5780,7 +5792,8 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL="Version Options"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MYSQL="MySQL"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_DESCRIPTION="Add Name in Code Here"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_HINT="codename"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL="Name in Code"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL="Name in Code<br />
<small><a href=&quot;https://docs.joomla.org/J3.x:File_Structure_and_Naming_Conventions&quot; target=&quot;_blank&quot;>Naming Conventions</a></small>"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_MESSAGE="Error! Please add name in code here."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_DESCRIPTION="Enter Name Here"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_HINT="Name Here"
@ -8121,7 +8134,8 @@ COM_COMPONENTBUILDER_SITE_VIEW_CLOCK="Clock"
COM_COMPONENTBUILDER_SITE_VIEW_CMD="CMD"
COM_COMPONENTBUILDER_SITE_VIEW_CODENAME_DESCRIPTION="Add Name in Code Here"
COM_COMPONENTBUILDER_SITE_VIEW_CODENAME_HINT="codename"
COM_COMPONENTBUILDER_SITE_VIEW_CODENAME_LABEL="Name in Code"
COM_COMPONENTBUILDER_SITE_VIEW_CODENAME_LABEL="Name in Code<br />
<small><a href=&quot;https://docs.joomla.org/J3.x:File_Structure_and_Naming_Conventions&quot; target=&quot;_blank&quot;>Naming Conventions</a></small>"
COM_COMPONENTBUILDER_SITE_VIEW_CODENAME_MESSAGE="Error! Please add name in code here."
COM_COMPONENTBUILDER_SITE_VIEW_COG="Cog"
COM_COMPONENTBUILDER_SITE_VIEW_COGS="Cogs"

View File

@ -106,12 +106,6 @@ class ComponentbuilderModelAdmin_custom_tabs extends JModelAdmin
$tabs->loadString($item->tabs);
$item->tabs = $tabs->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_custom_tabs');
}
}
return $item;
@ -238,7 +232,7 @@ class ComponentbuilderModelAdmin_custom_tabs extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/admin_custom_tabs.js';
return 'media/com_componentbuilder/js/admin_custom_tabs.js';
}
/**

View File

@ -127,12 +127,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$fieldsUpdate->addfields = json_encode($bucket);
$this->_db->updateObject('#__componentbuilder_admin_fields', $fieldsUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields');
}
}
return $item;
@ -259,7 +253,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/admin_fields.js';
return 'media/com_componentbuilder/js/admin_fields.js';
}
/**

View File

@ -127,12 +127,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$conditionsUpdate->addconditions = json_encode($bucket);
$this->_db->updateObject('#__componentbuilder_admin_fields_conditions', $conditionsUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields_conditions');
}
}
return $item;
@ -259,7 +253,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.js';
return 'media/com_componentbuilder/js/admin_fields_conditions.js';
}
/**

View File

@ -189,12 +189,6 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields_relations');
}
}
return $item;
@ -321,7 +315,7 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/admin_fields_relations.js';
return 'media/com_componentbuilder/js/admin_fields_relations.js';
}
/**

View File

@ -665,12 +665,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->mysql_table_collate = 'utf8_general_ci';
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_view');
}
}
return $item;
@ -818,7 +812,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/admin_view.js';
return 'media/com_componentbuilder/js/admin_view.js';
}
/**

View File

@ -196,12 +196,6 @@ class ComponentbuilderModelClass_extends extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.class_extends');
}
}
return $item;
@ -342,7 +336,7 @@ class ComponentbuilderModelClass_extends extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/class_extends.js';
return 'media/com_componentbuilder/js/class_extends.js';
}
/**

View File

@ -205,12 +205,6 @@ class ComponentbuilderModelClass_method extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.class_method');
}
}
return $item;
@ -358,7 +352,7 @@ class ComponentbuilderModelClass_method extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/class_method.js';
return 'media/com_componentbuilder/js/class_method.js';
}
/**

View File

@ -196,12 +196,6 @@ class ComponentbuilderModelClass_property extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.class_property');
}
}
return $item;
@ -349,7 +343,7 @@ class ComponentbuilderModelClass_property extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/class_property.js';
return 'media/com_componentbuilder/js/class_property.js';
}
/**

View File

@ -138,12 +138,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_component_admin_views', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_admin_views');
}
}
return $item;
@ -270,7 +264,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_admin_views.js';
return 'media/com_componentbuilder/js/component_admin_views.js';
}
/**

View File

@ -137,12 +137,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_component_config', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_config');
}
}
return $item;
@ -266,7 +260,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_config.js';
return 'media/com_componentbuilder/js/component_config.js';
}
/**

View File

@ -137,12 +137,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_component_custom_admin_menus', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_custom_admin_menus');
}
}
return $item;
@ -266,7 +260,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.js';
return 'media/com_componentbuilder/js/component_custom_admin_menus.js';
}
/**

View File

@ -138,12 +138,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_component_custom_admin_views', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_custom_admin_views');
}
}
return $item;
@ -270,7 +264,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.js';
return 'media/com_componentbuilder/js/component_custom_admin_views.js';
}
/**

View File

@ -226,12 +226,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_component_dashboard', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_dashboard');
}
}
return $item;
@ -355,7 +349,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_dashboard.js';
return 'media/com_componentbuilder/js/component_dashboard.js';
}
/**

View File

@ -174,12 +174,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_component_files_folders', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_files_folders');
}
}
return $item;
@ -303,7 +297,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_files_folders.js';
return 'media/com_componentbuilder/js/component_files_folders.js';
}
/**

View File

@ -107,12 +107,6 @@ class ComponentbuilderModelComponent_modules extends JModelAdmin
$addjoomla_modules->loadString($item->addjoomla_modules);
$item->addjoomla_modules = $addjoomla_modules->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_modules');
}
}
return $item;
@ -236,7 +230,7 @@ class ComponentbuilderModelComponent_modules extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_modules.js';
return 'media/com_componentbuilder/js/component_modules.js';
}
/**

View File

@ -137,12 +137,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_component_mysql_tweaks', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_mysql_tweaks');
}
}
return $item;
@ -266,7 +260,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.js';
return 'media/com_componentbuilder/js/component_mysql_tweaks.js';
}
/**

View File

@ -106,12 +106,6 @@ class ComponentbuilderModelComponent_placeholders extends JModelAdmin
$addplaceholders->loadString($item->addplaceholders);
$item->addplaceholders = $addplaceholders->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_placeholders');
}
}
return $item;
@ -235,7 +229,7 @@ class ComponentbuilderModelComponent_placeholders extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_placeholders.js';
return 'media/com_componentbuilder/js/component_placeholders.js';
}
/**

View File

@ -107,12 +107,6 @@ class ComponentbuilderModelComponent_plugins extends JModelAdmin
$addjoomla_plugins->loadString($item->addjoomla_plugins);
$item->addjoomla_plugins = $addjoomla_plugins->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_plugins');
}
}
return $item;
@ -236,7 +230,7 @@ class ComponentbuilderModelComponent_plugins extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_plugins.js';
return 'media/com_componentbuilder/js/component_plugins.js';
}
/**

View File

@ -138,12 +138,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_component_site_views', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_site_views');
}
}
return $item;
@ -270,7 +264,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_site_views.js';
return 'media/com_componentbuilder/js/component_site_views.js';
}
/**

View File

@ -137,12 +137,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_component_updates', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_updates');
}
}
return $item;
@ -266,7 +260,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component_updates.js';
return 'media/com_componentbuilder/js/component_updates.js';
}
/**

View File

@ -371,12 +371,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
// be sure to update the table if we found repeatable fields that are still not converted
$this->_db->updateObject('#__componentbuilder_custom_admin_view', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.custom_admin_view');
}
}
return $item;
@ -522,7 +516,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/custom_admin_view.js';
return 'media/com_componentbuilder/js/custom_admin_view.js';
}
/**

View File

@ -205,12 +205,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.custom_code');
}
}
return $item;
@ -351,7 +345,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/custom_code.js';
return 'media/com_componentbuilder/js/custom_code.js';
}
/**

View File

@ -385,12 +385,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_dynamic_get', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.dynamic_get');
}
}
return $item;
@ -542,7 +536,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/dynamic_get.js';
return 'media/com_componentbuilder/js/dynamic_get.js';
}
/**

View File

@ -284,12 +284,6 @@ class ComponentbuilderModelField extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.field');
}
}
return $item;
@ -435,7 +429,7 @@ class ComponentbuilderModelField extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/field.js';
return 'media/com_componentbuilder/js/field.js';
}
/**

View File

@ -232,12 +232,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$objectUpdate->properties = json_encode($bucket);
$this->db->updateObject('#__componentbuilder_fieldtype', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.fieldtype');
}
}
$this->fieldtypevvvv = $item->id;
@ -614,7 +608,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/fieldtype.js';
return 'media/com_componentbuilder/js/fieldtype.js';
}
/**

View File

@ -86,8 +86,8 @@
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.system_name ASC">COM_COMPONENTBUILDER_FILTER_SYSTEM_NAME_ASCENDING</option>
<option value="a.system_name DESC">COM_COMPONENTBUILDER_FILTER_SYSTEM_NAME_DESCENDING</option>
<option value="a.name_single ASC">COM_COMPONENTBUILDER_FILTER_NAME_SINGLE_RECORD_ASCENDING</option>
<option value="a.name_single DESC">COM_COMPONENTBUILDER_FILTER_NAME_SINGLE_RECORD_DESCENDING</option>
<option value="a.name_single ASC">COM_COMPONENTBUILDER_FILTER_NAME_SINGLE_RECORD_NAMING_CONVENTIONS_ASCENDING</option>
<option value="a.name_single DESC">COM_COMPONENTBUILDER_FILTER_NAME_SINGLE_RECORD_NAMING_CONVENTIONS_DESCENDING</option>
<option value="a.short_description ASC">COM_COMPONENTBUILDER_FILTER_SHORT_DESCRIPTION_ASCENDING</option>
<option value="a.short_description DESC">COM_COMPONENTBUILDER_FILTER_SHORT_DESCRIPTION_DESCENDING</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>

View File

@ -66,8 +66,8 @@
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.system_name ASC">COM_COMPONENTBUILDER_FILTER_SYSTEM_NAME_ASCENDING</option>
<option value="a.system_name DESC">COM_COMPONENTBUILDER_FILTER_SYSTEM_NAME_DESCENDING</option>
<option value="a.name_code ASC">COM_COMPONENTBUILDER_FILTER_NAME_IN_CODE_ASCENDING</option>
<option value="a.name_code DESC">COM_COMPONENTBUILDER_FILTER_NAME_IN_CODE_DESCENDING</option>
<option value="a.name_code ASC">COM_COMPONENTBUILDER_FILTER_NAME_IN_CODE_NAMING_CONVENTIONS_ASCENDING</option>
<option value="a.name_code DESC">COM_COMPONENTBUILDER_FILTER_NAME_IN_CODE_NAMING_CONVENTIONS_DESCENDING</option>
<option value="a.short_description ASC">COM_COMPONENTBUILDER_FILTER_SHORT_DESCRIPTION_ASCENDING</option>
<option value="a.short_description DESC">COM_COMPONENTBUILDER_FILTER_SHORT_DESCRIPTION_DESCENDING</option>
<option value="a.companyname ASC">COM_COMPONENTBUILDER_FILTER_COMPANY_NAME_ASCENDING</option>

View File

@ -1003,7 +1003,7 @@
name="toignore"
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TOIGNORE_LABEL"
size="10"
maxlength="50"
maxlength="550"
default=".git"
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TOIGNORE_DESCRIPTION"
class="text_area"

View File

@ -120,12 +120,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
// JSON Decode groups.
$item->groups = json_decode($item->groups,true);
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.help_document');
}
}
return $item;
@ -247,7 +241,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/help_document.js';
return 'media/com_componentbuilder/js/help_document.js';
}
/**

View File

@ -508,7 +508,8 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
{
$found = false;
$has_id = false;
if ($canEdit && isset($row[$source_key]) && ComponentbuilderHelper::checkString($row[$source_key]))
// check that we have a string or a number<-(which is weird... but happens at times)
if ($canEdit && isset($row[$source_key]) && (ComponentbuilderHelper::checkString($row[$source_key]) || is_numeric($row[$source_key])))
{
// raw items import & update!
$query = $db->getQuery(true);

View File

@ -548,12 +548,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_joomla_component', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_component');
}
}
return $item;
@ -712,7 +706,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/joomla_component.js';
return 'media/com_componentbuilder/js/joomla_component.js';
}
/**

View File

@ -678,14 +678,56 @@ class ComponentbuilderModelJoomla_components extends JModelList
$this->_db->execute();
if ($this->_db->getNumRows())
{
// get the items
$items = $this->_db->loadObjectList();
// reset the search array (only search for template/layouts)
$searchTLArray = array();
// check if we have items
if (ComponentbuilderHelper::checkArray($items))
{
// set search array
// set search array if site/custom admin view
if ('site_view' === $table || 'custom_admin_view' === $table)
{
$searchArray = array('php_view', 'php_jview', 'php_jview_display', 'php_document', 'js_document', 'css_document', 'css');
$searchTLArray = array(
'default' => 'force_it',
'php_view' => 'add_php_view',
'php_jview' => 'add_php_jview',
'php_jview_display' => 'add_php_jview_display',
'php_document' => 'add_php_document',
'javascript_file' => 'add_javascript_file',
'js_document' => 'add_js_document',
'css_document' => 'add_css_document',
'css' => 'add_css'
);
}
// set search array if admin view
if ('admin_view' === $table)
{
$searchTLArray = array(
'php_getitem' => 'add_php_getitem',
'php_before_save' => 'add_php_before_save',
'php_save' => 'add_php_save',
'php_getform' => 'add_php_getform',
'php_postsavehook' => 'add_php_postsavehook',
'php_getitems' => 'add_php_getitems',
'php_getitems_after_all' => 'add_php_getitems_after_all',
'php_getlistquery' => 'add_php_getlistquery',
'php_allowadd' => 'add_php_allowadd',
'php_allowedit' => 'add_php_allowedit',
'php_before_cancel' => 'add_php_before_cancel',
'php_after_cancel' => 'add_php_after_cancel',
'php_before_delete' => 'add_php_before_delete',
'php_after_delete' => 'add_php_after_delete',
'php_before_publish' => 'add_php_before_publish',
'php_after_publish' => 'add_php_after_publish',
'php_batchcopy' => 'add_php_batchcopy',
'php_batchmove' => 'add_php_batchmove',
'php_document' => 'add_php_document',
'php_model' => 'add_custom_button',
'php_controller' => 'add_custom_button',
'php_model_list' => 'add_custom_button',
'php_controller_list' => 'add_custom_button'
);
}
// reset the global array
if ('template' === $table)
@ -913,19 +955,21 @@ class ComponentbuilderModelJoomla_components extends JModelList
}
}
}
// actions to take if table is site_view and custom_admin_view
if ('site_view' === $table || 'custom_admin_view' === $table)
{
// search for templates & layouts
$this->getTemplateLayout(base64_decode($item->default));
// check if a search is required
if (isset($searchTLArray) && ComponentbuilderHelper::checkArray($searchTLArray)){
// add search array templates and layouts
foreach ($searchArray as $scripter)
foreach ($searchTLArray as $scripter => $add)
{
if (isset($item->{'add_'.$scripter}) && $item->{'add_'.$scripter} == 1)
if ($add === 'force_it' || (isset($item->{$add}) && $item->{$add} == 1))
{
$this->getTemplateLayout($item->{$scripter});
}
}
}
// actions to take if table is site_view and custom_admin_view
if ('site_view' === $table || 'custom_admin_view' === $table)
{
// add dynamic gets
$this->setSmartIDs($item->main_get, 'dynamic_get');
$this->setSmartIDs($item->custom_get, 'dynamic_get');
@ -951,7 +995,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
$this->setSmartIDs((int) $item->snippet, 'snippet');
}
// search for templates & layouts
$this->getTemplateLayout(base64_decode($item->$table), $this->user);
$this->getTemplateLayout($item->$table, $this->user);
// add search array templates and layouts
if (isset($item->add_php_view) && $item->add_php_view == 1)
{
@ -1420,6 +1464,11 @@ class ComponentbuilderModelJoomla_components extends JModelList
*/
protected function getTemplateLayout($default, $user = false)
{
// check if we have base64 encoding
if (base64_encode(base64_decode($default, true)) === $default)
{
$default = base64_decode($default);
}
// set the Template data
$temp1 = ComponentbuilderHelper::getAllBetween($default, "\$this->loadTemplate('","')");
$temp2 = ComponentbuilderHelper::getAllBetween($default, '$this->loadTemplate("','")');

View File

@ -377,12 +377,6 @@ class ComponentbuilderModelJoomla_module extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_module');
}
}
return $item;
@ -530,7 +524,7 @@ class ComponentbuilderModelJoomla_module extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/joomla_module.js';
return 'media/com_componentbuilder/js/joomla_module.js';
}
/**

View File

@ -152,12 +152,6 @@ class ComponentbuilderModelJoomla_module_files_folders_urls extends JModelAdmin
$addurls->loadString($item->addurls);
$item->addurls = $addurls->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_module_files_folders_urls');
}
}
return $item;
@ -281,7 +275,7 @@ class ComponentbuilderModelJoomla_module_files_folders_urls extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/joomla_module_files_folders_urls.js';
return 'media/com_componentbuilder/js/joomla_module_files_folders_urls.js';
}
/**

View File

@ -106,12 +106,6 @@ class ComponentbuilderModelJoomla_module_updates extends JModelAdmin
$version_update->loadString($item->version_update);
$item->version_update = $version_update->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_module_updates');
}
}
return $item;
@ -235,7 +229,7 @@ class ComponentbuilderModelJoomla_module_updates extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/joomla_module_updates.js';
return 'media/com_componentbuilder/js/joomla_module_updates.js';
}
/**

View File

@ -342,12 +342,6 @@ class ComponentbuilderModelJoomla_plugin extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin');
}
}
return $item;
@ -495,7 +489,7 @@ class ComponentbuilderModelJoomla_plugin extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/joomla_plugin.js';
return 'media/com_componentbuilder/js/joomla_plugin.js';
}
/**

View File

@ -152,12 +152,6 @@ class ComponentbuilderModelJoomla_plugin_files_folders_urls extends JModelAdmin
$addurls->loadString($item->addurls);
$item->addurls = $addurls->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin_files_folders_urls');
}
}
return $item;
@ -281,7 +275,7 @@ class ComponentbuilderModelJoomla_plugin_files_folders_urls extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.js';
return 'media/com_componentbuilder/js/joomla_plugin_files_folders_urls.js';
}
/**

View File

@ -98,12 +98,6 @@ class ComponentbuilderModelJoomla_plugin_group extends JModelAdmin
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin_group');
}
}
return $item;
@ -225,7 +219,7 @@ class ComponentbuilderModelJoomla_plugin_group extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.js';
return 'media/com_componentbuilder/js/joomla_plugin_group.js';
}
/**

View File

@ -106,12 +106,6 @@ class ComponentbuilderModelJoomla_plugin_updates extends JModelAdmin
$version_update->loadString($item->version_update);
$item->version_update = $version_update->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin_updates');
}
}
return $item;
@ -235,7 +229,7 @@ class ComponentbuilderModelJoomla_plugin_updates extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.js';
return 'media/com_componentbuilder/js/joomla_plugin_updates.js';
}
/**

View File

@ -98,12 +98,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.language');
}
}
return $item;
@ -225,7 +219,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/language.js';
return 'media/com_componentbuilder/js/language.js';
}
/**

View File

@ -195,12 +195,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.language_translation');
}
}
return $item;
@ -322,7 +316,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/language_translation.js';
return 'media/com_componentbuilder/js/language_translation.js';
}
/**

View File

@ -223,12 +223,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.layout');
}
}
return $item;
@ -367,7 +361,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/layout.js';
return 'media/com_componentbuilder/js/layout.js';
}
/**

View File

@ -240,12 +240,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.library');
}
}
return $item;
@ -374,7 +368,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/library.js';
return 'media/com_componentbuilder/js/library.js';
}
/**

View File

@ -106,12 +106,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
$addconfig->loadString($item->addconfig);
$item->addconfig = $addconfig->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.library_config');
}
}
return $item;
@ -235,7 +229,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/library_config.js';
return 'media/com_componentbuilder/js/library_config.js';
}
/**

View File

@ -152,12 +152,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
$addurls->loadString($item->addurls);
$item->addurls = $addurls->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.library_files_folders_urls');
}
}
return $item;
@ -281,7 +275,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/library_files_folders_urls.js';
return 'media/com_componentbuilder/js/library_files_folders_urls.js';
}
/**

View File

@ -189,12 +189,6 @@ class ComponentbuilderModelPlaceholder extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.placeholder');
}
}
return $item;
@ -316,7 +310,7 @@ class ComponentbuilderModelPlaceholder extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/placeholder.js';
return 'media/com_componentbuilder/js/placeholder.js';
}
/**

View File

@ -174,12 +174,6 @@ class ComponentbuilderModelServer extends JModelAdmin
// basic decrypt data username.
$item->username = rtrim($basic->decryptString($item->username), "\0");
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.server');
}
}
$this->sales_serverupdate_servervvvw = $item->id;
@ -397,7 +391,7 @@ class ComponentbuilderModelServer extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/server.js';
return 'media/com_componentbuilder/js/server.js';
}
/**

View File

@ -392,12 +392,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
{
$this->_db->updateObject('#__componentbuilder_site_view', $objectUpdate, 'id');
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.site_view');
}
}
return $item;
@ -543,7 +537,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/site_view.js';
return 'media/com_componentbuilder/js/site_view.js';
}
/**

View File

@ -125,12 +125,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
// base64 Decode snippet.
$item->snippet = base64_decode($item->snippet);
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.snippet');
}
}
return $item;
@ -259,7 +253,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/snippet.js';
return 'media/com_componentbuilder/js/snippet.js';
}
/**

View File

@ -98,12 +98,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.snippet_type');
}
}
return $item;
@ -225,7 +219,7 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/snippet_type.js';
return 'media/com_componentbuilder/js/snippet_type.js';
}
/**

View File

@ -223,12 +223,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.template');
}
}
return $item;
@ -367,7 +361,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/template.js';
return 'media/com_componentbuilder/js/template.js';
}
/**

View File

@ -192,12 +192,6 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
}
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.validation_rule');
}
}
return $item;
@ -319,7 +313,7 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/validation_rule.js';
return 'media/com_componentbuilder/js/validation_rule.js';
}
/**

File diff suppressed because one or more lines are too long

View File

@ -184,9 +184,9 @@ class ComponentbuilderViewCompiler extends JViewLegacy
$options = array();
$options[''] = 'COM_COMPONENTBUILDER__SELECT_COMPONENT_';
// load component options from array
foreach($this->Components as $componet)
foreach($this->Components as $component)
{
$options[(int) $componet->id] = $this->escape($componet->name);
$options[(int) $component->id] = $this->escape($component->name);
}
// add to form
$form[] = ComponentbuilderHelper::getFieldObject($attributes, '', $options);

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>10th March, 2021</creationDate>
<creationDate>14th June, 2021</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>2.12.9</version>
<version>2.12.10</version>
<description><![CDATA[
<h1>Component Builder (v.2.12.9)</h1>
<h1>Component Builder (v.2.12.10)</h1>
<div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -1024,10 +1024,10 @@
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.12.9</version>
<version>2.12.10</version>
<infourl title="Component Builder!">http://www.joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.12.9/JCB_v2.12.9.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.12.10/JCB_v2.12.10.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>

View File

@ -1,56 +1,19 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Composer
Upstream-Contact: Jordi Boggiano <j.boggiano@seld.be>
Source: https://github.com/composer/composer
Copyright (c) Nils Adermann, Jordi Boggiano
Files: *
Copyright: 2016, Nils Adermann <naderman@naderman.de>
2016, Jordi Boggiano <j.boggiano@seld.be>
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
Files: src/Composer/Util/TlsHelper.php
Copyright: 2016, Nils Adermann <naderman@naderman.de>
2016, Jordi Boggiano <j.boggiano@seld.be>
2013, Evan Coury <me@evancoury.com>
License: Expat and BSD-2-Clause
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
License: BSD-2-Clause
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
.
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -6,28 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'phpseclib\\Crypt\\AES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/AES.php',
'phpseclib\\Crypt\\Base' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Base.php',
'phpseclib\\Crypt\\Blowfish' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php',
'phpseclib\\Crypt\\DES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/DES.php',
'phpseclib\\Crypt\\Hash' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Hash.php',
'phpseclib\\Crypt\\RC2' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/RC2.php',
'phpseclib\\Crypt\\RC4' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/RC4.php',
'phpseclib\\Crypt\\RSA' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/RSA.php',
'phpseclib\\Crypt\\Random' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Random.php',
'phpseclib\\Crypt\\Rijndael' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php',
'phpseclib\\Crypt\\TripleDES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php',
'phpseclib\\Crypt\\Twofish' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php',
'phpseclib\\File\\ANSI' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ANSI.php',
'phpseclib\\File\\ASN1' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ASN1.php',
'phpseclib\\File\\ASN1\\Element' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ASN1/Element.php',
'phpseclib\\File\\X509' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/X509.php',
'phpseclib\\Math\\BigInteger' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Math/BigInteger.php',
'phpseclib\\Net\\SCP' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SCP.php',
'phpseclib\\Net\\SFTP' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SFTP.php',
'phpseclib\\Net\\SFTP\\Stream' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php',
'phpseclib\\Net\\SSH1' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SSH1.php',
'phpseclib\\Net\\SSH2' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SSH2.php',
'phpseclib\\System\\SSH\\Agent' => $vendorDir . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php',
'phpseclib\\System\\SSH\\Agent\\Identity' => $vendorDir . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php',
);

View File

@ -13,6 +13,9 @@ class ComposerAutoloaderInit10d22a526bd476954b93748a871e7ad4
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {

View File

@ -24,39 +24,11 @@ class ComposerStaticInit10d22a526bd476954b93748a871e7ad4
),
);
public static $classMap = array (
'phpseclib\\Crypt\\AES' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/AES.php',
'phpseclib\\Crypt\\Base' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Base.php',
'phpseclib\\Crypt\\Blowfish' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php',
'phpseclib\\Crypt\\DES' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/DES.php',
'phpseclib\\Crypt\\Hash' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Hash.php',
'phpseclib\\Crypt\\RC2' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/RC2.php',
'phpseclib\\Crypt\\RC4' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/RC4.php',
'phpseclib\\Crypt\\RSA' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/RSA.php',
'phpseclib\\Crypt\\Random' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Random.php',
'phpseclib\\Crypt\\Rijndael' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php',
'phpseclib\\Crypt\\TripleDES' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php',
'phpseclib\\Crypt\\Twofish' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php',
'phpseclib\\File\\ANSI' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/ANSI.php',
'phpseclib\\File\\ASN1' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/ASN1.php',
'phpseclib\\File\\ASN1\\Element' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/ASN1/Element.php',
'phpseclib\\File\\X509' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/X509.php',
'phpseclib\\Math\\BigInteger' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Math/BigInteger.php',
'phpseclib\\Net\\SCP' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SCP.php',
'phpseclib\\Net\\SFTP' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SFTP.php',
'phpseclib\\Net\\SFTP\\Stream' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php',
'phpseclib\\Net\\SSH1' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SSH1.php',
'phpseclib\\Net\\SSH2' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SSH2.php',
'phpseclib\\System\\SSH\\Agent' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php',
'phpseclib\\System\\SSH\\Agent\\Identity' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit10d22a526bd476954b93748a871e7ad4::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit10d22a526bd476954b93748a871e7ad4::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit10d22a526bd476954b93748a871e7ad4::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1,17 +1,17 @@
[
{
"name": "phpseclib/phpseclib",
"version": "2.0.27",
"version_normalized": "2.0.27.0",
"version": "2.0.32",
"version_normalized": "2.0.32.0",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "34620af4df7d1988d8f0d7e91f6c8a3bf931d8dc"
"reference": "f5c4c19880d45d0be3e7d24ae8ac434844a898cd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/34620af4df7d1988d8f0d7e91f6c8a3bf931d8dc",
"reference": "34620af4df7d1988d8f0d7e91f6c8a3bf931d8dc",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f5c4c19880d45d0be3e7d24ae8ac434844a898cd",
"reference": "f5c4c19880d45d0be3e7d24ae8ac434844a898cd",
"shasum": ""
},
"require": {
@ -19,8 +19,7 @@
},
"require-dev": {
"phing/phing": "~2.7",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0",
"sami/sami": "~2.0",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4",
"squizlabs/php_codesniffer": "~2.0"
},
"suggest": {
@ -29,7 +28,7 @@
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
"time": "2020-04-04T23:17:33+00:00",
"time": "2021-06-12T12:12:59+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -91,6 +90,20 @@
"twofish",
"x.509",
"x509"
],
"funding": [
{
"url": "https://github.com/terrafrost",
"type": "github"
},
{
"url": "https://www.patreon.com/phpseclib",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib",
"type": "tidelift"
}
]
}
]

View File

@ -1,6 +1,6 @@
# phpseclib - PHP Secure Communications Library
[![Build Status](https://travis-ci.org/phpseclib/phpseclib.svg?branch=2.0)](https://travis-ci.org/phpseclib/phpseclib)
[![Build Status](https://travis-ci.com/phpseclib/phpseclib.svg?branch=2.0)](https://travis-ci.com/phpseclib/phpseclib)
## Supporting phpseclib
@ -10,16 +10,16 @@
## Introduction
MIT-licensed pure-PHP implementations of an arbitrary-precision integer
arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael,
AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509
MIT-licensed pure-PHP implementations of the following:
SSH-2, SFTP, X.509, an arbitrary-precision integer arithmetic library, Ed25519 / Ed449 / Curve25519 / Curve449, ECDSA / ECDH (with support for 66 curves), RSA (PKCS#1 v2.2 compliant), DSA / DH, DES / 3DES / RC4 / Rijndael / AES / Blowfish / Twofish / Salsa20 / ChaCha20, GCM / Poly1305
* [Browse Git](https://github.com/phpseclib/phpseclib)
## Documentation
* [Documentation / Manual](http://phpseclib.sourceforge.net/)
* [API Documentation](https://api.phpseclib.org/2.0/) (generated by Sami)
* [Documentation / Manual](https://phpseclib.com/)
* [API Documentation](https://api.phpseclib.com/2.0/) (generated by Doctum)
## Branches
@ -29,6 +29,14 @@ AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509
* Unstable API
* Do not use in production
### 3.0
* Long term support (LTS) release
* Major expansion of cryptographic primitives
* Minimum PHP version: 5.6.1
* PSR-4 autoloading with namespace rooted at `\phpseclib3`
* Install via Composer: `composer require phpseclib/phpseclib:~3.0`
### 2.0
* Long term support (LTS) release
@ -44,7 +52,7 @@ AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509
* Composer compatible (PSR-0 autoloading)
* Install using Composer: `composer require phpseclib/phpseclib:~1.0`
* Install using PEAR: See [phpseclib PEAR Channel Documentation](http://phpseclib.sourceforge.net/pear.htm)
* [Download 1.0.18 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.18.zip/download)
* [Download 1.0.19 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.19.zip/download)
## Security contact information

View File

@ -55,8 +55,7 @@
},
"require-dev": {
"phing/phing": "~2.7",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0",
"sami/sami": "~2.0",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4",
"squizlabs/php_codesniffer": "~2.0"
},
"suggest": {

View File

@ -413,7 +413,7 @@ abstract class Base
* @var mixed
* @access private
*/
var $use_inline_crypt;
var $use_inline_crypt = true;
/**
* If OpenSSL can be used in ECB but not in CTR we can emulate CTR
@ -495,11 +495,6 @@ abstract class Base
}
$this->_setEngine();
// Determining whether inline crypting can be used by the cipher
if ($this->use_inline_crypt !== false) {
$this->use_inline_crypt = version_compare(PHP_VERSION, '5.3.0') >= 0 || function_exists('create_function');
}
}
/**
@ -784,12 +779,14 @@ abstract class Base
}
if ($this->engine === self::ENGINE_MCRYPT) {
set_error_handler(array($this, 'do_nothing'));
if ($this->changed) {
$this->_setupMcrypt();
$this->changed = false;
}
if ($this->enchanged) {
@mcrypt_generic_init($this->enmcrypt, $this->key, $this->encryptIV);
mcrypt_generic_init($this->enmcrypt, $this->key, $this->encryptIV);
$this->enchanged = false;
}
@ -822,15 +819,15 @@ abstract class Base
if ($len >= $block_size) {
if ($this->enbuffer['enmcrypt_init'] === false || $len > $this->cfb_init_len) {
if ($this->enbuffer['enmcrypt_init'] === true) {
@mcrypt_generic_init($this->enmcrypt, $this->key, $iv);
mcrypt_generic_init($this->enmcrypt, $this->key, $iv);
$this->enbuffer['enmcrypt_init'] = false;
}
$ciphertext.= @mcrypt_generic($this->enmcrypt, substr($plaintext, $i, $len - $len % $block_size));
$ciphertext.= mcrypt_generic($this->enmcrypt, substr($plaintext, $i, $len - $len % $block_size));
$iv = substr($ciphertext, -$block_size);
$len%= $block_size;
} else {
while ($len >= $block_size) {
$iv = @mcrypt_generic($this->ecb, $iv) ^ substr($plaintext, $i, $block_size);
$iv = mcrypt_generic($this->ecb, $iv) ^ substr($plaintext, $i, $block_size);
$ciphertext.= $iv;
$len-= $block_size;
$i+= $block_size;
@ -839,22 +836,26 @@ abstract class Base
}
if ($len) {
$iv = @mcrypt_generic($this->ecb, $iv);
$iv = mcrypt_generic($this->ecb, $iv);
$block = $iv ^ substr($plaintext, -$len);
$iv = substr_replace($iv, $block, 0, $len);
$ciphertext.= $block;
$pos = $len;
}
restore_error_handler();
return $ciphertext;
}
$ciphertext = @mcrypt_generic($this->enmcrypt, $plaintext);
$ciphertext = mcrypt_generic($this->enmcrypt, $plaintext);
if (!$this->continuousBuffer) {
@mcrypt_generic_init($this->enmcrypt, $this->key, $this->encryptIV);
mcrypt_generic_init($this->enmcrypt, $this->key, $this->encryptIV);
}
restore_error_handler();
return $ciphertext;
}
@ -1123,13 +1124,14 @@ abstract class Base
}
if ($this->engine === self::ENGINE_MCRYPT) {
set_error_handler(array($this, 'do_nothing'));
$block_size = $this->block_size;
if ($this->changed) {
$this->_setupMcrypt();
$this->changed = false;
}
if ($this->dechanged) {
@mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV);
mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV);
$this->dechanged = false;
}
@ -1157,26 +1159,30 @@ abstract class Base
}
if ($len >= $block_size) {
$cb = substr($ciphertext, $i, $len - $len % $block_size);
$plaintext.= @mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;
$plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb;
$iv = substr($cb, -$block_size);
$len%= $block_size;
}
if ($len) {
$iv = @mcrypt_generic($this->ecb, $iv);
$iv = mcrypt_generic($this->ecb, $iv);
$plaintext.= $iv ^ substr($ciphertext, -$len);
$iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len);
$pos = $len;
}
restore_error_handler();
return $plaintext;
}
$plaintext = @mdecrypt_generic($this->demcrypt, $ciphertext);
$plaintext = mdecrypt_generic($this->demcrypt, $ciphertext);
if (!$this->continuousBuffer) {
@mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV);
mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV);
}
restore_error_handler();
return $this->paddable ? $this->_unpad($plaintext) : $plaintext;
}
@ -1654,9 +1660,12 @@ abstract class Base
}
return false;
case self::ENGINE_MCRYPT:
return $this->cipher_name_mcrypt &&
set_error_handler(array($this, 'do_nothing'));
$result = $this->cipher_name_mcrypt &&
extension_loaded('mcrypt') &&
in_array($this->cipher_name_mcrypt, @mcrypt_list_algorithms());
in_array($this->cipher_name_mcrypt, mcrypt_list_algorithms());
restore_error_handler();
return $result;
case self::ENGINE_INTERNAL:
return true;
}
@ -1733,17 +1742,19 @@ abstract class Base
}
if ($this->engine != self::ENGINE_MCRYPT && $this->enmcrypt) {
set_error_handler(array($this, 'do_nothing'));
// Closing the current mcrypt resource(s). _mcryptSetup() will, if needed,
// (re)open them with the module named in $this->cipher_name_mcrypt
@mcrypt_module_close($this->enmcrypt);
@mcrypt_module_close($this->demcrypt);
mcrypt_module_close($this->enmcrypt);
mcrypt_module_close($this->demcrypt);
$this->enmcrypt = null;
$this->demcrypt = null;
if ($this->ecb) {
@mcrypt_module_close($this->ecb);
mcrypt_module_close($this->ecb);
$this->ecb = null;
}
restore_error_handler();
}
$this->changed = true;
@ -1856,19 +1867,19 @@ abstract class Base
self::MODE_STREAM => MCRYPT_MODE_STREAM,
);
$this->demcrypt = @mcrypt_module_open($this->cipher_name_mcrypt, '', $mcrypt_modes[$this->mode], '');
$this->enmcrypt = @mcrypt_module_open($this->cipher_name_mcrypt, '', $mcrypt_modes[$this->mode], '');
$this->demcrypt = mcrypt_module_open($this->cipher_name_mcrypt, '', $mcrypt_modes[$this->mode], '');
$this->enmcrypt = mcrypt_module_open($this->cipher_name_mcrypt, '', $mcrypt_modes[$this->mode], '');
// we need the $ecb mcrypt resource (only) in MODE_CFB with enableContinuousBuffer()
// to workaround mcrypt's broken ncfb implementation in buffered mode
// see: {@link http://phpseclib.sourceforge.net/cfb-demo.phps}
if ($this->mode == self::MODE_CFB) {
$this->ecb = @mcrypt_module_open($this->cipher_name_mcrypt, '', MCRYPT_MODE_ECB, '');
$this->ecb = mcrypt_module_open($this->cipher_name_mcrypt, '', MCRYPT_MODE_ECB, '');
}
} // else should mcrypt_generic_deinit be called?
if ($this->mode == self::MODE_CFB) {
@mcrypt_generic_init($this->ecb, $this->key, str_repeat("\0", $this->block_size));
mcrypt_generic_init($this->ecb, $this->key, str_repeat("\0", $this->block_size));
}
}
@ -2602,12 +2613,8 @@ abstract class Base
}
// Create the $inline function and return its name as string. Ready to run!
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
eval('$func = function ($_action, &$self, $_text) { ' . $init_crypt . 'if ($_action == "encrypt") { ' . $encrypt . ' } else { ' . $decrypt . ' } };');
return $func;
}
return create_function('$_action, &$self, $_text', $init_crypt . 'if ($_action == "encrypt") { ' . $encrypt . ' } else { ' . $decrypt . ' }');
eval('$func = function ($_action, &$self, $_text) { ' . $init_crypt . 'if ($_action == "encrypt") { ' . $encrypt . ' } else { ' . $decrypt . ' } };');
return $func;
}
/**
@ -2636,7 +2643,7 @@ abstract class Base
*
* @see self::_setupInlineCrypt()
* @access private
* @param $bytes
* @param string $bytes
* @return string
*/
function _hashInlineCryptFunction($bytes)
@ -2705,4 +2712,13 @@ abstract class Base
return $safeint . '((fmod(floor($temp / 0x80000000), 2) & 1) << 31))';
}
}
/**
* Dummy error handler to suppress mcrypt errors
*
* @access private
*/
function do_nothing()
{
}
}

View File

@ -849,7 +849,6 @@ class Hash
* _sha256() adds multiple unsigned 32-bit integers. Since PHP doesn't support unsigned integers and since the
* possibility of overflow exists, care has to be taken. BigInteger could be used but this should be faster.
*
* @param int $...
* @return int
* @see self::_sha256()
* @access private

View File

@ -537,7 +537,7 @@ class RSA
* @access public
* @param int $bits
* @param int $timeout
* @param array $p
* @param array $partial
*/
function createKey($bits = 1024, $timeout = false, $partial = array())
{
@ -716,7 +716,12 @@ class RSA
*
* @access private
* @see self::setPrivateKeyFormat()
* @param string $RSAPrivateKey
* @param Math_BigInteger $n
* @param Math_BigInteger $e
* @param Math_BigInteger $d
* @param array<int,Math_BigInteger> $primes
* @param array<int,Math_BigInteger> $exponents
* @param array<int,Math_BigInteger> $coefficients
* @return string
*/
function _convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients)
@ -997,8 +1002,9 @@ class RSA
*
* @access private
* @see self::setPublicKeyFormat()
* @param string $RSAPrivateKey
* @return string
* @param Math_BigInteger $n
* @param Math_BigInteger $e
* @return string|array<string,Math_BigInteger>
*/
function _convertPublicKey($n, $e)
{
@ -1213,6 +1219,7 @@ class RSA
$length = $this->_decodeLength($temp);
switch ($this->_string_shift($temp, $length)) {
case "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x01": // rsaEncryption
case "\x2A\x86\x48\x86\xF7\x0D\x01\x01\x0A": // rsaPSS
break;
case "\x2a\x86\x48\x86\xf7\x0d\x01\x05\x03": // pbeWithMD5AndDES-CBC
/*
@ -1539,6 +1546,8 @@ class RSA
return $components;
}
return false;
}
/**
@ -1878,7 +1887,6 @@ class RSA
*
* @see self::getPublicKey()
* @access public
* @param string $key
* @param int $type optional
*/
function getPublicKey($type = self::PUBLIC_FORMAT_PKCS8)
@ -1936,7 +1944,6 @@ class RSA
*
* @see self::getPublicKey()
* @access public
* @param string $key
* @param int $type optional
* @return mixed
*/
@ -1961,8 +1968,7 @@ class RSA
*
* @see self::getPrivateKey()
* @access private
* @param string $key
* @param int $type optional
* @param int $mode optional
*/
function _getPrivatePublicKey($mode = self::PUBLIC_FORMAT_PKCS8)
{
@ -2179,7 +2185,7 @@ class RSA
* of the hash function Hash) and 0.
*
* @access public
* @param int $format
* @param int $sLen
*/
function setSaltLength($sLen)
{
@ -2212,7 +2218,7 @@ class RSA
* See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}.
*
* @access private
* @param string $x
* @param int|string|resource $x
* @return \phpseclib\Math\BigInteger
*/
function _os2ip($x)
@ -2439,7 +2445,7 @@ class RSA
*
* @access private
* @param string $mgfSeed
* @param int $mgfLen
* @param int $maskLen
* @return string
*/
function _mgf1($mgfSeed, $maskLen)
@ -2574,9 +2580,9 @@ class RSA
$offset+= $patternMatch ? 0 : 1;
}
// we do & instead of && to avoid https://en.wikipedia.org/wiki/Short-circuit_evaluation
// we do | instead of || to avoid https://en.wikipedia.org/wiki/Short-circuit_evaluation
// to protect against timing attacks
if (!$hashesMatch & !$patternMatch) {
if (!$hashesMatch | !$patternMatch) {
user_error('Decryption error');
return false;
}
@ -2911,6 +2917,59 @@ class RSA
return $em;
}
/**
* EMSA-PKCS1-V1_5-ENCODE (without NULL)
*
* Quoting https://tools.ietf.org/html/rfc8017#page-65,
*
* "The parameters field associated with id-sha1, id-sha224, id-sha256,
* id-sha384, id-sha512, id-sha512/224, and id-sha512/256 should
* generally be omitted, but if present, it shall have a value of type
* NULL"
*
* @access private
* @param string $m
* @param int $emLen
* @return string
*/
function _emsa_pkcs1_v1_5_encode_without_null($m, $emLen)
{
$h = $this->hash->hash($m);
if ($h === false) {
return false;
}
switch ($this->hashName) {
case 'sha1':
$t = pack('H*', '301f300706052b0e03021a0414');
break;
case 'sha256':
$t = pack('H*', '302f300b06096086480165030402010420');
break;
case 'sha384':
$t = pack('H*', '303f300b06096086480165030402020430');
break;
case 'sha512':
$t = pack('H*', '304f300b06096086480165030402030440');
break;
default:
return false;
}
$t.= $h;
$tLen = strlen($t);
if ($emLen < $tLen + 11) {
user_error('Intended encoded message length too short');
return false;
}
$ps = str_repeat(chr(0xFF), $emLen - $tLen - 3);
$em = "\0\1$ps\0$t";
return $em;
}
/**
* RSASSA-PKCS1-V1_5-SIGN
*
@ -2948,6 +3007,7 @@ class RSA
*
* @access private
* @param string $m
* @param string $s
* @return string
*/
function _rsassa_pkcs1_v1_5_verify($m, $s)
@ -2976,13 +3036,17 @@ class RSA
// EMSA-PKCS1-v1_5 encoding
$em2 = $this->_emsa_pkcs1_v1_5_encode($m, $this->k);
if ($em2 === false) {
$em3 = $this->_emsa_pkcs1_v1_5_encode_without_null($m, $this->k);
if ($em2 === false && $em3 === false) {
user_error('RSA modulus too short');
return false;
}
// Compare
return $this->_equals($em, $em2);
return ($em2 !== false && $this->_equals($em, $em2)) ||
($em3 !== false && $this->_equals($em, $em3));
}
/**
@ -3088,7 +3152,7 @@ class RSA
*
* @see self::encrypt()
* @access public
* @param string $plaintext
* @param string $ciphertext
* @return string
*/
function decrypt($ciphertext)

View File

@ -203,8 +203,7 @@ class ANSI
/**
* Set the number of lines that should be logged past the terminal height
*
* @param int $x
* @param int $y
* @param int $history
* @access public
*/
function setHistory($history)
@ -272,7 +271,7 @@ class ANSI
case "\x1B[K": // Clear screen from cursor right
$this->screen[$this->y] = substr($this->screen[$this->y], 0, $this->x);
array_splice($this->attrs[$this->y], $this->x + 1, $this->max_x - $this->x, array_fill($this->x, $this->max_x - $this->x - 1, $this->base_attr_cell));
array_splice($this->attrs[$this->y], $this->x + 1, $this->max_x - $this->x, array_fill($this->x, $this->max_x - ($this->x - 1), $this->base_attr_cell));
break;
case "\x1B[2K": // Clear entire line
$this->screen[$this->y] = str_repeat(' ', $this->x);
@ -316,19 +315,20 @@ class ANSI
$mods = explode(';', $match[1]);
foreach ($mods as $mod) {
switch ($mod) {
case 0: // Turn off character attributes
case '':
case '0': // Turn off character attributes
$attr_cell = clone $this->base_attr_cell;
break;
case 1: // Turn bold mode on
case '1': // Turn bold mode on
$attr_cell->bold = true;
break;
case 4: // Turn underline mode on
case '4': // Turn underline mode on
$attr_cell->underline = true;
break;
case 5: // Turn blinking mode on
case '5': // Turn blinking mode on
$attr_cell->blink = true;
break;
case 7: // Turn reverse video on
case '7': // Turn reverse video on
$attr_cell->reverse = !$attr_cell->reverse;
$temp = $attr_cell->background;
$attr_cell->background = $attr_cell->foreground;
@ -341,23 +341,23 @@ class ANSI
$back = &$attr_cell->{ $attr_cell->reverse ? 'foreground' : 'background' };
switch ($mod) {
// @codingStandardsIgnoreStart
case 30: $front = 'black'; break;
case 31: $front = 'red'; break;
case 32: $front = 'green'; break;
case 33: $front = 'yellow'; break;
case 34: $front = 'blue'; break;
case 35: $front = 'magenta'; break;
case 36: $front = 'cyan'; break;
case 37: $front = 'white'; break;
case '30': $front = 'black'; break;
case '31': $front = 'red'; break;
case '32': $front = 'green'; break;
case '33': $front = 'yellow'; break;
case '34': $front = 'blue'; break;
case '35': $front = 'magenta'; break;
case '36': $front = 'cyan'; break;
case '37': $front = 'white'; break;
case 40: $back = 'black'; break;
case 41: $back = 'red'; break;
case 42: $back = 'green'; break;
case 43: $back = 'yellow'; break;
case 44: $back = 'blue'; break;
case 45: $back = 'magenta'; break;
case 46: $back = 'cyan'; break;
case 47: $back = 'white'; break;
case '40': $back = 'black'; break;
case '41': $back = 'red'; break;
case '42': $back = 'green'; break;
case '43': $back = 'yellow'; break;
case '44': $back = 'blue'; break;
case '45': $back = 'magenta'; break;
case '46': $back = 'cyan'; break;
case '47': $back = 'white'; break;
// @codingStandardsIgnoreEnd
default:

View File

@ -235,7 +235,7 @@ class ASN1
$current = array('start' => $start);
$type = ord($encoded[$encoded_pos++]);
$start++;
$startOffset = 1;
$constructed = ($type >> 5) & 1;
@ -245,13 +245,20 @@ class ASN1
// process septets (since the eighth bit is ignored, it's not an octet)
do {
$temp = ord($encoded[$encoded_pos++]);
$startOffset++;
$loop = $temp >> 7;
$tag <<= 7;
$tag |= $temp & 0x7F;
$start++;
$temp &= 0x7F;
// "bits 7 to 1 of the first subsequent octet shall not all be zero"
if ($startOffset == 2 && $temp == 0) {
return false;
}
$tag |= $temp;
} while ($loop);
}
$start+= $startOffset;
// Length, as discussed in paragraph 8.1.3 of X.690-0207.pdf#page=13
$length = ord($encoded[$encoded_pos++]);
$start++;
@ -344,13 +351,16 @@ class ASN1
switch ($tag) {
case self::TYPE_BOOLEAN:
// "The contents octets shall consist of a single octet." -- paragraph 8.2.1
//if (strlen($content) != 1) {
// return false;
//}
if ($constructed || strlen($content) != 1) {
return false;
}
$current['content'] = (bool) ord($content[$content_pos]);
break;
case self::TYPE_INTEGER:
case self::TYPE_ENUMERATED:
if ($constructed) {
return false;
}
$current['content'] = new BigInteger(substr($content, $content_pos), -256);
break;
case self::TYPE_REAL: // not currently supported
@ -370,15 +380,15 @@ class ASN1
$last = count($temp) - 1;
for ($i = 0; $i < $last; $i++) {
// all subtags should be bit strings
//if ($temp[$i]['type'] != self::TYPE_BIT_STRING) {
// return false;
//}
if ($temp[$i]['type'] != self::TYPE_BIT_STRING) {
return false;
}
$current['content'].= substr($temp[$i]['content'], 1);
}
// all subtags should be bit strings
//if ($temp[$last]['type'] != self::TYPE_BIT_STRING) {
// return false;
//}
if ($temp[$last]['type'] != self::TYPE_BIT_STRING) {
return false;
}
$current['content'] = $temp[$last]['content'][0] . $current['content'] . substr($temp[$i]['content'], 1);
}
break;
@ -395,9 +405,9 @@ class ASN1
}
$content_pos += $temp['length'];
// all subtags should be octet strings
//if ($temp['type'] != self::TYPE_OCTET_STRING) {
// return false;
//}
if ($temp['type'] != self::TYPE_OCTET_STRING) {
return false;
}
$current['content'].= $temp['content'];
$length+= $temp['length'];
}
@ -408,12 +418,15 @@ class ASN1
break;
case self::TYPE_NULL:
// "The contents octets shall not contain any octets." -- paragraph 8.8.2
//if (strlen($content)) {
// return false;
//}
if ($constructed || strlen($content)) {
return false;
}
break;
case self::TYPE_SEQUENCE:
case self::TYPE_SET:
if (!$constructed) {
return false;
}
$offset = 0;
$current['content'] = array();
$content_len = strlen($content);
@ -434,7 +447,13 @@ class ASN1
}
break;
case self::TYPE_OBJECT_IDENTIFIER:
if ($constructed) {
return false;
}
$current['content'] = $this->_decodeOID(substr($content, $content_pos));
if ($current['content'] === false) {
return false;
}
break;
/* Each character string type shall be encoded as if it had been declared:
[UNIVERSAL x] IMPLICIT OCTET STRING
@ -464,12 +483,20 @@ class ASN1
case self::TYPE_UTF8_STRING:
// ????
case self::TYPE_BMP_STRING:
if ($constructed) {
return false;
}
$current['content'] = substr($content, $content_pos);
break;
case self::TYPE_UTC_TIME:
case self::TYPE_GENERALIZED_TIME:
if ($constructed) {
return false;
}
$current['content'] = $this->_decodeTime(substr($content, $content_pos), $tag);
break;
default:
return false;
}
$start+= $length;
@ -790,7 +817,7 @@ class ASN1
*
* @param string $source
* @param string $mapping
* @param int $idx
* @param array $special
* @return string
* @access public
*/
@ -806,6 +833,7 @@ class ASN1
* @param string $source
* @param string $mapping
* @param int $idx
* @param array $special
* @return string
* @access private
*/
@ -965,7 +993,10 @@ class ASN1
case self::TYPE_GENERALIZED_TIME:
$format = $mapping['type'] == self::TYPE_UTC_TIME ? 'y' : 'Y';
$format.= 'mdHis';
// if $source does _not_ include timezone information within it then assume that the timezone is GMT
$date = new DateTime($source, new DateTimeZone('GMT'));
// if $source _does_ include timezone information within it then convert the time to GMT
$date->setTimezone(new DateTimeZone('GMT'));
$value = $date->format($format) . 'Z';
break;
case self::TYPE_BIT_STRING:
@ -1126,6 +1157,11 @@ class ASN1
$oid = array();
$pos = 0;
$len = strlen($content);
if (ord($content[$len - 1]) & 0x80) {
return false;
}
$n = new BigInteger();
while ($pos < $len) {
$temp = ord($content[$pos++]);
@ -1161,7 +1197,7 @@ class ASN1
* Called by _encode_der()
*
* @access private
* @param string $content
* @param string $source
* @return string
*/
function _encodeOID($source)

View File

@ -1608,7 +1608,7 @@ class X509
* Map extension values from octet string to extension-specific internal
* format.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
@ -1661,7 +1661,7 @@ class X509
* Map extension values from extension-specific internal format to
* octet string.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
@ -1727,7 +1727,7 @@ class X509
* Map attribute values from ANY type to attribute-specific internal
* format.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
@ -1768,7 +1768,7 @@ class X509
* Map attribute values from attribute-specific internal format to
* ANY type.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
@ -1811,7 +1811,7 @@ class X509
* Map DN values from ANY type to DN-specific internal
* format.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
@ -1841,7 +1841,7 @@ class X509
* Map DN values from DN-specific internal format to
* ANY type.
*
* @param array ref $root
* @param array $root (by reference)
* @param string $path
* @param object $asn1
* @access private
@ -3195,7 +3195,8 @@ class X509
/**
* Load a Certificate Signing Request
*
* @param string $csr
* @param string|array $csr
* @param int $mode
* @access public
* @return mixed
*/
@ -3332,7 +3333,7 @@ class X509
*
* https://developer.mozilla.org/en-US/docs/HTML/Element/keygen
*
* @param string $csr
* @param string|array $spkac
* @access public
* @return mixed
*/
@ -3403,7 +3404,7 @@ class X509
/**
* Save a SPKAC CSR request
*
* @param array $csr
* @param string|array $spkac
* @param int $format optional
* @access public
* @return string
@ -3447,6 +3448,7 @@ class X509
* Load a Certificate Revocation List
*
* @param string $crl
* @param int $mode
* @access public
* @return mixed
*/
@ -4043,8 +4045,7 @@ class X509
/**
* X.509 certificate signing helper function.
*
* @param object $key
* @param \phpseclib\File\X509 $subject
* @param \phpseclib\File\X509 $key
* @param string $signatureAlgorithm
* @access public
* @return mixed
@ -4119,7 +4120,7 @@ class X509
* Set Serial Number
*
* @param string $serial
* @param $base optional
* @param int $base optional
* @access public
*/
function setSerialNumber($serial, $base = -256)
@ -4782,7 +4783,6 @@ class X509
* Set the IP Addresses's which the cert is to be valid for
*
* @access public
* @param string $ipAddress optional
*/
function setIPAddress()
{
@ -5054,11 +5054,16 @@ class X509
* subject=/O=organization/OU=org unit/CN=common name
* issuer=/O=organization/CN=common name
*/
$temp = preg_replace('#.*?^-+[^-]+-+[\r\n ]*$#ms', '', $str, 1);
// remove the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- stuff
$temp = preg_replace('#-+[^-]+-+#', '', $temp);
if (strlen($str) > ini_get('pcre.backtrack_limit')) {
$temp = $str;
} else {
$temp = preg_replace('#.*?^-+[^-]+-+[\r\n ]*$#ms', '', $str, 1);
$temp = preg_replace('#-+END.*[\r\n ]*.*#ms', '', $temp, 1);
}
// remove new lines
$temp = str_replace(array("\r", "\n", ' '), '', $temp);
// remove the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- stuff
$temp = preg_replace('#^-+[^-]+-+|-+[^-]+-+$#', '', $temp);
$temp = preg_match('#^[a-zA-Z\d/+]*={0,2}$#', $temp) ? base64_decode($temp) : false;
return $temp != false ? $temp : $str;
}

View File

@ -243,7 +243,7 @@ class BigInteger
* ?>
* </code>
*
* @param $x base-10 number or base-$base number if $base set.
* @param int|string|resource $x base-10 number or base-$base number if $base set.
* @param int $base
* @return \phpseclib\Math\BigInteger
* @access public
@ -658,11 +658,11 @@ class BigInteger
{
$hex = $this->toHex($twos_compliment);
$bits = '';
for ($i = strlen($hex) - 8, $start = strlen($hex) & 7; $i >= $start; $i-=8) {
$bits = str_pad(decbin(hexdec(substr($hex, $i, 8))), 32, '0', STR_PAD_LEFT) . $bits;
for ($i = strlen($hex) - 6, $start = strlen($hex) % 6; $i >= $start; $i-=6) {
$bits = str_pad(decbin(hexdec(substr($hex, $i, 6))), 24, '0', STR_PAD_LEFT) . $bits;
}
if ($start) { // hexdec('') == 0
$bits = str_pad(decbin(hexdec(substr($hex, 0, $start))), 8, '0', STR_PAD_LEFT) . $bits;
$bits = str_pad(decbin(hexdec(substr($hex, 0, $start))), 8 * $start, '0', STR_PAD_LEFT) . $bits;
}
$result = $this->precision > 0 ? substr($bits, -$this->precision) : ltrim($bits, '0');
@ -1994,7 +1994,7 @@ class BigInteger
*
* @see self::_slidingWindow()
* @access private
* @param \phpseclib\Math\BigInteger
* @param \phpseclib\Math\BigInteger $n
* @return \phpseclib\Math\BigInteger
*/
function _mod2($n)
@ -2688,7 +2688,7 @@ class BigInteger
* Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y).
*
* @param \phpseclib\Math\BigInteger $y
* @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @return int that is < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public
* @see self::equals()
* @internal Could return $this->subtract($x), but that's not as fast as what we do do.
@ -3090,7 +3090,7 @@ class BigInteger
*
* Byte length is equal to $length. Uses \phpseclib\Crypt\Random if it's loaded and mt_rand if it's not.
*
* @param int $length
* @param int $size
* @return \phpseclib\Math\BigInteger
* @access private
*/
@ -3557,7 +3557,7 @@ class BigInteger
*
* Removes leading zeros and truncates (if necessary) to maintain the appropriate precision
*
* @param \phpseclib\Math\BigInteger
* @param \phpseclib\Math\BigInteger $result
* @return \phpseclib\Math\BigInteger
* @see self::_trim()
* @access private
@ -3634,8 +3634,8 @@ class BigInteger
/**
* Array Repeat
*
* @param $input Array
* @param $multiplier mixed
* @param array $input
* @param mixed $multiplier
* @return array
* @access private
*/
@ -3649,8 +3649,8 @@ class BigInteger
*
* Shifts binary strings $shift bits, essentially multiplying by 2**$shift.
*
* @param $x String
* @param $shift Integer
* @param string $x (by reference)
* @param int $shift
* @return string
* @access private
*/
@ -3678,8 +3678,8 @@ class BigInteger
*
* Shifts binary strings $shift bits, essentially dividing by 2**$shift and returning the remainder.
*
* @param $x String
* @param $shift Integer
* @param string $x (by referenc)
* @param int $shift
* @return string
* @access private
*/

View File

@ -259,6 +259,26 @@ class SFTP extends SSH2
*/
var $requestBuffer = array();
/**
* Preserve timestamps on file downloads / uploads
*
* @see self::get()
* @see self::put()
* @var bool
* @access private
*/
var $preserveTime = false;
/**
* Was the last packet due to the channels being closed or not?
*
* @see self::get()
* @see self::get_sftp_packet()
* @var bool
* @access private
*/
var $channel_close = false;
/**
* Default Constructor.
*
@ -406,7 +426,6 @@ class SFTP extends SSH2
* Login
*
* @param string $username
* @param string $password
* @return bool
* @access public
*/
@ -416,6 +435,17 @@ class SFTP extends SSH2
return false;
}
return $this->_init_sftp_connection();
}
/**
* (Re)initializes the SFTP channel
*
* @return bool
* @access private
*/
function _init_sftp_connection()
{
$this->window_size_server_to_client[self::CHANNEL] = $this->window_size;
$packet = pack(
@ -719,7 +749,7 @@ class SFTP extends SSH2
}
}
if ($path[0] != '/') {
if (!strlen($path) || $path[0] != '/') {
$path = $this->pwd . '/' . $path;
}
@ -1015,7 +1045,7 @@ class SFTP extends SSH2
uasort($contents, array(&$this, '_comparator'));
}
return $raw ? $contents : array_keys($contents);
return $raw ? $contents : array_map('strval', array_keys($contents));
}
/**
@ -1198,6 +1228,9 @@ class SFTP extends SSH2
$temp = &$this->stat_cache;
$max = count($dirs) - 1;
foreach ($dirs as $i => $dir) {
if (!is_array($temp)) {
return false;
}
if ($i === $max) {
unset($temp[$dir]);
return true;
@ -1214,7 +1247,7 @@ class SFTP extends SSH2
*
* Mainly used by file_exists
*
* @param string $dir
* @param string $path
* @return mixed
* @access private
*/
@ -1224,6 +1257,9 @@ class SFTP extends SSH2
$temp = &$this->stat_cache;
foreach ($dirs as $dir) {
if (!is_array($temp)) {
return null;
}
if (!isset($temp[$dir])) {
return null;
}
@ -1766,6 +1802,8 @@ class SFTP extends SSH2
* Creates a directory.
*
* @param string $dir
* @param int $mode
* @param bool $recursive
* @return bool
* @access public
*/
@ -1798,6 +1836,7 @@ class SFTP extends SSH2
* Helper function for directory creation
*
* @param string $dir
* @param int $mode
* @return bool
* @access private
*/
@ -2018,8 +2057,8 @@ class SFTP extends SSH2
$sent = 0;
$size = $size < 0 ? ($size & 0x7FFFFFFF) + 0x80000000 : $size;
$sftp_packet_size = 4096; // PuTTY uses 4096
// make the SFTP packet be exactly 4096 bytes by including the bytes in the NET_SFTP_WRITE packets "header"
$sftp_packet_size = $this->max_sftp_packet;
// make the SFTP packet be exactly the SFTP packet size by including the bytes in the NET_SFTP_WRITE packets "header"
$sftp_packet_size-= strlen($handle) + 25;
$i = $j = 0;
while ($dataCallback || ($size === 0 || $sent < $size)) {
@ -2069,7 +2108,14 @@ class SFTP extends SSH2
}
if ($mode & self::SOURCE_LOCAL_FILE) {
fclose($fp);
if ($this->preserveTime) {
$stat = fstat($fp);
$this->touch($remote_file, $stat['mtime'], $stat['atime']);
}
if (isset($fp) && is_resource($fp)) {
fclose($fp);
}
}
return $this->_close_handle($handle);
@ -2192,7 +2238,7 @@ class SFTP extends SSH2
$res_offset = $stat['size'];
} else {
$res_offset = 0;
if ($local_file !== false) {
if ($local_file !== false && !is_callable($local_file)) {
$fp = fopen($local_file, 'wb');
if (!$fp) {
return false;
@ -2202,7 +2248,7 @@ class SFTP extends SSH2
}
}
$fclose_check = $local_file !== false && !is_resource($local_file);
$fclose_check = $local_file !== false && !is_callable($local_file) && !is_resource($local_file);
$start = $offset;
$read = 0;
@ -2223,9 +2269,6 @@ class SFTP extends SSH2
}
$packet = null;
$read+= $packet_size;
if (is_callable($progressCallback)) {
call_user_func($progressCallback, $read);
}
$i++;
}
@ -2252,9 +2295,14 @@ class SFTP extends SSH2
$offset+= strlen($temp);
if ($local_file === false) {
$content.= $temp;
} elseif (is_callable($local_file)) {
$local_file($temp);
} else {
fputs($fp, $temp);
}
if (is_callable($progressCallback)) {
call_user_func($progressCallback, $offset);
}
$temp = null;
break;
case NET_SFTP_STATUS:
@ -2266,7 +2314,13 @@ class SFTP extends SSH2
if ($fclose_check) {
fclose($fp);
}
user_error('Expected SSH_FX_DATA or SSH_FXP_STATUS');
// maybe the file was successfully transferred, maybe it wasn't
if ($this->channel_close) {
$this->_init_sftp_connection();
return false;
} else {
user_error('Expected SSH_FX_DATA or SSH_FXP_STATUS');
}
}
$response = null;
}
@ -2286,6 +2340,11 @@ class SFTP extends SSH2
if ($fclose_check) {
fclose($fp);
if ($this->preserveTime) {
$stat = $this->stat($remote_file);
touch($local_file, $stat['mtime'], $stat['atime']);
}
}
if (!$this->_close_handle($handle)) {
@ -2707,6 +2766,7 @@ class SFTP extends SSH2
*
* @param string $path
* @param string $prop
* @param mixed $type
* @return mixed
* @access private
*/
@ -2947,6 +3007,7 @@ class SFTP extends SSH2
*
* @param int $type
* @param string $data
* @param int $request_id
* @see self::_get_sftp_packet()
* @see self::_send_channel_packet()
* @return bool
@ -2954,6 +3015,10 @@ class SFTP extends SSH2
*/
function _send_sftp_packet($type, $data, $request_id = 1)
{
// in SSH2.php the timeout is cumulative per function call. eg. exec() will
// timeout after 10s. but for SFTP.php it's cumulative per packet
$this->curTimeout = $this->timeout;
$packet = $this->use_request_id ?
pack('NCNa*', strlen($data) + 5, $type, $request_id, $data) :
pack('NCa*', strlen($data) + 1, $type, $data);
@ -2966,9 +3031,17 @@ class SFTP extends SSH2
$packet_type = '-> ' . $this->packet_types[$type] .
' (' . round($stop - $start, 4) . 's)';
if (NET_SFTP_LOGGING == self::LOG_REALTIME) {
echo "<pre>\r\n" . $this->_format_log(array($data), array($packet_type)) . "\r\n</pre>\r\n";
flush();
ob_flush();
switch (PHP_SAPI) {
case 'cli':
$start = $stop = "\r\n";
break;
default:
$start = '<pre>';
$stop = '</pre>';
}
echo $start . $this->_format_log(array($data), array($packet_type)) . $stop;
@flush();
@ob_flush();
} else {
$this->packet_type_log[] = $packet_type;
if (NET_SFTP_LOGGING == self::LOG_COMPLEX) {
@ -3009,6 +3082,8 @@ class SFTP extends SSH2
*/
function _get_sftp_packet($request_id = null)
{
$this->channel_close = false;
if (isset($request_id) && isset($this->requestBuffer[$request_id])) {
$this->packet_type = $this->requestBuffer[$request_id]['packet_type'];
$temp = $this->requestBuffer[$request_id]['packet'];
@ -3025,7 +3100,10 @@ class SFTP extends SSH2
// SFTP packet length
while (strlen($this->packet_buffer) < 4) {
$temp = $this->_get_channel_packet(self::CHANNEL, true);
if (is_bool($temp)) {
if ($temp === true) {
if ($this->channel_status[self::CHANNEL] === NET_SSH2_MSG_CHANNEL_CLOSE) {
$this->channel_close = true;
}
$this->packet_type = false;
$this->packet_buffer = '';
return false;
@ -3075,9 +3153,17 @@ class SFTP extends SSH2
$packet_type = '<- ' . $this->packet_types[$this->packet_type] .
' (' . round($stop - $start, 4) . 's)';
if (NET_SFTP_LOGGING == self::LOG_REALTIME) {
echo "<pre>\r\n" . $this->_format_log(array($packet), array($packet_type)) . "\r\n</pre>\r\n";
flush();
ob_flush();
switch (PHP_SAPI) {
case 'cli':
$start = $stop = "\r\n";
break;
default:
$start = '<pre>';
$stop = '</pre>';
}
echo $start . $this->_format_log(array($packet), array($packet_type)) . $stop;
@flush();
@ob_flush();
} else {
$this->packet_type_log[] = $packet_type;
if (NET_SFTP_LOGGING == self::LOG_COMPLEX) {
@ -3170,4 +3256,24 @@ class SFTP extends SSH2
$this->pwd = false;
parent::_disconnect($reason);
}
/**
* Enable Date Preservation
*
* @access public
*/
function enableDatePreservation()
{
$this->preserveTime = true;
}
/**
* Disable Date Preservation
*
* @access public
*/
function disableDatePreservation()
{
$this->preserveTime = false;
}
}

View File

@ -410,7 +410,7 @@ class Stream
{
switch ($whence) {
case SEEK_SET:
if ($offset >= $this->size || $offset < 0) {
if ($offset < 0) {
return false;
}
break;
@ -447,7 +447,9 @@ class Stream
// and https://github.com/php/php-src/blob/master/main/php_streams.h#L592
switch ($option) {
case 1: // PHP_STREAM_META_TOUCH
return $this->sftp->touch($path, $var[0], $var[1]);
$time = isset($var[0]) ? $var[0] : null;
$atime = isset($var[1]) ? $var[1] : null;
return $this->sftp->touch($path, $time, $atime);
case 2: // PHP_STREAM_OWNER_NAME
case 3: // PHP_STREAM_GROUP_NAME
return false;
@ -626,7 +628,6 @@ class Stream
* $options. What does 8 correspond to?
*
* @param string $path
* @param int $mode
* @param int $options
* @return bool
* @access public
@ -768,8 +769,8 @@ class Stream
* If NET_SFTP_STREAM_LOGGING is defined all calls will be output on the screen and then (regardless of whether or not
* NET_SFTP_STREAM_LOGGING is enabled) the parameters will be passed through to the appropriate method.
*
* @param string
* @param array
* @param string $name
* @param array $arguments
* @return mixed
* @access public
*/

View File

@ -812,6 +812,7 @@ class SSH1
* @see self::interactiveRead()
* @see self::interactiveWrite()
* @param string $cmd
* @param bool $block
* @return mixed
* @access public
*/
@ -1385,7 +1386,6 @@ class SSH1
* named constants from it, using the value as the name of the constant and the index as the value of the constant.
* If any of the constants that would be defined already exists, none of the constants will be defined.
*
* @param array $array
* @access private
*/
function _define_array()
@ -1584,7 +1584,8 @@ class SSH1
*
* Makes sure that only the last 1MB worth of packets will be logged
*
* @param string $data
* @param int $protocol_flags
* @param string $message
* @access private
*/
function _append_log($protocol_flags, $message)

View File

@ -687,6 +687,14 @@ class SSH2
*/
var $curTimeout;
/**
* Keep Alive Interval
*
* @see self::setKeepAlive()
* @access private
*/
var $keepAlive;
/**
* Real-time log file pointer
*
@ -962,6 +970,14 @@ class SSH2
*/
var $auth = array();
/**
* The authentication methods that may productively continue authentication.
*
* @see https://tools.ietf.org/html/rfc4252#section-5.1
* @var array|null
*/
private $auth_methods_to_continue = null;
/**
* Default Constructor.
*
@ -1339,6 +1355,7 @@ class SSH2
function _key_exchange($kexinit_payload_server = false)
{
$preferred = $this->preferred;
$send_kex = true;
$kex_algorithms = isset($preferred['kex']) ?
$preferred['kex'] :
@ -1422,7 +1439,7 @@ class SSH2
0
);
if ($this->send_kex_first) {
if ($kexinit_payload_server === false) {
if (!$this->_send_binary_packet($kexinit_payload_client)) {
return false;
}
@ -1438,6 +1455,8 @@ class SSH2
user_error('Expected SSH_MSG_KEXINIT');
return false;
}
$send_kex = false;
}
$response = $kexinit_payload_server;
@ -1510,7 +1529,7 @@ class SSH2
extract(unpack('Cfirst_kex_packet_follows', $this->_string_shift($response, 1)));
$first_kex_packet_follows = $first_kex_packet_follows != 0;
if (!$this->send_kex_first && !$this->_send_binary_packet($kexinit_payload_client)) {
if ($send_kex && !$this->_send_binary_packet($kexinit_payload_client)) {
return false;
}
@ -1538,6 +1557,32 @@ class SSH2
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
$server_host_key_algorithm = $this->_array_intersect_first($server_host_key_algorithms, $this->server_host_key_algorithms);
if ($server_host_key_algorithm === false) {
user_error('No compatible server host key algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
$mac_algorithm_in = $this->_array_intersect_first($s2c_mac_algorithms, $this->mac_algorithms_server_to_client);
if ($mac_algorithm_in === false) {
user_error('No compatible server to client message authentication algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
$compression_algorithm_out = $this->_array_intersect_first($c2s_compression_algorithms, $this->compression_algorithms_client_to_server);
if ($compression_algorithm_out === false) {
user_error('No compatible client to server compression algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
//$this->decompress = $compression_algorithm_out == 'zlib';
$compression_algorithm_in = $this->_array_intersect_first($s2c_compression_algorithms, $this->compression_algorithms_client_to_server);
if ($compression_algorithm_in === false) {
user_error('No compatible server to client compression algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
//$this->compress = $compression_algorithm_in == 'zlib';
// Only relevant in diffie-hellman-group-exchange-sha{1,256}, otherwise empty.
$exchange_hash_rfc4419 = '';
@ -1773,12 +1818,6 @@ class SSH2
$this->session_id = $this->exchange_hash;
}
$server_host_key_algorithm = $this->_array_intersect_first($server_host_key_algorithms, $this->server_host_key_algorithms);
if ($server_host_key_algorithm === false) {
user_error('No compatible server host key algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
switch ($server_host_key_algorithm) {
case 'ssh-dss':
$expected_key_format = 'ssh-dss';
@ -1903,14 +1942,14 @@ class SSH2
$this->decrypt->decrypt(str_repeat("\0", 1536));
}
$mac_algorithm = $this->_array_intersect_first($c2s_mac_algorithms, $this->mac_algorithms_client_to_server);
if ($mac_algorithm === false) {
$mac_algorithm_out = $this->_array_intersect_first($c2s_mac_algorithms, $this->mac_algorithms_client_to_server);
if ($mac_algorithm_out === false) {
user_error('No compatible client to server message authentication algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
$createKeyLength = 0; // ie. $mac_algorithm == 'none'
switch ($mac_algorithm) {
switch ($mac_algorithm_out) {
case 'hmac-sha2-256':
$this->hmac_create = new Hash('sha256');
$createKeyLength = 32;
@ -1931,17 +1970,11 @@ class SSH2
$this->hmac_create = new Hash('md5-96');
$createKeyLength = 16;
}
$this->hmac_create->name = $mac_algorithm;
$mac_algorithm = $this->_array_intersect_first($s2c_mac_algorithms, $this->mac_algorithms_server_to_client);
if ($mac_algorithm === false) {
user_error('No compatible server to client message authentication algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
$this->hmac_create->name = $mac_algorithm_out;
$checkKeyLength = 0;
$this->hmac_size = 0;
switch ($mac_algorithm) {
switch ($mac_algorithm_in) {
case 'hmac-sha2-256':
$this->hmac_check = new Hash('sha256');
$checkKeyLength = 32;
@ -1967,7 +2000,7 @@ class SSH2
$checkKeyLength = 16;
$this->hmac_size = 12;
}
$this->hmac_check->name = $mac_algorithm;
$this->hmac_check->name = $mac_algorithm_in;
$key = $kexHash->hash($keyBytes . $this->exchange_hash . 'E' . $this->session_id);
while ($createKeyLength > strlen($key)) {
@ -1981,20 +2014,6 @@ class SSH2
}
$this->hmac_check->setKey(substr($key, 0, $checkKeyLength));
$compression_algorithm = $this->_array_intersect_first($c2s_compression_algorithms, $this->compression_algorithms_client_to_server);
if ($compression_algorithm === false) {
user_error('No compatible client to server compression algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
//$this->decompress = $compression_algorithm == 'zlib';
$compression_algorithm = $this->_array_intersect_first($s2c_compression_algorithms, $this->compression_algorithms_client_to_server);
if ($compression_algorithm === false) {
user_error('No compatible server to client compression algorithms found');
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
//$this->compress = $compression_algorithm == 'zlib';
return true;
}
@ -2112,8 +2131,6 @@ class SSH2
* The $password parameter can be a plaintext password, a \phpseclib\Crypt\RSA object or an array
*
* @param string $username
* @param mixed $password
* @param mixed $...
* @return bool
* @see self::_login()
* @access public
@ -2125,11 +2142,13 @@ class SSH2
// try logging with 'none' as an authentication method first since that's what
// PuTTY does
if ($this->_login($username)) {
return true;
}
if (count($args) == 1) {
return false;
if (substr($this->server_identifier, 0, 13) != 'SSH-2.0-CoreFTP' && $this->auth_methods_to_continue === null) {
if ($this->_login($username)) {
return true;
}
if (count($args) == 1) {
return false;
}
}
return call_user_func_array(array(&$this, '_login'), $args);
}
@ -2138,8 +2157,6 @@ class SSH2
* Login Helper
*
* @param string $username
* @param mixed $password
* @param mixed $...
* @return bool
* @see self::_login_helper()
* @access private
@ -2269,7 +2286,9 @@ class SSH2
case NET_SSH2_MSG_USERAUTH_SUCCESS:
$this->bitmap |= self::MASK_LOGIN;
return true;
//case NET_SSH2_MSG_USERAUTH_FAILURE:
case NET_SSH2_MSG_USERAUTH_FAILURE:
extract(unpack('Nmethodlistlen', $this->_string_shift($response, 4)));
$this->auth_methods_to_continue = explode(',', $this->_string_shift($response, $methodlistlen));
default:
return false;
}
@ -2341,6 +2360,7 @@ class SSH2
}
extract(unpack('Nlength', $this->_string_shift($response, 4)));
$auth_methods = explode(',', $this->_string_shift($response, $length));
$this->auth_methods_to_continue = $auth_methods;
if (!strlen($response)) {
return false;
}
@ -2400,7 +2420,6 @@ class SSH2
/**
* Handle the keyboard-interactive requests / responses.
*
* @param string $responses...
* @return bool
* @access private
*/
@ -2514,6 +2533,8 @@ class SSH2
case NET_SSH2_MSG_USERAUTH_SUCCESS:
return true;
case NET_SSH2_MSG_USERAUTH_FAILURE:
extract(unpack('Nmethodlistlen', $this->_string_shift($response, 4)));
$this->auth_methods_to_continue = explode(',', $this->_string_shift($response, $methodlistlen));
return false;
}
@ -2545,7 +2566,7 @@ class SSH2
* Login with an RSA private key
*
* @param string $username
* @param \phpseclib\Crypt\RSA $password
* @param \phpseclib\Crypt\RSA $privatekey
* @return bool
* @access private
* @internal It might be worthwhile, at some point, to protect against {@link http://tools.ietf.org/html/rfc4251#section-9.3.9 traffic analysis}
@ -2622,13 +2643,21 @@ class SSH2
if (strlen($response) < 4) {
return false;
}
extract(unpack('Nlength', $this->_string_shift($response, 4)));
$this->errors[] = 'SSH_MSG_USERAUTH_FAILURE: ' . $this->_string_shift($response, $length);
extract(unpack('Nmethodlistlen', $this->_string_shift($response, 4)));
$this->auth_methods_to_continue = explode(',', $this->_string_shift($response, $methodlistlen));
$this->errors[] = 'SSH_MSG_USERAUTH_FAILURE';
return false;
case NET_SSH2_MSG_USERAUTH_PK_OK:
// we'll just take it on faith that the public key blob and the public key algorithm name are as
// they should be
$this->_updateLogHistory('UNKNOWN (60)', 'NET_SSH2_MSG_USERAUTH_PK_OK');
break;
case NET_SSH2_MSG_USERAUTH_SUCCESS:
$this->bitmap |= self::MASK_LOGIN;
return true;
default:
user_error('Unexpected response to publickey authentication pt 1');
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
}
$packet = $part1 . chr(1) . $part2;
@ -2657,13 +2686,16 @@ class SSH2
switch ($type) {
case NET_SSH2_MSG_USERAUTH_FAILURE:
// either the login is bad or the server employs multi-factor authentication
extract(unpack('Nmethodlistlen', $this->_string_shift($response, 4)));
$this->auth_methods_to_continue = explode(',', $this->_string_shift($response, $methodlistlen));
return false;
case NET_SSH2_MSG_USERAUTH_SUCCESS:
$this->bitmap |= self::MASK_LOGIN;
return true;
}
return false;
user_error('Unexpected response to publickey authentication pt 2');
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
}
/**
@ -2680,6 +2712,19 @@ class SSH2
$this->timeout = $this->curTimeout = $timeout;
}
/**
* Set Keep Alive
*
* Sends an SSH2_MSG_IGNORE message every x seconds, if x is a positive non-zero number.
*
* @param int $interval
* @access public
*/
function setKeepAlive($interval)
{
$this->keepAlive = $interval;
}
/**
* Get the output from stdError
*
@ -2909,28 +2954,6 @@ class SSH2
return false;
}
$response = $this->_get_binary_packet();
if ($response === false) {
$this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
if (!strlen($response)) {
return false;
}
list(, $type) = unpack('C', $this->_string_shift($response, 1));
switch ($type) {
case NET_SSH2_MSG_CHANNEL_SUCCESS:
// if a pty can't be opened maybe commands can still be executed
case NET_SSH2_MSG_CHANNEL_FAILURE:
break;
default:
user_error('Unable to request pseudo-terminal');
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
}
$packet = pack(
'CNNa*C',
NET_SSH2_MSG_CHANNEL_REQUEST,
@ -2943,14 +2966,7 @@ class SSH2
return false;
}
$this->channel_status[self::CHANNEL_SHELL] = NET_SSH2_MSG_CHANNEL_REQUEST;
$response = $this->_get_channel_packet(self::CHANNEL_SHELL);
if ($response === false) {
return false;
}
$this->channel_status[self::CHANNEL_SHELL] = NET_SSH2_MSG_CHANNEL_DATA;
$this->channel_status[self::CHANNEL_SHELL] = NET_SSH2_MSG_IGNORE;
$this->bitmap |= self::MASK_SHELL;
@ -3004,7 +3020,7 @@ class SSH2
* @see self::write()
* @param string $expect
* @param int $mode
* @return string
* @return string|bool
* @access public
*/
function read($expect = '', $mode = self::READ_SIMPLE)
@ -3318,6 +3334,54 @@ class SSH2
*/
function _get_binary_packet($skip_channel_filter = false)
{
if ($skip_channel_filter) {
$read = array($this->fsock);
$write = $except = null;
if (!$this->curTimeout) {
if ($this->keepAlive <= 0) {
@stream_select($read, $write, $except, null);
} else {
if (!@stream_select($read, $write, $except, $this->keepAlive) && !count($read)) {
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0));
return $this->_get_binary_packet(true);
}
}
} else {
if ($this->curTimeout < 0) {
$this->is_timeout = true;
return true;
}
$read = array($this->fsock);
$write = $except = null;
$start = microtime(true);
if ($this->keepAlive > 0 && $this->keepAlive < $this->curTimeout) {
if (!@stream_select($read, $write, $except, $this->keepAlive) && !count($read)) {
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0));
$elapsed = microtime(true) - $start;
$this->curTimeout-= $elapsed;
return $this->_get_binary_packet(true);
}
$elapsed = microtime(true) - $start;
$this->curTimeout-= $elapsed;
}
$sec = floor($this->curTimeout);
$usec = 1000000 * ($this->curTimeout - $sec);
// on windows this returns a "Warning: Invalid CRT parameters detected" error
if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) {
$this->is_timeout = true;
return true;
}
$elapsed = microtime(true) - $start;
$this->curTimeout-= $elapsed;
}
}
if (!is_resource($this->fsock) || feof($this->fsock)) {
$this->bitmap = 0;
user_error('Connection closed prematurely');
@ -3468,10 +3532,24 @@ class SSH2
// only called when we've already logged in
if (($this->bitmap & self::MASK_CONNECTED) && $this->isAuthenticated()) {
if (is_bool($payload)) {
return $payload;
}
switch (ord($payload[0])) {
case NET_SSH2_MSG_CHANNEL_REQUEST:
if (strlen($payload) == 31) {
extract(unpack('cpacket_type/Nchannel/Nlength', $payload));
if (substr($payload, 9, $length) == 'keepalive@openssh.com' && isset($this->server_channels[$channel])) {
if (ord(substr($payload, 9 + $length))) { // want reply
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_SUCCESS, $this->server_channels[$channel]));
}
$payload = $this->_get_binary_packet($skip_channel_filter);
}
}
break;
case NET_SSH2_MSG_CHANNEL_DATA:
case NET_SSH2_MSG_CHANNEL_EXTENDED_DATA:
case NET_SSH2_MSG_CHANNEL_REQUEST:
case NET_SSH2_MSG_CHANNEL_CLOSE:
case NET_SSH2_MSG_CHANNEL_EOF:
if (!$skip_channel_filter && !empty($this->server_channels)) {
@ -3651,8 +3729,9 @@ class SSH2
*
* Returns the data as a string if it's available and false if not.
*
* @param $client_channel
* @return mixed
* @param int $client_channel
* @param bool $skip_extended
* @return mixed|bool
* @access private
*/
function _get_channel_packet($client_channel, $skip_extended = false)
@ -3666,36 +3745,13 @@ class SSH2
$response = $this->binary_packet_buffer;
$this->binary_packet_buffer = false;
} else {
$read = array($this->fsock);
$write = $except = null;
if (!$this->curTimeout) {
@stream_select($read, $write, $except, null);
} else {
if ($this->curTimeout < 0) {
$this->is_timeout = true;
return true;
}
$read = array($this->fsock);
$write = $except = null;
$start = microtime(true);
$sec = floor($this->curTimeout);
$usec = 1000000 * ($this->curTimeout - $sec);
// on windows this returns a "Warning: Invalid CRT parameters detected" error
if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) {
$this->is_timeout = true;
if ($client_channel == self::CHANNEL_EXEC && !$this->request_pty) {
$this->_close_channel($client_channel);
}
return true;
}
$elapsed = microtime(true) - $start;
$this->curTimeout-= $elapsed;
}
$response = $this->_get_binary_packet(true);
if ($response === true && $this->is_timeout) {
if ($client_channel == self::CHANNEL_EXEC && !$this->request_pty) {
$this->_close_channel($client_channel);
}
return true;
}
if ($response === false) {
$this->bitmap = 0;
user_error('Connection closed by server');
@ -3843,6 +3899,16 @@ class SSH2
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
}
break;
case NET_SSH2_MSG_IGNORE:
switch ($type) {
case NET_SSH2_MSG_CHANNEL_SUCCESS:
//$this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_DATA;
continue 3;
case NET_SSH2_MSG_CHANNEL_FAILURE:
user_error('Error opening channel');
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
}
break;
case NET_SSH2_MSG_CHANNEL_REQUEST:
switch ($type) {
case NET_SSH2_MSG_CHANNEL_SUCCESS:
@ -3862,6 +3928,10 @@ class SSH2
switch ($type) {
case NET_SSH2_MSG_CHANNEL_DATA:
//if ($this->channel_status[$channel] == NET_SSH2_MSG_IGNORE) {
// $this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_DATA;
//}
/*
if ($channel == self::CHANNEL_EXEC) {
// SCP requires null packets, such as this, be sent. further, in the case of the ssh.com SSH server
@ -3894,7 +3964,7 @@ class SSH2
$this->channel_buffers[$channel][] = $data;
break;
case NET_SSH2_MSG_CHANNEL_CLOSE:
$this->curTimeout = 0;
$this->curTimeout = 5;
if ($this->bitmap & self::MASK_SHELL) {
$this->bitmap&= ~self::MASK_SHELL;
@ -3962,7 +4032,7 @@ class SSH2
$packet.= $hmac;
$start = microtime(true);
$result = strlen($packet) == fputs($this->fsock, $packet);
$result = strlen($packet) == @fputs($this->fsock, $packet);
$stop = microtime(true);
if (defined('NET_SSH2_LOGGING')) {
@ -3982,7 +4052,8 @@ class SSH2
*
* Makes sure that only the last 1MB worth of packets will be logged
*
* @param string $data
* @param string $message_number
* @param string $message
* @access private
*/
function _append_log($message_number, $message)
@ -4123,11 +4194,15 @@ class SSH2
$this->channel_status[$client_channel] = NET_SSH2_MSG_CHANNEL_CLOSE;
$this->curTimeout = 0;
$this->curTimeout = 5;
while (!is_bool($this->_get_channel_packet($client_channel))) {
}
if ($this->is_timeout) {
$this->disconnect();
}
if ($want_reply) {
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$client_channel]));
}
@ -4183,7 +4258,6 @@ class SSH2
* named constants from it, using the value as the name of the constant and the index as the value of the constant.
* If any of the constants that would be defined already exists, none of the constants will be defined.
*
* @param array $array
* @access private
*/
function _define_array()
@ -4599,11 +4673,15 @@ class SSH2
//'none' // OPTIONAL no encryption; NOT RECOMMENDED
);
$engines = array(
Base::ENGINE_OPENSSL,
Base::ENGINE_MCRYPT,
Base::ENGINE_INTERNAL
);
if ($this->crypto_engine) {
$engines = array($this->crypto_engine);
} else {
$engines = array(
Base::ENGINE_OPENSSL,
Base::ENGINE_MCRYPT,
Base::ENGINE_INTERNAL
);
}
$ciphers = array();
foreach ($engines as $engine) {
@ -5088,4 +5166,15 @@ class SSH2
);
}
}
/**
* Return the list of authentication methods that may productively continue authentication.
*
* @see https://tools.ietf.org/html/rfc4252#section-5.1
* @return array|null
*/
public function getAuthMethodsToContinue()
{
return $this->auth_methods_to_continue;
}
}

Some files were not shown because too many files have changed in this diff Show More