SOGo integrator: don’t attempt to install version 60 on TB 52

Dieser Commit ist enthalten in:
Michael Kuron 2018-10-28 14:04:45 +01:00
Ursprung 7ce56666ef
Commit 0659b81242
2 geänderte Dateien mit 29 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -32,6 +32,7 @@ while read DOMAINS; do
sed -i 's/<\/Seq>/<li><Description em:id="sieve@mozdev.org" em:name="Sieve"\/><\/li><li><Description em:id="imap-acl@sirphreak.com" em:name="Imap-ACL-Extension"\/><\/li><\/Seq>/g' custom/${DOMAIN}/chrome/content/extensions.rdf
make build=${DOMAIN}
INTEGRATOR_VER=$(grep em:version install.rdf | awk -F '"' '{print $2}')
INTEGRATOR_MIN_VER=$(grep em:minVersion install.rdf | grep -Eo '[0-9\.]+' | head -n 1)
cp sogo-integrator-*-${DOMAIN}.xpi ../sogo-integrator-${INTEGRATOR_VER}-${DOMAIN}.xpi
cd ..
done
@ -41,6 +42,7 @@ done
cd connector
make
CONNECTOR_VER=$(grep em:version install.rdf | awk -F '"' '{print $2}')
CONNECTOR_MIN_VER=$(grep em:minVersion install.rdf | grep -Eo '[0-9\.]+' | head -n 1)
cp sogo-connector-*.xpi ../sogo-connector-${CONNECTOR_VER}.xpi
cd ..
@ -59,8 +61,8 @@ wget -O imap_acl_extension-${IMAP_ACL_VER}-tb.xpi ${IMAP_ACL_URL}
unset IMAP_ACL_RELEASES
# update version file
echo "sogo-connector@inverse.ca;${CONNECTOR_VER};sogo-connector-${CONNECTOR_VER}.xpi" > version.csv
echo "sogo-integrator@inverse.ca;${INTEGRATOR_VER};sogo-integrator-${INTEGRATOR_VER}-__DOMAIN__.xpi" >> version.csv
echo "sogo-connector@inverse.ca;${CONNECTOR_VER};sogo-connector-${CONNECTOR_VER}.xpi;${CONNECTOR_MIN_VER}" > version.csv
echo "sogo-integrator@inverse.ca;${INTEGRATOR_VER};sogo-integrator-${INTEGRATOR_VER}-__DOMAIN__.xpi;${INTEGRATOR_MIN_VER}" >> version.csv
echo "sieve@mozdev.org;${SIEVE_VER};sieve-${SIEVE_VER}.xpi" >> version.csv
echo "imap-acl@sirphreak.com;${IMAP_ACL_VER};imap_acl_extension-${IMAP_ACL_VER}-tb.xpi" >> version.csv

Datei anzeigen

@ -37,6 +37,14 @@ if (file_exists('version.csv'))
'version' => $row[1],
'filename' => str_replace('__DOMAIN__', $_GET["domain"], $row[2]),
);
if (count($row) > 3)
{
$plugins[$row[0]]['min_version'] = $row[3];
}
else
{
$plugins[$row[0]]['min_version'] = '30.0';
}
}
fclose($fh);
}
@ -44,8 +52,8 @@ if (file_exists('version.csv'))
$applications
= array( "thunderbird" => "<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
<em:minVersion>31.0</em:minVersion>
<em:maxVersion>31.*</em:maxVersion>" );
<em:minVersion>__MIN_VERSION__</em:minVersion>
<em:maxVersion>99.*</em:maxVersion>" );
$pluginname = $_GET["plugin"];
$plugin =& $plugins[$pluginname];
@ -62,7 +70,21 @@ if ( $plugin ) {
}
}
if (preg_match('/Thunderbird\/([0-9\.]+)/', $_SERVER['HTTP_USER_AGENT'], $client_ver))
{
$client_ver = $client_ver[1];
}
else
{
$client_ver = $plugin['min_version'];
}
if ( $plugin ) {
if (version_compare($client_ver, $plugin['min_version'], '<')) {
header("Content-type: text/plain; charset=utf-8", true, 404);
echo( 'Plugin not compatible with client version' );
exit;
}
header("Content-type: text/xml; charset=utf-8");
echo ('<?xml version="1.0"?>' . "\n");
?>
@ -77,7 +99,7 @@ if ( $plugin ) {
<em:version><?php echo $plugin["version"] ?></em:version>
<em:targetApplication>
<Description>
<?php echo $applications[$plugin["application"]] ?>
<?php echo str_replace('__MIN_VERSION__', $plugin['min_version'], $applications[$plugin["application"]]); ?>
<em:updateLink><?php echo 'https://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/' . $plugin_dir . '/' . $plugin["filename"] ?></em:updateLink>
</Description>