<commit_before><?php
header("Content-Type: text/html;charset=utf-8");
session_start();
$account="<EMAIL>";
$bison_key="2da2d990f2abad8-f0f6d6e46556d7-9ad";
$filename = "./config.json";

if(isset($_POST['token']) && isset($_POST['time']) && isset($_POST['zhulangren'] ))
{
	$mytime=$_POST['time'];
	$res= [];
	if(abs($mytime-time()) >=300)
	{
		$res["flag"]=-1;
	}
	$mytoken="${bison_key}".$mytime. $_POST['zhulangren'] ;
	$mytoken=md5($mytoken);
	if($mytoken !=$_POST['token'])
	{
		$res["flag"]=-2;
	}else
	{
		$res['flag']=0;
		$res['data']=json_decode(file_get_contents($filename));
		$res['data']->servershell=get_server_shell($res['data']);
	}
	print(json_encode($res,JSON_UNESCAPED_UNICODE));
	die(0);
}




if(isset($_SESSION['account']))
{
  $account=$_SESSION['account'];
}

$json_string = file_get_contents($filename);
$config_data=json_decode($json_string);

$fun_list=$config_data->shell;
$accounts=$config_data->account;
$address=$config_data->address;


class account_ob 
{
	var $power;
	var $passwd;
}


function indent ($json) { 
	$result = ''; 
	$pos = 0; 
	$strLen = strlen($json); 
	$indentStr = ' '; 
	$newLine = "\n"; 
	$prevChar = ''; 
	$outOfQuotes = true; 

	for ($i=0; $i<=$strLen; $i++) { 

	// Grab the next character in the string. 
	$char = substr($json, $i, 1); 
	// Are we inside a quoted string? 
	if ($char == '"' && $prevChar != '\\') { 
	$outOfQuotes = !$outOfQuotes; 
	// If this character is the end of an element, 
	// output a new line and indent the next line. 
	} else if(($char == '}' || $char == ']') && $outOfQuotes) { 
	$result .= $newLine; 
	$pos --; 
	for ($j=0; $j<$pos; $j++) { 
	$result .= $indentStr; 
	} 
	} 
	// Add the character to the result string. 
	$result .= $char; 
	// If the last character was the beginning of an element, 
	// output a new line and indent the next line. 
	if (($char == ',' || $char == '{' || $char == '[') && $outOfQuotes) { 
	$result .= $newLine; 
	if ($char == '{' || $char == '[') { 
	$pos ++; 
	} 
	for ($j = 0; $j < $pos; $j++) { 
	$result .= $indentStr; 
	} 
	} 
	$prevChar = $char; 
	} 
	return $result; 

} 
function regestuser($email,$passwd)
{
	Global $accounts;
	Global $config_data;
	if(property_exists($accounts,$email))
	{
		echo "0";
		return 0;
	}
	Global $bison_key;
	$mypwd="${bison_key}${email}${passwd}";
	$mypwd=md5($mypwd);


	$myfile = fopen("./config.json", "w");
	$ob=new account_ob();
	$ob->passwd=$<PASSWORD>;
	$ob->power=2;
	$accounts->$email=$ob;
	$json=json_encode($config_data,JSON_UNESCAPED_UNICODE);
	fwrite($myfile, indent($json));
	fclose($myfile);
	echo "1";
	return 1;
}

function change_passwd($email,$passwdold,$passwdnew)
{
	Global $accounts;
	Global $config_data;
	if(property_exists($accounts,$email)==false)
	{//账号不存在
		echo "0";
		return 0;
	}
	Global $bison_key;
	$mypwd="${bison_key}${email}${passwdold}";
	$mypwd=md5($mypwd);
	if($accounts->$email->passwd !=$mypwd)
	{//旧密码不正确
		echo "1";
		return 0;
	}
	//修改密码
	$mypwd="${bison_key}${email}${passwdnew}";
	$mypwd=md5($mypwd);
	$accounts->$email->passwd=$mypwd;

	$myfile = fopen("./config.json", "w");
	$json=json_encode($config_data,JSON_UNESCAPED_UNICODE);
	fwrite($myfile, indent($json));
	fclose($myfile);
	echo "2";
	return 0;

}

function filter_by_value ($arrayp){ 
	Global $power;
	$newarray=array( );
	foreach ($arrayp as $key => $val) 
	{
		if($val->power >=$power)
		{
			$newarray[$key]=$val->index;
		}
	}
	return $newarray;
    
} 


function get_server_shell($arrayp)
{
	$newarray=array( );
	foreach ($arrayp as $key => $val) 
	{
		$newarray['index']=$val->shell;
	}
	return $newarray;
}


$acc=$accounts->$account;
$power=$acc->power;

function get_my_list()
{
	Global $fun_list;
	return filter_by_value($fun_list);
}
function check_login($accountp,$pwd)
{
	Global $accounts;
	if(!isset($accounts->$accountp))
	{
		return false;
	}
	Global $bison_key;
	$mypwd="${bison_key}${accountp}${pwd}";
	$mypwd=<PASSWORD>($mypwd);
	if($accounts->$accountp->passwd !=$mypwd)
	{
		return false;
	}<commit_msg>修改配置数据的读取的错误<commit_after><?php
header("Content-Type: text/html;charset=utf-8");
require_once('log4php/Logger.php');  

session_start();
$account="<EMAIL>";
$bison_key="2da2d990f2abad8-f0f6d6e46556d7-9ad";
$filename = "./config.json";
$logger = Logger::getRootLogger();
Logger::configure(dirname(__FILE__).'/log4php.properties');
if(isset($_POST['token']) && isset($_POST['time']) && isset($_POST['zhulangren'] ))
{
	$mytime=$_POST['time'];
	$res= [];
	if(abs($mytime-time()) >=300)
	{
		$res["flag"]=-1;
	}
	$mytoken="${bison_key}".$mytime. $_POST['zhulangren'] ;
	$mytoken=md5($mytoken);
	if($mytoken !=$_POST['token'])
	{
		$res["flag"]=-2;
	}else
	{
		$res['flag']=0;
		$res['data']=json_decode(file_get_contents($filename));
		$res['data']->servershell=get_server_shell($res['data']->shell);
	}
	print(json_encode($res,JSON_UNESCAPED_UNICODE));
	die(0);
}




if(isset($_SESSION['account']))
{
  $account=$_SESSION['account'];
}

$json_string = file_get_contents($filename);
$config_data=json_decode($json_string);

$fun_list=$config_data->shell;
$accounts=$config_data->account;
$address=$config_data->address;


class account_ob 
{
	var $power;
	var $passwd;
}


function indent ($json) { 
	$result = ''; 
	$pos = 0; 
	$strLen = strlen($json); 
	$indentStr = ' '; 
	$newLine = "\n"; 
	$prevChar = ''; 
	$outOfQuotes = true; 

	for ($i=0; $i<=$strLen; $i++) { 

	// Grab the next character in the string. 
	$char = substr($json, $i, 1); 
	// Are we inside a quoted string? 
	if ($char == '"' && $prevChar != '\\') { 
	$outOfQuotes = !$outOfQuotes; 
	// If this character is the end of an element, 
	// output a new line and indent the next line. 
	} else if(($char == '}' || $char == ']') && $outOfQuotes) { 
	$result .= $newLine; 
	$pos --; 
	for ($j=0; $j<$pos; $j++) { 
	$result .= $indentStr; 
	} 
	} 
	// Add the character to the result string. 
	$result .= $char; 
	// If the last character was the beginning of an element, 
	// output a new line and indent the next line. 
	if (($char == ',' || $char == '{' || $char == '[') && $outOfQuotes) { 
	$result .= $newLine; 
	if ($char == '{' || $char == '[') { 
	$pos ++; 
	} 
	for ($j = 0; $j < $pos; $j++) { 
	$result .= $indentStr; 
	} 
	} 
	$prevChar = $char; 
	} 
	return $result; 

} 
function regestuser($email,$passwd)
{
	Global $accounts;
	Global $config_data;
	if(property_exists($accounts,$email))
	{
		echo "0";
		return 0;
	}
	Global $bison_key;
	$mypwd="${bison_key}${email}${passwd}";
	$mypwd=<PASSWORD>($mypwd);


	$myfile = fopen("./config.json", "w");
	$ob=new account_ob();
	$ob->passwd=$<PASSWORD>;
	$ob->power=2;
	$accounts->$email=$ob;
	$json=json_encode($config_data,JSON_UNESCAPED_UNICODE);
	fwrite($myfile, indent($json));
	fclose($myfile);
	echo "1";
	return 1;
}

function change_passwd($email,$passwdold,$passwdnew)
{
	Global $accounts;
	Global $config_data;
	if(property_exists($accounts,$email)==false)
	{//账号不存在
		echo "0";
		return 0;
	}
	Global $bison_key;
	$mypwd="${bison_key}${email}${passwdold}";
	$mypwd=<PASSWORD>($mypwd);
	if($accounts->$email->passwd !=$mypwd)
	{//旧密码不正确
		echo "1";
		return 0;
	}
	//修改密码
	$mypwd="${bison_key}${email}${passwdnew}";
	$mypwd=<PASSWORD>($mypwd);
	$accounts->$email->passwd=$my<PASSWORD>;

	$myfile = fopen("./config.json", "w");
	$json=json_encode($config_data,JSON_UNESCAPED_UNICODE);
	fwrite($myfile, indent($json));
	fclose($myfile);
	echo "2";
	return 0;

}

function filter_by_value ($arrayp){ 
	Global $power;
	$newarray=array( );
	foreach ($arrayp as $key => $val) 
	{
		if($val->power >=$power)
		{
			$newarray[$key]=$val->index;
		}
	}
	return $newarray;
    
} 


function get_server_shell($arrayp)
{
	Global $logger;
	$newarray=array( );
	foreach ($arrayp as $key => $val) 
	{
	$logger->debug("loginoussssst".$key);

	$newarray[$val->index]=$val->shell;
	}
	return $newarray;
}


$acc=$accounts->$account;
$power=$acc->power;

function get_my_list()
{
	Global $fun_list;
	return filter_by_value($fun_list);
}
function check_login($accountp,$pwd)
{
	Global $accounts;
	if(!isset($accounts->$accountp))
	{
		return false;
	}
	Global $bison_key;
	$mypwd="${bison_key}${accountp}${pwd}";
	$mypwd=<PASSWORD>($my<PASSWORD>);
	if($accounts->$accountp->passwd !=$mypwd)
	{
		return false;
	}
{'fraction_non_alphanumeric': 0.2232903382818204, 'fraction_numerical': 0.010829885616938428, 'mean_word_length': 4.7556022408963585, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5646844', 'n_tokens_mistral': 3625, 'n_tokens_neox': 3464, 'n_words': 573}