Location: PHPKode > projects > FiForms Framework > FiForms/scripts/app/books/uninstall_final.php
<?php
    require_once('localconfig.php');

if(!isset($FIFORMS_CONFIG['AUTH_MODULE']))
    die('Authentication Module not defined in localconfig.php');
require_once($FIFORMS_CONFIG['INCLUDE_PATH'].$FIFORMS_CONFIG['AUTH_MODULE']);
$auth = new FiFormsAuth();
if(!@mysql_connect(FIFORMS_DEFAULT_SERVER,$auth->username,$auth->passwd))
{
	$auth->connectFailure();
	die();
}
mysql_close();

if(FIFORMS_UPDATE_HOST !== "any" && (FIFORMS_UPDATE_HOST !== "local" || $_SERVER['REMOTE_ADDR'] !== "127.0.0.1"))
{
    die("This feature is not allowed in FiForms_global.inc.php.");
}

if(!$_POST['password'] || sha1($_POST['password']) !== FIFORMS_UPDATEPW_HASH)
{
    die("Password Incorrect.");
}


    $basedir = FIFORMS_APP_BASE;
  if($_POST['uninstall'] == 'Uninstall Application')
  {
    require('installed_files.php');
    foreach($files as $file)
    {
	unlink($file);
    }
    $rev_dir = array_reverse($directories);
    foreach($rev_dir as $directory)
    {
	rmdir($directory);
    }


    if(array_search('daniel',$FIFORMS_AVAILABLE_APPS)!==false)
    {
        unset($FIFORMS_AVAILABLE_APPS[array_search('daniel',$FIFORMS_AVAILABLE_APPS)]);
    }

    $app_reg = "<?php \$FIFORMS_AVAILABLE_APPS = array('".implode("','",$FIFORMS_AVAILABLE_APPS)."'); ?>";

    file_put_contents(FIFORMS_INCLUDE_PATH."FiForms_RegApps.inc.php",$app_reg);
    ?>
    <html>
    <head>
    <title>Application Uninstalled</title>
    </head>
    <body>
    <h1>Application Uninstalled</h1>
    <p><a href="/enc/srv/www/FiForms/apps/">Please Return to Main Menu</a></p>
    </body>
    </html>
    <?php
  }
?>
Return current item: FiForms Framework