$this->readString('password', false, 'authData');
$this->readString('username', false, 'authData');
$this->readBoolean('saveCredentials', true, 'authData');
+ $this->readBoolean('isStoreCode', true, 'authData');
}
}
$this->parameters['authData']['password'],
$this->parameters['authData']['saveCredentials']
);
+
+ if ($this->parameters['authData']['isStoreCode']) {
+ PackageUpdateServer::enableSecureMode();
+ }
}
$scheduler = new PackageInstallationScheduler($this->parameters['packages']);
*/
protected $metaData = [];
+ /**
+ * Restricts the package server selection to include only
+ * official package servers in case a secure download is
+ * requested.
+ */
+ private static $secureMode = false;
+
/**
* @inheritDoc
*/
$woltlabStoreServer = $packageServer;
} elseif ($packageServer->isDisabled) {
continue;
+ } elseif (self::$secureMode) {
+ // Skip any unofficial servers when the secure mode
+ // was requested.
+ continue;
}
$results[$packageServer->packageUpdateServerID] = $packageServer;
return \current($pluginStoreServer);
}
+ /**
+ * Restricts the available sources to official package
+ * servers when a secure download is requested.
+ */
+ final public static function enableSecureMode(): void
+ {
+ self::$secureMode = true;
+ }
+
/**
* Returns true if the given server url is valid.
*