[ Index ]
 

Code source de XOOPS 2.0.17.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/ -> xoops_md5.php (source)

   1  <?php
   2  /**

   3  * XOOPS installation md5 checksumminig script

   4  *

   5  * This script allows you to check that the XOOPS system files have been correctly uploaded.

   6  * It reads all the XOOPS files and reports missing or invalid ones.

   7  * 

   8  * Instructions:

   9  * - Upload this script and xoops.md5 to your XOOPS documents root

  10  * - Access it using a browser

  11  * - Re-upload missing/invalid files

  12  *

  13  * @copyright    The XOOPS project http://www.xoops.org/

  14  * @license      http://www.fsf.org/copyleft/gpl.html GNU public license

  15  * @author       Skalpa Keo <skalpa@xoops.org>

  16  * @since        2.0.14

  17  * @version        $Id: xoops_md5.php 815 2006-11-15 20:59:35Z skalpa $

  18  * @package         xoops

  19  */
  20  
  21  error_reporting( 0 );
  22  
  23  header( "Content-type: text/plain" );
  24  
  25  if ( !is_file( "xoops.md5" ) || !is_readable( "xoops.md5" ) ) {
  26      echo "xoops.md5 file not found.\n";
  27      exit();
  28  }
  29  $sums = explode( "\n", rtrim( file_get_contents( "xoops.md5" ) ) );
  30  
  31  foreach ( $sums as $line ) {
  32      list( $file, $sum ) = explode( ":", $line, 2 );
  33      if ( substr( $file, 0, 7 ) == 'htdocs/' ) {
  34          $file = substr( $file, 7 );
  35      }
  36      if ( !file_exists( $file ) ) {
  37          echo "$file missing !\n";
  38      } else {
  39          $txt = file_get_contents( "$file" );
  40          $txt = str_replace( array( "\r\n", "\r" ), "\n", $txt );
  41          if ( md5($txt) != $sum ) {
  42              echo "$file content invalid\n";
  43          }
  44      }
  45  }
  46  
  47  echo "End of files check.\n";


Généré le : Sun Nov 25 11:44:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics