2008-05-28 21:08:42 +02:00
|
|
|
<?php
|
|
|
|
/* updates.php - this file is part of SOGo
|
|
|
|
*
|
2013-01-29 21:03:37 +01:00
|
|
|
* Copyright (C) 2006-2013 Inverse inc.
|
2008-05-28 21:08:42 +02:00
|
|
|
*
|
|
|
|
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2012-02-09 01:51:38 +01:00
|
|
|
* Francis Lachapelle <flachapelle@inverse.ca>
|
2008-05-28 21:08:42 +02:00
|
|
|
*
|
|
|
|
* This file is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* This script handles the automatic propagation of extensions pertaining to a
|
2009-10-02 22:29:51 +02:00
|
|
|
SOGo site. It requires PHP 4.1.0 or later. */
|
2008-05-28 21:08:42 +02:00
|
|
|
$plugins
|
2010-09-21 17:09:12 +02:00
|
|
|
= array(
|
|
|
|
"sogo-connector@inverse.ca"
|
2008-05-28 21:08:42 +02:00
|
|
|
=> array( "application" => "thunderbird",
|
2013-01-29 21:03:37 +01:00
|
|
|
"version" => "17.0.3",
|
|
|
|
"filename" => "sogo-connector-17.0.3.xpi" ),
|
2010-09-21 17:09:12 +02:00
|
|
|
"sogo-integrator@inverse.ca"
|
|
|
|
=> array( "application" => "thunderbird",
|
2013-01-29 21:03:37 +01:00
|
|
|
"version" => "17.0.3",
|
|
|
|
"filename" => "sogo-integrator-17.0.3.xpi" ),
|
2010-09-21 20:50:27 +02:00
|
|
|
"{e2fda1a4-762b-4020-b5ad-a41df1933103}"
|
|
|
|
=> array( "application" => "thunderbird",
|
2012-12-06 15:39:07 +01:00
|
|
|
"version" => "1.9",
|
|
|
|
"filename" => "lightning-1.9.xpi" )
|
2010-09-21 17:09:12 +02:00
|
|
|
);
|
2008-05-28 21:08:42 +02:00
|
|
|
|
|
|
|
$applications
|
|
|
|
= array( "thunderbird" => "<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
|
2012-12-06 15:39:07 +01:00
|
|
|
<em:minVersion>17.0</em:minVersion>
|
|
|
|
<em:maxVersion>17.*</em:maxVersion>" );
|
2008-05-28 21:08:42 +02:00
|
|
|
|
2009-10-02 22:29:51 +02:00
|
|
|
$pluginname = $_GET["plugin"];
|
2008-05-28 21:08:42 +02:00
|
|
|
$plugin =& $plugins[$pluginname];
|
|
|
|
$application =& $applications[$plugin["application"]];
|
|
|
|
|
2008-05-30 16:46:01 +02:00
|
|
|
if ( $plugin ) {
|
2009-10-02 22:29:51 +02:00
|
|
|
$platform = $_GET["platform"];
|
2008-05-30 16:46:01 +02:00
|
|
|
if ( $platform
|
|
|
|
&& file_exists( $platform . "/" . $plugin["filename"] ) ) {
|
|
|
|
$plugin["filename"] = $platform . "/" . $plugin["filename"];
|
|
|
|
}
|
|
|
|
elseif ( !file_exists( $plugin["filename"] ) ) {
|
|
|
|
$plugin = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $plugin ) {
|
2008-05-28 21:08:42 +02:00
|
|
|
header("Content-type: text/xml; charset=utf-8");
|
|
|
|
echo ('<?xml version="1.0"?>' . "\n");
|
|
|
|
?>
|
|
|
|
<!DOCTYPE RDF>
|
|
|
|
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
|
|
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
2009-11-11 15:57:15 +01:00
|
|
|
<Description about="urn:mozilla:extension:<?php echo $pluginname ?>">
|
2008-05-28 21:08:42 +02:00
|
|
|
<em:updates>
|
|
|
|
<Seq>
|
|
|
|
<li>
|
|
|
|
<Description>
|
2009-11-11 15:57:15 +01:00
|
|
|
<em:version><?php echo $plugin["version"] ?></em:version>
|
2008-05-28 21:08:42 +02:00
|
|
|
<em:targetApplication>
|
2009-11-11 15:57:15 +01:00
|
|
|
<Description><?php echo $applications[$plugin["application"]] ?>
|
2012-12-07 18:44:36 +01:00
|
|
|
<em:updateLink><?php echo dirname(getenv('SCRIPT_URI')) . '/' . $plugin["filename"] ?></em:updateLink>
|
2008-05-28 21:08:42 +02:00
|
|
|
</Description>
|
|
|
|
</em:targetApplication>
|
|
|
|
</Description>
|
|
|
|
</li>
|
|
|
|
</Seq>
|
|
|
|
</em:updates>
|
|
|
|
</Description>
|
|
|
|
</RDF>
|
|
|
|
<?php
|
|
|
|
} else {
|
|
|
|
header("Content-type: text/plain; charset=utf-8", true, 404);
|
|
|
|
echo( 'Plugin not found' );
|
|
|
|
}
|
2010-09-21 20:50:27 +02:00
|
|
|
?>
|