<?php
require '../conn/conn.php';
require '../conn/function.php';
require 'admin_check.php';

$action=$_GET["action"];

switch($action){
	case "get_auth":
	$authcode=trim($_POST["authcode"]);
	$domain=$_SERVER["HTTP_HOST"];

	if(checkauth($domain,$authcode)){
		mysqli_query($conn,"update sl_config set C_authcode='$authcode'");
		die("success");
	}else{
		die($domain."|".$authcode);
		die("error");
	}
	break;
}
?>