'.$msg.''); } function fud_rmdir($dir) { $dirs = array(realpath($dir)); while (list(,$v) = each($dirs)) { if (!($files = glob($v.'/{.h*,.p*,.n*,.m*,*}', GLOB_BRACE|GLOB_NOSORT))) { continue; } foreach ($files as $file) { if (is_dir($file) && !is_link($file)) { $dirs[] = $file; } else if (!unlink($file)) { echo 'Could not delete file "'.$file.'"
'; } } } $dirs = array_reverse($dirs); foreach ($dirs as $dir) { if (!rmdir($dir)) { echo 'Could not delete directory "'.$dir.'"
'; } } } if (isset($SERVER_DATA_ROOT)) { if (!is_dir($SERVER_DATA_ROOT)) { print_error('Directory "'.$SERVER_DATA_ROOT.'" does not exist'); } /* try to read GLOBALS.php to determine database settings so that databases can be cleaned up */ if (file_exists($SERVER_DATA_ROOT . 'include/GLOBALS.php')) { $data = file_get_contents($SERVER_DATA_ROOT . 'include/GLOBALS.php'); $s = strpos($data, '*/') + 2; $data = substr($data, $s, (strpos($data, 'DO NOT EDIT FILE BEYOND THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING', $s) - $s)) . ' */'; eval($data); if (!empty($DBHOST) && file_exists($SERVER_DATA_ROOT . 'include/theme/default/db.inc')) { $data = file_get_contents($SERVER_DATA_ROOT . 'include/GLOBALS.php'); if (strpos($data, "define('__dbtype__', 'mysql')") !== FALSE) { $dbtype = 'mysql'; } else { $dbtype = 'pgsql'; } $remove_db = 1; } } /* remove files on disk */ fud_rmdir($SERVER_DATA_ROOT); if ($SERVER_ROOT != $SERVER_DATA_ROOT && $SERVER_ROOT) { fud_rmdir($SERVER_ROOT); } /* remove database stuff if needed */ if (isset($remove_db)) { if ($dbtype == 'mysql') { if (@mysql_connect($DBHOST, $DBHOST_USER, $DBHOST_PASSWORD)) { if (@mysql_select_db($DBHOST_DBNAME) && $DBHOST_TBL_PREFIX) { $c = mysql_query("SHOW TABLES LIKE '".$DBHOST_TBL_PREFIX."%'"); while ($r = mysql_fetch_row($c)) { mysql_query('DROP TABLE '.$r[0]); } } } } else { $connect_str = ''; if (!empty($DBHOST)) { $connect_str .= 'host='.$DBHOST; } if (!empty($DBHOST_USER)) { $connect_str .= ' user='.$DBHOST_USER; } if (!empty($DBHOST_PASSWORD)) { $connect_str .= ' password='.$DBHOST_PASSWORD; } if (!empty($DBHOST_DBNAME)) { $connect_str .= ' dbname='.$DBHOST_DBNAME; } if (($conn = @pg_connect($connect_str))) { while ($r = pg_fetch_row($c)) { pg_query($conn, 'DROP TABLE '.$r[0]); } } } } print_error('FUDforum installed in "'.$SERVER_DATA_ROOT.'" has been successfully uninstalled'); } ?>
This utility will uninstall FUDforum from specified directories. Make sure that this is what you want to do, because once it runs there is no going back.
Forum Data Root
This is the directory where you've installed the non-browseable forum files
Server Root
This is the directory where you've installed the browseable forum files. If it is the same as "Forum Data Root", you can leave this field blank.