Pièce jointe « updates.php »
Téléchargement
Afficher/masquer les numéros de lignes
1 <?php
2 /* updates.php - this file is part of SOGo
3 *
4 * Copyright (C) 2006-2009 Inverse inc.
5 *
6 * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
7 *
8 * This file is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
11 * any later version.
12 *
13 * This file is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; see the file COPYING. If not, write to
20 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
22 */
23
24 /* This script handles the automatic propagation of extensions pertaining to a
25 SOGo site */
26 $plugins
27 = array( "sogo-connector@inverse.ca"
28 => array( "application" => "thunderbird",
29 "version" => "0.96",
30 "filename" => "sogo-connector-0.96.xpi" ),
31 "sogo-integrator@inverse.ca"
32 => array( "application" => "thunderbird",
33 "version" => "0.96",
34 "filename" => "sogo-integrator-0.96-auf.xpi" ),
35 "{e2fda1a4-762b-4020-b5ad-a41df1933103}"
36 => array( "application" => "thunderbird",
37 "version" => "0.9.6",
38 "filename" => "lightning-0.9.6.xpi" ));
39 /* => array( "application" => "thunderbird",
40 "version" => "0.9.6",
41 "filename" => "Linux_x86-gcc3/ lightning-0.9.6.xpi" )
42 => array( "application" => "thunderbird",
43 "version" => "0.9.6",
44 "filename" => "Linux_x86_64-gcc3/ lightning-0.9.6.xpi" )
45 => array( "application" => "thunderbird",
46 "version" => "0.9.6",
47 "filename" => "Mac-os/ lightning-0.9.6.xpi" ));*/
48
49 $applications
50 = array( "thunderbird" => "<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
51 <em:minVersion>1.5</em:minVersion>
52 <em:maxVersion>2.0.*</em:maxVersion>",
53 "firefox" => "<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
54 <em:minVersion>1.5</em:minVersion>
55 <em:maxVersion>2.0.*</em:maxVersion>" );
56
57 $pluginname = $HTTP_GET_VARS["plugin"];
58 $plugin =& $plugins[$pluginname];
59 $application =& $applications[$plugin["application"]];
60
61 if ( $plugin ) {
62 $platform = $HTTP_GET_VARS["platform"];
63 if ( $platform
64 && file_exists( $platform . "/" . $plugin["filename"] ) ) {
65 $plugin["filename"] = $platform . "/" . $plugin["filename"];
66 }
67 elseif ( !file_exists( $plugin["filename"] ) ) {
68 $plugin = false;
69 }
70 }
71
72 if ( $plugin ) {
73 header("Content-type: text/xml; charset=utf-8");
74 echo ('<?xml version="1.0"?>' . "\n");
75 ?>
76 <!DOCTYPE RDF>
77 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
78 xmlns:em="http://www.mozilla.org/2004/em-rdf#">
79 <Description about="urn:mozilla:extension:<?= $pluginname ?>">
80 <em:updates>
81 <Seq>
82 <li>
83 <Description>
84 <em:version><?= $plugin["version"] ?></em:version>
85 <em:targetApplication>
86 <Description><?= $applications[$plugin["application"]] ?>
87 <em:updateLink>https://sogo-mtl.ca.auf.org/plugins/<?= $plugin["filename"] ?></em:updateLink>
88 </Description>
89 </em:targetApplication>
90 </Description>
91 </li>
92 </Seq>
93 </em:updates>
94 </Description>
95 </RDF>
96 <?php
97 } else {
98 header("Content-type: text/plain; charset=utf-8", true, 404);
99 echo( 'Plugin not found' );
100 }
Fichiers joints
Pour vous référer aux pièces jointes d'une page, utilisez attachment:filename, comme indiqué ci-dessous dans la liste de fichiers. N'utilisez pas l'URL du lien [get], car elle peut changer et donc être facilement cassée.Vous n'êtes pas autorisé à joindre un fichier à cette page.