<?

/*
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
*/



	// ========================================================================================
	// Install 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) {
			
			$MCA = $Settings[rc('115103101',4)];
			$MCB = $Settings[rc('077067066',5)];
			
			$ModulesRemaining = ($MCA-$MCB);
			$M1L = strlen($Settings[rc('4D31',3)]);
			
			if ($ModulesRemaining > 0) {
			
				if ($IM[$Arguments3] != 'y') {
			
					if ($Settings[rc('4D31',3)] != '') {
						$Settings[rc('4D31',3)] .= '-'.$Arguments3;
						$NLA = 3;
					}
					else {
						$Settings[rc('4D31',3)] = $Arguments3;
						$NLA = 2;
						$MCB = 0;
					}
					
					$Settings[rc('115062',4)] = (($M1L+$NLA)*rc('35',3)).'1';
					$Settings[rc('077051',5)] = rc('3537',3).(($MCB+1)*rc('050055053',5)).rc('34323239',3); 
					
				
					$query = "update `".$Settings['DBPrefix']."core-Settings` set Value='".$Settings[rc('4D31',3)]."' where Name='".rc('4D31',3)."' 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();
	
	}
	

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




?>
