<?php
/*
* Copyright (c) 2005, Bull S.A.. All rights reserved.
* Created by: Sebastien Decugis
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*/
/*
This file empties the upload directory. Use with care!
*/
$root="../";
$_PAGE["title"]="TSLP purge";
/* Output header page */
require($root."header.inc.php");
/* We'll need functions defined in other files */
require($root."functions.inc.php");
function rmdirRecursive($path,$racine=false) {
$dir = opendir($path) ;
while ( $entry = readdir($dir) ) {
if ( is_file( "$path/$entry" ) || ((!$followLinks) && is_link("$path/$entry")) ) {
unlink( "$path/$entry" );
} elseif ( is_dir( "$path/$entry" ) && $entry!='.' && $entry!='..' ) {
rmdirRecursive( "$path/$entry" ) ;
if ($racine)
echo "Removed ".$path/$entry."<br>\n";
}
}
closedir($dir) ;
if (!$racine)
return rmdir($path);
}
rmdirRecursive($root."ts/", true);
require($root."footer.inc.php");
?>