<?
/** 
 * @Project GoldMU.Net
 * @copyright 03/03/2022
 * @Email: goldmu.net@gmail.com
 * @Zalo: 0923 117 898
 */
 
 if (!defined('GoldWebMU')) die("Ban khong co quyen truy cap he thong");
 
if( !isset($_SESSION['mu_username']) ) {
$captcha_arr = array();
include_once("vimage.php");
$captcha_arr = captcha();
$_SESSION['captcha_code'] = $captcha_arr['code'];
$_SESSION['captcha_code_check'] = md5($_SESSION['captcha_code']);
$_SESSION['captcha_images'] = $captcha_arr['image_src'];

    $rand = mt_rand(1,5);
    $vweb_security_login_code1 = $rand;
    $rand = mt_rand(6,10);
    $vweb_security_login_code2 = $rand;
    
    //Config
	$characters = '123456789';
	
    // Create Rand String 1
    $random_string_length = $vweb_security_login_code2 - $vweb_security_login_code1;
    $rand_string1 = "";
    for ($i = 0; $i < $random_string_length; $i++) { 
		$rand_string1 .= $characters[rand(0, strlen($characters) - 1)]; 
 	}
    
    // Create Rand String 2
    $random_string2_length = rand(1,5);
    $rand_string2 = "";
    for ($i = 0; $i < $random_string2_length; $i++) { 
		$rand_string2 .= $characters[rand(0, strlen($characters) - 1)]; 
 	}
    
    $timenow = time();
    $vweb_security_login_code3 = $rand_string1 . $timenow . $rand_string2;
	
	$page_template = "templates/login.aspx";
}
else{
	echo "<META HTTP-EQUIV='refresh' CONTENT='0; URL=#'>";
	}
?>