?
avatar motokraft
motokraft
27 Jun 2018

Hello! Can I add my own parameters when I check for updates to extensions to the update server address?

avatar motokraft motokraft - open - 27 Jun 2018
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jun 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Jun 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Jun 2018
Category com_joomlaupdate
avatar AlekVolsk
AlekVolsk - comment - 27 Jun 2018

What do you mean by your own parameters? do you want to change the update server for a single extension?

avatar motokraft
motokraft - comment - 27 Jun 2018

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.

avatar AlekVolsk
AlekVolsk - comment - 27 Jun 2018

look in the direction of this component, it allows you to add your parameters to the url

avatar motokraft
motokraft - comment - 27 Jun 2018

Standard means of this can not be done?

avatar AlekVolsk
AlekVolsk - comment - 27 Jun 2018

noup ;(

avatar motokraft
motokraft - comment - 27 Jun 2018

How to make this update available?

avatar AlekVolsk
AlekVolsk - comment - 27 Jun 2018

download the release, install the component in the admin like everything should be clear, everything is done as simply and clearly

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Jun 2018

@motokraft if Issue is solved please close it.

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Jun 2018
Status New Information Required
avatar motokraft
motokraft - comment - 27 Jun 2018

The problem is not solved. But the point is to start the flowering

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Jun 2018

ah, i read Comments by @AlekVolsk as Solution for your Issue, so of course Issue stay open.

avatar motokraft
motokraft - comment - 27 Jun 2018

And why not put it in the core? Again there will be problems with security, or who is too lazy to do it?

avatar brianteeman
brianteeman - comment - 27 Jun 2018

Telling volunteers that they are lazy when you have never contributed is not the way to achieve anything.

avatar motokraft
motokraft - comment - 27 Jun 2018

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)

avatar JoomliC
JoomliC - comment - 27 Jun 2018

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... ;-)

avatar JoomliC
JoomliC - comment - 27 Jun 2018

Or this other way (integrated in Joomla core since a bit of time...) : #2508

avatar AlekVolsk
AlekVolsk - comment - 27 Jun 2018

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.

avatar motokraft
motokraft - comment - 27 Jun 2018

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

avatar mbabker
mbabker - comment - 27 Jun 2018

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?

avatar motokraft
motokraft - comment - 27 Jun 2018

I can not use extra_query, because the transferred data will be dynamic

avatar mbabker
mbabker - comment - 27 Jun 2018

Based on what factors?

avatar mbabker
mbabker - comment - 27 Jun 2018

Also note that since 3.7.0 there is this hook which might be of use (though I don't think this one is documented anywhere near as well as the others).

avatar motokraft motokraft - change - 27 Jun 2018
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2018-06-27 13:54:33
Closed_By motokraft
avatar motokraft motokraft - close - 27 Jun 2018
avatar motokraft
motokraft - comment - 27 Jun 2018

I will add to the address
<?php '?login='.$user->username.'&password'.$user->password; ?>
function preparePreUpdate is a good idea

Add a Comment

Login with GitHub to post a comment