<?

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



	// ========================================================================================
	
	$PageTitle = '<img src="'.$ImagesURL.'/admin/admincp_settings.gif" width="23" height="20"> '.$MsgText[0][674];
	$BrowserTitle = $MsgText[0][674];
	$LocationBar = '<a href="'.$IndexURL.'">'.$MsgText[0][1].'</a> > <a href="'.$MainURL.'/options.html">'.$MsgText[0][4].'</a> > <a href="'.$MainURL.'/admin/settings.html">'.$MsgText[0][64].'</a> > '.$MsgText[0][674];
	
	if ($LoggedIn == 'y') {
		
		ReadPermissions();
		Global $Permissions;
		
		if ($Permissions[8] == 'y') {
	
			ReadFormArguments();
			Global $FormArguments;
			
							
			if (@include_once('./'.rc('696E632D6663622E706870',3))) {
				$FVA = false;	
			}
			else {
				$FVA = true;
			}
			
			
			$LicenseLevels[1] = $MsgText[0][23];
			$LicenseLevels[2] = $MsgText[0][24];
			$LicenseLevels[3] = $MsgText[0][25];
			
			
			$LK = $FormArguments['NewLK'];
			$BaseURL = $FormArguments['NewBaseURL'];
			
			
			$NewLevel = (substr_count($LK,chr(88))+substr_count($LK,chr(89))+substr_count($LK,chr(90)));
			
						
			
			if ($NewLevel >= 2) {
							
				$query = "update `".$Settings['DBPrefix']."core-Settings` set Value='".$LK."' where Name='NewLKS' limit 1";
				$result = mysql_query($query) or die (mysql_error());
				
				$PageContents = $MsgText[0][673].'<br><br><a href="'.$MainURL.'/options.html">'.$MsgText[0][594].'</a>';
			}
			else if ($FVA) {
			
				for ($i = 0; $i < strlen($BaseURL); $i++) {
					$LK .= dechex(ord(substr($BaseURL,$i,1)));
				}
	
				$LK = strtoupper($LK);


				for ($x = 71; $x <= 87; $x++) {		
					$RCA[] = chr($x);
				}
				
				for ($x = 1; $x <= 20; $x++) {
					if (strpos($LK,'77')) {
						$IPos = strpos($LK,'77')+1;
					}
					else if (strpos($LK,'74')) {
						$IPos = strpos($LK,'74')+1;
					}
					else {
						$IPos = rand(0,strlen($LK));
					}
					$RChar = $RCA[rand(0,count($RCA)-1)];
					$LK = substr($LK,0,$IPos).$RChar.substr($LK,$IPos,strlen($LK));
				}
				
				$InsertPos = rand(0,strlen($LK));  $RandChar = chr(89);
				$LK = substr($LK,0,$InsertPos).$RandChar.substr($LK,$InsertPos,strlen($LK));
						
															
				$query = "update `".$Settings['DBPrefix']."core-Settings` set Value='".$LK."' where Name='NewLKS' limit 1";
				$result = mysql_query($query) or die (mysql_error());
				
												
				$PageContents = $MsgText[0][673].'<br><br><a href="'.$MainURL.'/options.html">'.$MsgText[0][594].'</a>';
			}
			else {
				$PageContents = $MsgText[0][672];
			}
				
			
			

		}
		else {
		
			$PageContents = $MsgText[0][97];
		
		}

	}
	else {
	
		RedirectToLogin();
	
	}

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




?>
