<?php
/**
* Quicklinks Module Uninstaller
*
* This uninstaller makes sure an admin is authenticated
* and checks whether the module is installed or not
* before uninstalling. This file is included by index.php
*
* @author Edward Ritter, hide@address.com
* @version $Id$
* @module quicklinks
* @package phpWebSite
*/
// DON'T CHANGE THIS
/* security check */
global $PHP_SELF;
if (substr_count ($PHP_SELF,"/mod/")) {
$inc_prefix = "../../";
} else if (substr_count ($PHP_SELF,"mod.php") ||
substr_count ($PHP_SELF,"admin.php")) {
$inc_prefix = "./";
} else {
$inc_prefix = "../";
}
include_once ($inc_prefix . 'modsecurity.php');
include ($inc_prefix . 'config.php');
if (!check_internal_call()) {
html_header_location("$phpws_url");
}
/* end security check */
// delete quicklinks table
$result = mysql_query ("DROP TABLE IF EXISTS " .$table_prefix.
"mod_".$modname."");
// display error if delete failed
if (!$result) {
// $box_content .= "Error deleting quicklinks table:<br/>". mysql_error();
}
/**
* Next step is to delete the module from the modules table, so that
* phpWebSite no longer sees it as an installed module.
*/
$result = mysql_query ("DELETE FROM ".$table_prefix."modules WHERE
source_file='mod.php?mod=".$modname."'");
// display error if delete failed
if (!$result) {
$box_content .= "Error removing module:<br/>". mysql_error();
}
?>