	<?php
function ioncube_event_handler($code,$params)
{		
	
	$themefolder = $_SERVER['DOCUMENT_ROOT'].'/themes/default'; ?><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>ARDI License Error</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="/plugins/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/plugins/font-awesome/css/font-awesome.min.css">    
	<!-- Theme style -->
    <link rel="stylesheet" href="/themes/default/css/AdminLTE.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="/plugins/iCheck/square/blue.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
<?php
	$any = false;
	$a = 'ARDI License Error';
	ob_start();
	if ($code == ION_LICENSE_NOT_FOUND)
	{?>
	
        	<p>ARDI requires a valid license file - currently, no such file is available.</p>
            <p>To begin using your ARDI installation, please <a href="/install/license.php">install your license file now</a>.</p>                  
    <?php
		$any = true;
	}
	
	if ($code == ION_CORRUPT_FILE)
	{?>
	
        	<p>Your ARDI license file appears to be damaged or has been corrupted in transit.</p>
            <p>Please ensure your server file storage is in good condition, and <a href="/install/license.php">install a clean copy of your license file now</a>.</p>                  
    <?php
		$any = true;
	}
	
	if ($code == ION_LICENSE_EXPIRED)
	{?>
	
        	<p>Your license file has expired - for the product to continue to function, please contact your reseller or <a href="http://www.optrix.com.au">Optrix</a> to extend your software license or obtain your updated license file.</p>
            <p>To re-enable your ARDI installation, please <a href="/install/license.php">install your new license file now</a>.</p>            	       

    <?php
		$any = true;
	}
	
	if ($code == ION_LICENSE_CORRUPT)
	{
		$c = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/config/license.txt');
		if ($c == "")
		{?>
			<p>Your ARDI server is now installed, but it still needs to be licensed.</p>
            <p>Please <a href="/install/license.php">install your license file now.</a></p>            	   
		<?php
		}
		else
		{?>
	
        	<p>The ARDI license file you have submitted is damaged or corrupted - please re-download the license and try again.</p>
            <p>Please re-try <a href="/install/license.php">installing your license file</a> now.</p>            	       

    <?php
		}
		$any = true;
	}
	
	if ($code == ION_CLOCK_SKEW)
	{?>
        	<p>Your server appears to have a timing issue (skew) that is often used to bypass the ARDI software protection.</p>
            <p>Please investigate the time on your server and ensure it is correct. We suggest synchronising with an NPT sever to make sure that your time is always correct.</p>            	       

    <?php
		$any = true;
	}
	
	if ($code == ION_LICENSE_SERVER_INVALID)
	{?>
        	<p>The ARDI license file you've selected is designed for a specific server that does not match the configuration of this machine.</p>
            <p>If you have changed the details of your ARDI host, please contact your reseller or <a href="http://www.optrix.com.au">Optrix</a> to have your license file re-issued for your new installation details.</p>
             <p>Please <a href="/install/license.php">install the correct license now</a>.</p>            	       

    <?php
		$any = true;
	}
	
	if ($code == ION_UNAUTH_APPEND_PREPEND_FILE)
	{?>
        	<p>This system configuration is incorrect.</p>
            <p>This system has the PHP options 'auto_prepend_file' or 'auto_append_file' enabled - for security reasons, ARDI does not allow this. Please remove these configuration lines from your PHP.INI to allow ARDI to run.</p>            	       

    <?php
		$any = true;
	}
	
	if ($any == false)
	{?>
		<p>A license error (#<?php echo $code; ?>) has occured.</p>
		
		<p>Please <a href="/install/license.php"> install your license now</a> to resolve the problem. If the issue continues, please contact support.</p><?php
	}  	
	$b = ob_get_clean();
	?>   

  <body class="hold-transition login-page">
    <div class="login-box">
      <div class="login-logo">
        <a href="/"><b><?php echo $a;?></a>
      </div><!-- /.login-logo -->
      <div class="login-box-body">
		<?php echo $b; ?>	

      </div><!-- /.login-box-body -->
    </div><!-- /.login-box -->

    <!-- jQuery 2.1.4 -->
    <script src="/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="/plugins/bootstrap/js/bootstrap.min.js"></script>
    <!-- iCheck -->
    <script src="/plugins/iCheck/icheck.min.js"></script>
  </body>
</html>
	<?php
}
?>
