<?

/*
FlexCMS (http://www.flexcms.com)
Flexible, Powerful, Affordable.

Contents of this file are protected by the copyright
notice found at http://www.flexcms.com/flex/pages/copyright.html,
and its usage is subject to the terms of the licensing agreement 
available at http://www.flexcms.com/flex/pages/license.html
*/



	// ========================================================================================
	// UnInstall Module
	// ========================================================================================
	
	$PageTitle = $MsgText[0][49];
	$BrowserTitle = $MsgText[0][49];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="' . $MainURL . '/options.html">'.$MsgText[0][4].'</a> > '.$MsgText[0][49];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		// if permissions are correct and arguments haven't been forged
		if ($Permissions[14] == 'y' && strlen($Arguments3) == 2) {
	
					
			if ($IM[$Arguments3] == 'y') {
			
					$ModulesArray = array('cl','mb','pg','cs','nl','gb','na','lm','ec');
					
					$IM[$Arguments3] = 'n';
					
					for ($i = 0; $i < count($ModulesArray); $i++) {
						if ($IM[$ModulesArray[$i]] == 'y') {
						
							if ($NewM1 != '') {
								$NewM1 .= '-'.$ModulesArray[$i];
							}
							else {
								$NewM1 = $ModulesArray[$i];
							}
							
							$NewMC++;
						
						}
					}
					
										
					$Settings[rc('115062',4)] = (strlen($NewM1)*rc('065',4)).'1';
					$Settings[rc('077051',5)] = rc('065067',4).($NewMC*rc('062067065',4)).rc('064062062071',4); 
					
				
					$query = "update `".$Settings['DBPrefix']."core-Settings` set Value='".$NewM1."' where Name='M"."1' limit 1";
					$result = mysql_query($query) or die (mysql_error());
					
					$query = "update `".$Settings['DBPrefix']."core-Settings` set Value='".$Settings[rc('115062',4)]."' where Name='".rc('115062',4)."' limit 1";
					$result = mysql_query($query) or die (mysql_error());
					
					$query = "update `".$Settings['DBPrefix']."core-Settings` set Value='".$Settings[rc('077051',5)]."' where Name='".rc('077051',5)."' limit 1";
					$result = mysql_query($query) or die (mysql_error());
					
					
			
				
			
			}
	
			header('Location: '.$MainURL.'/admin/modules.html');
	
	
		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}
	

	// ========================================================================================




?>
