/* Decoded by unphp.net */
function fn_settings_actions_addons_sd_xml_import(&$new_status, &$old_status, $on_install) {
if (${
"new_status"}
=== "A") {
if (empty(call_user_func("db_get_field", "SELECT marketplace_license_key FROM ?:addons WHERE addon = ?s", "sd_xml_import"))) {
call_user_func("fn_set_notification", "E", call_user_func("__", "error"), call_user_func("str_replace", ["[addon]", "[addon_id]", "[href]"], [call_user_func(array("Tygh\Addons\SchemesManager", "getName"), "sd_xml_import", constant("CART_LANGUAGE")), "sd_xml_import", call_user_func("fn_url", "addons.licensing?addon=sd_xml_import&return_url=addons.manage")], "Before you can activate the add-on "[addon]", specify the license number."));
${
"new_status"}
= "D";
}
else {
${
"context"}
= ["http" => ["method" => "POST", "timeout" => 5, "header" => "Content-Type: application/json", "ignore_errors" => constant("true"), "content" => call_user_func("json_encode", ["license_number" => call_user_func("db_get_field", "SELECT marketplace_license_key FROM ?:addons WHERE addon = ?s", "sd_xml_import"), "product_id" => "1611", "domain" => call_user_func(array("Tygh\Registry", "get"), "config.current_host")])], "ssl" => ["verify_peer" => constant("false")]];
${
"context"}
= call_user_func("stream_context_create", ${
"context"}
);
${
"result"}
= @call_user_func("file_get_contents", "https://marketplace.cs-cart.com/api/4.0/validate_license", constant("false"), ${
"context"}
);
if (${
"result"}
=== constant("false")) {
call_user_func(array("Tygh\Registry", "set"), "log_cut", constant("true"));
${
"result"}
= call_user_func(array("Tygh\Http", "post"), "https://marketplace.cs-cart.com/api/4.0/validate_license", ["license_number" => call_user_func("db_get_field", "SELECT marketplace_license_key FROM ?:addons WHERE addon = ?s", "sd_xml_import"), "product_id" => "1611", "domain" => call_user_func(array("Tygh\Registry", "get"), "config.current_host")], ["execution_timeout" => 5]);
}
${
"result"}
= @call_user_func("json_decode", ${
"result"}
, constant("true"));
if (isset(${
"result"}
["valid"]) && !${
"result"}
["valid"]) {
${
"new_status"}
= "D";
call_user_func("fn_set_notification", "E", call_user_func("__", "error"), call_user_func("str_replace", ["[addon]", "[addon_id]", "[href]", "[license]"], [call_user_func(array("Tygh\Addons\SchemesManager", "getName"), "sd_xml_import", constant("CART_LANGUAGE")), "sd_xml_import", call_user_func("fn_url", "addons.licensing?addon=sd_xml_import&return_url=addons.manage"), call_user_func("db_get_field", "SELECT marketplace_license_key FROM ?:addons WHERE addon = ?s", "sd_xml_import")], "The license [license]
for the add-on "[addon]" is not valid or has expired; please specify a valid license number."));
}
}
}
}
?>