Hello! Can I add my own parameters when I check for updates to extensions to the update server address?
Labels |
Added:
?
|
Category | ⇒ | com_joomlaupdate |
Get what will be sent a request to verify the availability of the address added to get the parameters (?login=name&password=123). The password will of course be encrypted.
Standard means of this can not be done?
noup ;(
How to make this update available?
download the release, install the component in the admin like everything should be clear, everything is done as simply and clearly
@motokraft if Issue is solved please close it.
Status | New | ⇒ | Information Required |
The problem is not solved. But the point is to start the flowering
ah, i read Comments by @AlekVolsk as Solution for your Issue, so of course Issue stay open.
And why not put it in the core? Again there will be problems with security, or who is too lazy to do it?
Telling volunteers that they are lazy when you have never contributed is not the way to achieve anything.
Dobrovoltsy is who?
Why not just write - thanks for this idea, we are trying to implement it in the created versions. (well, or something like this)
The way exists, and is by far documented on the web.
Create an installer plugin for your extension, and use this function :
public function onInstallerBeforePackageDownload(&$url, &$headers)
{
// Get the component information from the #__extensions table
JLoader::import('joomla.application.component.helper');
$component = JComponentHelper::getComponent('com_component');
$login = $component->params->get('login', '');
$password = $component->params->get('password', '');
// Bind credentials to request by appending it to the update server url
if ( ! empty($login) && ! empty($password))
{
$separator = strpos($url, '?') !== false ? '&' : '?';
$url .= $separator . 'login=' . $login . '&password=' . $password;
}
return true;
}
who is too lazy to do it?
I wonder who... ;-)
Unfortunately, but I see that Joomla developers are only concerned about the development and security of their own projects. Everything that can't be useful to them is ignored, so I have to write my crutches and bicycles. Issue can be closed, still there will be no solution in the kernel, obviously.
The code suggested by JoomliC comes up half way. It is executed when the file is downloaded. And I need what would be an event when checking access to the .xml file in which there is a lot of update
The features you're looking for are covered by the two comments from @JoomliC
As an extension developer, you should fill in the extra_query
column of the update sites table as documented in #2508 and this will be passed when requesting the update server XML document
Similarly, if you need to send extra information when the actual package is downloaded a plugin hooking the onInstallerBeforePackageDownload
event is required.
What we do not support is a user editable interface for these features, it is up to the developer to create an interface in their extension to gather the extra data to use with these two features.
What cannot be done with the existing API and featureset?
I can not use extra_query, because the transferred data will be dynamic
Based on what factors?
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-06-27 13:54:33 |
Closed_By | ⇒ | motokraft |
I will add to the address
<?php '?login='.$user->username.'&password'.$user->password; ?>
function preparePreUpdate is a good idea
What do you mean by your own parameters? do you want to change the update server for a single extension?