Pièce jointe « updates.php »

Téléchargement

   1 <?php
   2 /* updates.php - this file is part of SOGo
   3  *
   4  *  Copyright (C) 2006-2010 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. It requires PHP 4.1.0 or later. */
  26 $plugins
  27 = array(
  28         "sogo-connector@inverse.ca"
  29          => array( "application" => "thunderbird",
  30                    "version" => "3.102",
  31                    "filename" => "sogo-connector-3.102.xpi" ),
  32         "sogo-integrator@inverse.ca"
  33          => array( "application" => "thunderbird",
  34                    "version" => "3.102",
  35                    "filename" => "sogo-integrator-3.102.xpi" ),
  36 	"{e2fda1a4-762b-4020-b5ad-a41df1933103}"
  37 	=> array( "application" => "thunderbird",
  38 		   "version" => "1.0b2.102i",
  39 		   "filename" => "lightning-1.0b2.102i.xpi" )
  40 );
  41 
  42 $applications
  43 = array( "thunderbird" => "<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
  44                 <em:minVersion>3.1.0</em:minVersion>
  45                 <em:maxVersion>3.1.*</em:maxVersion>" );
  46 
  47 $pluginname = $_GET["plugin"];
  48 $plugin =& $plugins[$pluginname];
  49 $application =& $applications[$plugin["application"]];
  50 
  51 if ( $plugin ) {
  52   $platform = $_GET["platform"];
  53   if ( $platform
  54        && file_exists( $platform . "/" . $plugin["filename"] ) ) {
  55     $plugin["filename"] = $platform . "/" . $plugin["filename"];
  56   }
  57   elseif ( !file_exists( $plugin["filename"] ) ) {
  58     $plugin = false;
  59   }
  60 }
  61 
  62 if ( $plugin ) {
  63   header("Content-type: text/xml; charset=utf-8");
  64   echo ('<?xml version="1.0"?>' . "\n");
  65 ?>
  66 <!DOCTYPE RDF>
  67 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  68   xmlns:em="http://www.mozilla.org/2004/em-rdf#">
  69   <Description about="urn:mozilla:extension:<?php echo $pluginname ?>">
  70     <em:updates>
  71       <Seq>
  72         <li>
  73           <Description>
  74             <em:version><?php echo $plugin["version"] ?></em:version>
  75             <em:targetApplication>
  76               <Description><?php echo $applications[$plugin["application"]] ?>
  77 		<em:updateLink>http://inverse.ca/downloads/extensions/<?php echo $plugin["filename"] ?></em:updateLink>
  78 	      </Description>
  79             </em:targetApplication>
  80           </Description>
  81         </li>
  82       </Seq>
  83     </em:updates>
  84   </Description>
  85 </RDF>
  86 <?php
  87 } else {
  88   header("Content-type: text/plain; charset=utf-8", true, 404);
  89   echo( 'Plugin not found' );
  90 }
  91 ?>

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.
 All files | Selected Files: delete move to page copy to page

Vous n'êtes pas autorisé à joindre un fichier à cette page.