diff --git a/docs/download/build-thunderbird-plugins.sh b/docs/download/build-thunderbird-plugins.sh index 8ad6c6dc8..de4277edc 100755 --- a/docs/download/build-thunderbird-plugins.sh +++ b/docs/download/build-thunderbird-plugins.sh @@ -32,6 +32,7 @@ while read DOMAINS; do sed -i 's/<\/Seq>/
  • <\/li>
  • <\/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 diff --git a/docs/download/thunderbird-plugins.php b/docs/download/thunderbird-plugins.php index 8a1a7e9bb..889cdf35d 100644 --- a/docs/download/thunderbird-plugins.php +++ b/docs/download/thunderbird-plugins.php @@ -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" => "{3550f703-e582-4d05-9a08-453d09bdfdc6} - 31.0 - 31.*" ); + __MIN_VERSION__ + 99.*" ); $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 ('' . "\n"); ?> @@ -77,7 +99,7 @@ if ( $plugin ) { - +