Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Deployer; use Deployer\Exception\Exception; use Deployer\Utility\Httpie; ..

Decoded Output download

<?php
 namespace Deployer; use Deployer\Exception\Exception; use Deployer\Utility\Httpie; set("ispmanager_owner", "www-root"); set("ispmanager_doc_root", "/var/www/" . get("ispmanager_owner") . "/data/"); set("ispmanager", array("api" => array("dsn" => "https://root:password@localhost:1500/ispmgr", "secure" => true), "createDomain" => NULL, "updateDomain" => NULL, "deleteDomain" => NULL, "createDatabase" => NULL, "deleteDatabase" => NULL, "phpSelect" => NULL, "createAlias" => NULL, "deleteAlias" => NULL)); set("vhost", array("name" => "{{domain}}", "php_enable" => "on", "aliases" => "www.{{domain}}", "home" => "www/{{domain}}", "owner" => get("ispmanager_owner"), "email" => "webmaster@{{domain}}", "charset" => "off", "dirindex" => "index.php uploaded.html", "ssi" => "on", "php" => "on", "php_mode" => "php_mode_mod", "basedir" => "on", "php_apache_version" => "native", "cgi" => "off", "log_access" => "on", "log_error" => "on")); set("ispmanager_session", ''); set("ispmanager_databases", array("servers" => array(), "hosts" => array(), "dblist" => array())); set("ispmanager_domains", array()); set("ispmanager_phplist", array()); set("ispmanager_aliaslist", array()); desc("Installs ispmanager"); task("ispmanager:init", function () { $config = get("ispmanager"); if (!is_null($config["createDatabase"]) || !is_null($config["deleteDatabase"])) { invoke("ispmanager:db-server-list"); invoke("ispmanager:db-list"); } if (!is_null($config["createDomain"]) || !is_null($config["deleteDomain"])) { invoke("ispmanager:domain-list"); } if (!is_null($config["phpSelect"])) { invoke("ispmanager:domain-list"); invoke("ispmanager:get-php-list"); } if (!is_null($config["createAlias"]) || !is_null($config["deleteAlias"])) { invoke("ispmanager:domain-list"); } }); desc("Takes database servers list"); task("ispmanager:db-server-list", function () { $response = ispmanagerRequest("get", array("func" => "db.server")); $hostList = array(); $serverList = array(); if (isset($response["doc"]["elem"]) && count($response["doc"]["elem"]) > 0) { foreach ($response["doc"]["elem"] as $dbServer) { $serverList[$dbServer["name"]["$"]] = array("host" => $dbServer["host"]["$"], "name" => $dbServer["name"]["$"], "version" => $dbServer["savedver"]["$"]); if (!strpos($dbServer["host"]["$"], ":")) { $dbHost = $dbServer["host"]["$"] . ":3306"; } else { $dbHost = $dbServer["host"]["$"]; } $hostList[$dbHost] = array("host" => $dbHost, "name" => $dbServer["name"]["$"], "version" => $dbServer["savedver"]["$"]); } } add("ispmanager_databases", array("servers" => $serverList, "hosts" => $hostList)); }); desc("Takes databases list"); task("ispmanager:db-list", function () { $response = ispmanagerRequest("get", array("func" => "db")); $dbList = array(); if (isset($response["doc"]["elem"]) && count($response["doc"]["elem"]) > 0) { foreach ($response["doc"]["elem"] as $db) { $dbList[$db["pair"]["$"]] = array("name" => $db["name"]["$"], "server" => $db["server"]["$"], "location" => $db["pair"]["$"]); } } add("ispmanager_databases", array("dblist" => $dbList)); }); desc("Takes domain list"); task("ispmanager:domain-list", function () { $response = ispmanagerRequest("get", array("func" => "webdomain")); $domainList = array(); if (isset($response["doc"]["elem"]) && count($response["doc"]["elem"]) > 0) { foreach ($response["doc"]["elem"] as $domain) { $domainList[] = $domain["name"]["$"]; } } add("ispmanager_domains", $domainList); }); desc("Creates new database"); task("ispmanager:db-create", function () { $config = get("ispmanager"); if (is_null($config["createDatabase"])) { warning("Action for database create is not active"); return; } $dsnData = parse_url($config["createDatabase"]["dsn"]); $dbInfo = get("ispmanager_databases"); $hostInfo = NULL; foreach ($dbInfo["hosts"] as $hostData) { if ($hostData["host"] == $dsnData["host"] . ":" . $dsnData["port"]) { $hostInfo = $hostData; break; } } if (is_null($hostInfo)) { throw new Exception("Incorrect DB host"); } $dbName = substr($dsnData["path"], 1); $dbLocation = $dbName . "->" . $hostInfo["name"]; if (isset($dbInfo["dblist"][$dbLocation])) { if (!isset($config["createDatabase"]["skipIfExist"]) || !$config["createDatabase"]["skipIfExist"]) { throw new Exception("Database already exists!"); } else { warning("Database already exists - skipping"); return; } } $dbCreateRequest = array("func" => "db.edit", "name" => $dbName, "owner" => get("ispmanager_owner"), "server" => $hostInfo["name"], "charset" => $config["createDatabase"]["charset"], "sok" => "ok"); if ($dsnData["user"] == "*") { $dbCreateRequest["user"] = "*"; $dbCreateRequest["username"] = $dbName; if ($dsnData["pass"] == "*") { $dbCreateRequest["password"] = generatePassword(8); } else { $dbCreateRequest["password"] = $dsnData["pass"]; } } else { $dbCreateRequest["user"] = $dsnData["user"]; } $response = ispmanagerRequest("post", $dbCreateRequest); if (isset($response["doc"]["error"]["msg"]["$"])) { throw new Exception($response["doc"]["error"]["msg"]["$"]); } else { info("Database successfully created"); } }); desc("Deletes database"); task("ispmanager:db-delete", function () { $config = get("ispmanager"); if (is_null($config["deleteDatabase"])) { warning("Action for database delete is not active"); return; } $dbInfo = get("ispmanager_databases"); $dsnData = parse_url($config["deleteDatabase"]["dsn"]); $hostInfo = NULL; foreach ($dbInfo["hosts"] as $hostData) { if ($hostData["host"] == $dsnData["host"] . ":" . $dsnData["port"]) { $hostInfo = $hostData; break; } } if (is_null($hostInfo)) { throw new Exception("Incorrect DB host"); } $dbName = substr($dsnData["path"], 1); $dbLocation = $dbName . "->" . $hostInfo["name"]; if (!isset($dbInfo["dblist"][$dbLocation])) { if (!isset($config["deleteDatabase"]["skipIfNotExist"]) || !$config["deleteDatabase"]["skipIfNotExist"]) { throw new Exception("Database not exist!"); } else { warning("Database not exist - skipping"); return; } } $dbDeleteRequest = array("func" => "db.delete", "elid" => $dbLocation); $response = ispmanagerRequest("post", $dbDeleteRequest); if (isset($response["doc"]["error"]["msg"]["$"])) { throw new Exception($response["doc"]["error"]["msg"]["$"]); } else { info("Database successfully deleted"); } }); desc("Creates new domain"); task("ispmanager:domain-create", function () { $config = get("ispmanager"); if (is_null($config["createDomain"])) { warning("Action for domain create is not active"); return; } if (!isset($config["createDomain"]["name"]) || $config["createDomain"]["name"] == '') { throw new Exception("Invalid domain name!"); } $existDomains = get("ispmanager_domains"); if (in_array($config["createDomain"]["name"], $existDomains)) { if (!isset($config["createDomain"]["skipIfExist"]) || !$config["createDomain"]["skipIfExist"]) { throw new Exception("Domain already exists!"); } else { warning("Domain already exists - skipping"); return; } } $vhostTemplate = get("vhost"); $domainCreateRequest = array("func" => "webdomain.edit", "sok" => "ok"); foreach ($vhostTemplate as $key => $value) { $domainCreateRequest[$key] = str_replace("{{domain}}", $config["createDomain"]["name"], $vhostTemplate[$key]); } $response = ispmanagerRequest("post", $domainCreateRequest); if (isset($response["doc"]["error"]["msg"]["$"])) { throw new Exception($response["doc"]["error"]["msg"]["$"]); } else { info("Domain successfully created"); } }); desc("Gets allowed PHP modes and versions"); task("ispmanager:get-php-list", function () { $response = ispmanagerRequest("get", array("func" => "user.edit", "elid" => get("ispmanager_owner"), "elname" => get("ispmanager_owner"))); $userFPMVersion = isset($response["doc"]["limit_php_fpm_version"]["$"]) ? $response["doc"]["limit_php_fpm_version"]["$"] : NULL; $response = ispmanagerRequest("get", array("func" => "phpversions")); $versions = array(); foreach ($response["doc"]["elem"] as $phpVersion) { $versions[$phpVersion["key"]["$"]] = array("name" => $phpVersion["name"]["$"], "php_mode_mod" => false, "php_mode_cgi" => false, "php_mode_fcgi_apache" => false, "php_mode_fcgi_nginxfpm" => false); if (isset($phpVersion["default_apache"]) && $phpVersion["default_apache"]["$"] == "on") { $versions[$phpVersion["key"]["$"]]["php_mode_mod"] = true; } if (isset($phpVersion["cgi"]) && $phpVersion["cgi"]["$"] == "on") { $versions[$phpVersion["key"]["$"]]["php_mode_cgi"] = true; } if (isset($phpVersion["apache"]) && $phpVersion["apache"]["$"] == "on") { $versions[$phpVersion["key"]["$"]]["php_mode_fcgi_apache"] = true; } if (isset($phpVersion["fpm"]) && $phpVersion["fpm"]["$"] == "on" && $phpVersion["key"]["$"] == $userFPMVersion) { $versions[$phpVersion["key"]["$"]]["php_mode_fcgi_nginxfpm"] = true; } } add("ispmanager_phplist", $versions); }); desc("Prints allowed PHP modes and versions"); task("ispmanager:print-php-list", function () { invoke("ispmanager:get-php-list"); $versions = get("ispmanager_phplist"); writeln("PHP versions: "); writeln(str_repeat("*", 32)); foreach ($versions as $versionKey => $versionData) { writeln("PHP " . $versionData["name"] . " (ID: " . $versionKey . ")"); writeln(str_repeat("*", 32)); if (!$versionData["php_mode_mod"]) { writeln("Apache module support (php_mode_mod) - <fg=red;options=bold>NO</>"); } else { writeln("Apache module support (php_mode_mod) - <fg=green;options=bold>YES</>"); } if (!$versionData["php_mode_cgi"]) { writeln("CGI support (php_mode_cgi) - <fg=red;options=bold>NO</>"); } else { writeln("CGI support (php_mode_cgi) - <fg=green;options=bold>YES</>"); } if (!$versionData["php_mode_fcgi_apache"]) { writeln("Apache fast-cgi support (php_mode_fcgi_apache) - <fg=red;options=bold>NO</>"); } else { writeln("Apache fast-cgi support (php_mode_fcgi_apache) - <fg=green;options=bold>YES</>"); } if (!$versionData["php_mode_fcgi_nginxfpm"]) { writeln("nginx fast-cgi support (php_mode_fcgi_nginxfpm) - <fg=red;options=bold>NO</>"); } else { writeln("nginx fast-cgi support (php_mode_fcgi_nginxfpm) - <fg=green;options=bold>YES</>"); } writeln(str_repeat("*", 32)); } }); desc("Switches PHP version for domain"); task("ispmanager:domain-php-select", function () { $config = get("ispmanager"); if (is_null($config["phpSelect"])) { warning("Action for domain update is not active"); return; } if (!isset($config["phpSelect"]["name"]) || $config["phpSelect"]["name"] == '') { throw new Exception("Invalid domain name!"); } $existDomains = get("ispmanager_domains"); if (!in_array($config["phpSelect"]["name"], $existDomains)) { throw new Exception("Domain not exist!"); } if (!isset($config["phpSelect"]["mode"]) || !isset($config["phpSelect"]["version"])) { throw new Exception("Incorrect settings for select php version"); } $phpVersions = get("ispmanager_phplist"); $newVersion = $config["phpSelect"]["version"]; $newMode = $config["phpSelect"]["mode"]; if (!isset($phpVersions[$newVersion])) { throw new Exception("Incorrect php version"); } $versionData = $phpVersions[$newVersion]; if (!isset($versionData[$newMode]) || !$versionData[$newMode]) { throw new Exception("Incorrect php mode"); } $domainUpdateRequest = array("func" => "webdomain.edit", "elid" => $config["phpSelect"]["name"], "name" => $config["phpSelect"]["name"], "php_mode" => $newMode, "sok" => "ok"); if ($newMode == "php_mode_mod") { $domainUpdateRequest["php_apache_version"] = $newVersion; } elseif ($newMode == "php_mode_cgi") { $domainUpdateRequest["php_cgi_version"] = $newVersion; } elseif ($newMode == "php_mode_fcgi_apache") { $domainUpdateRequest["php_cgi_version"] = $newVersion; $domainUpdateRequest["php_apache_version"] = $newVersion; } elseif ($newMode == "php_mode_fcgi_nginxfpm") { $domainUpdateRequest["php_cgi_version"] = $newVersion; $domainUpdateRequest["php_fpm_version"] = $newVersion; } else { throw new Exception("Unknown PHP mode!"); } $response = ispmanagerRequest("post", $domainUpdateRequest); if (isset($response["doc"]["error"]["msg"]["$"])) { throw new Exception($response["doc"]["error"]["msg"]["$"]); } else { info("PHP successfully selected"); } }); desc("Creates new domain alias"); task("ispmanager:domain-alias-create", function () { $config = get("ispmanager"); if (is_null($config["createAlias"])) { warning("Action for alias create is not active"); return; } if (!isset($config["createAlias"]["name"]) || $config["createAlias"]["name"] == '') { throw new Exception("Invalid domain name!"); } $existDomains = get("ispmanager_domains"); if (!in_array($config["createAlias"]["name"], $existDomains)) { throw new Exception("Domain not exist!"); } if (!isset($config["createAlias"]["alias"]) || $config["createAlias"]["alias"] == '') { throw new Exception("Invalid alias name!"); } $response = ispmanagerRequest("get", array("func" => "webdomain.edit", "elid" => $config["createAlias"]["name"], "elname" => $config["createAlias"]["name"])); $existAliases = array(); if (isset($response["doc"]["aliases"]["$"])) { $existAliases = explode(" ", $response["doc"]["aliases"]["$"]); } $newAliasList = array(); $createAliasList = explode(" ", $config["createAlias"]["alias"]); foreach ($createAliasList as $createAlias) { if (in_array($createAlias, $existAliases)) { if (!isset($config["createAlias"]["skipIfExist"]) || !$config["createAlias"]["skipIfExist"]) { throw new Exception("Alias already exists!"); } else { warning("Alias " . $createAlias . " already exists - skipping"); continue; } } $newAliasList[] = $createAlias; } $saveAliases = array_merge($existAliases, $newAliasList); $domainUpdateRequest = array("func" => "webdomain.edit", "elid" => $config["createAlias"]["name"], "name" => $config["createAlias"]["name"], "aliases" => implode(" ", $saveAliases), "sok" => "ok"); $response = ispmanagerRequest("post", $domainUpdateRequest); if (isset($response["doc"]["error"]["msg"]["$"])) { throw new Exception($response["doc"]["error"]["msg"]["$"]); } else { info("Alias successfully created"); } }); desc("Deletes domain alias"); task("ispmanager:domain-alias-delete", function () { $config = get("ispmanager"); if (is_null($config["deleteAlias"])) { warning("Action for alias create is not active"); return; } if (!isset($config["deleteAlias"]["name"]) || $config["deleteAlias"]["name"] == '') { throw new Exception("Invalid domain name!"); } $existDomains = get("ispmanager_domains"); if (!in_array($config["deleteAlias"]["name"], $existDomains)) { throw new Exception("Domain not exist!"); } if (!isset($config["deleteAlias"]["alias"]) || $config["deleteAlias"]["alias"] == '') { throw new Exception("Invalid alias name!"); } $response = ispmanagerRequest("get", array("func" => "webdomain.edit", "elid" => $config["createAlias"]["name"], "elname" => $config["createAlias"]["name"])); $existAliases = array(); if (isset($response["doc"]["aliases"]["$"])) { $existAliases = explode(" ", $response["doc"]["aliases"]["$"]); } $deleteAliasList = explode(" ", $config["deleteAlias"]["alias"]); foreach ($deleteAliasList as $deleteAlias) { if (!in_array($deleteAlias, $existAliases)) { if (!isset($config["deleteAlias"]["skipIfNotExist"]) || !$config["deleteAlias"]["skipIfNotExist"]) { throw new Exception("Alias not exist!"); } else { warning("Alias " . $deleteAlias . " not exist - skipping"); continue; } } if (($index = array_search($deleteAlias, $existAliases)) !== FALSE) { unset($existAliases[$index]); } } $domainUpdateRequest = array("func" => "webdomain.edit", "elid" => $config["deleteAlias"]["name"], "name" => $config["deleteAlias"]["name"], "aliases" => implode(" ", $existAliases), "sok" => "ok"); $response = ispmanagerRequest("post", $domainUpdateRequest); if (isset($response["doc"]["error"]["msg"]["$"])) { throw new Exception($response["doc"]["error"]["msg"]["$"]); } else { info("Alias successfully deleted"); } }); desc("Deletes domain"); task("ispmanager:domain-delete", function () { $config = get("ispmanager"); if (is_null($config["deleteDomain"])) { warning("Action for domain delete is not active"); return; } if (!isset($config["deleteDomain"]["name"]) || $config["deleteDomain"]["name"] == '') { throw new Exception("Invalid domain name!"); } $existDomains = get("ispmanager_domains"); if (!in_array($config["deleteDomain"]["name"], $existDomains)) { if (!isset($config["deleteDomain"]["skipIfNotExist"]) || !$config["deleteDomain"]["skipIfNotExist"]) { throw new Exception("Domain not exist!"); } else { warning("Domain not exist - skipping"); return; } } $domainDeleteRequest = array("func" => "webdomain.delete.confirm", "elid" => $config["deleteDomain"]["name"], "sok" => "ok"); if (!isset($config["deleteDomain"]["removeDir"]) || !$config["deleteDomain"]["removeDir"]) { $domainDeleteRequest["remove_directory"] = "off"; } else { $domainDeleteRequest["remove_directory"] = "on"; } $response = ispmanagerRequest("post", $domainDeleteRequest); if (isset($response["doc"]["error"]["msg"]["$"])) { throw new Exception($response["doc"]["error"]["msg"]["$"]); } else { info("Domain successfully deleted"); } }); desc("Auto task processing"); task("ispmanager:process", function () { $config = get("ispmanager"); if (!is_null($config["createDatabase"])) { invoke("ispmanager:db-create"); } if (!is_null($config["deleteDatabase"])) { invoke("ispmanager:db-delete"); } if (!is_null($config["createDomain"])) { invoke("ispmanager:domain-create"); } if (!is_null($config["deleteDomain"])) { invoke("ispmanager:domain-delete"); } if (!is_null($config["phpSelect"])) { invoke("ispmanager:domain-php-select"); } if (!is_null($config["createAlias"])) { invoke("ispmanager:domain-alias-create"); } if (!is_null($config["deleteAlias"])) { invoke("ispmanager:domain-alias-delete"); } }); function ispmanagerRequest($method, $requestData) { $config = get("ispmanager"); $dsnData = parse_url($config["api"]["dsn"]); $requestUrl = $dsnData["scheme"] . "://" . $dsnData["host"] . ":" . $dsnData["port"] . $dsnData["path"]; if ($config["api"]["secure"] && get("ispmanager_session") == '') { ispmanagerAuthRequest($requestUrl, $dsnData["user"], $dsnData["pass"]); } if ($method == "post") { return Httpie::post($requestUrl)->formBody(prepareRequest($requestData))->setopt(CURLOPT_SSL_VERIFYPEER, false)->setopt(CURLOPT_SSL_VERIFYHOST, false)->getJson(); } elseif ($method == "get") { return Httpie::get($requestUrl)->query(prepareRequest($requestData))->setopt(CURLOPT_SSL_VERIFYPEER, false)->setopt(CURLOPT_SSL_VERIFYHOST, false)->getJson(); } else { throw new Exception("Unknown request method"); } } function ispmanagerAuthRequest($url, $login, $pass) { $authRequestData = array("func" => "auth", "username" => $login, "password" => $pass); $responseData = Httpie::post($url)->setopt(CURLOPT_SSL_VERIFYPEER, false)->setopt(CURLOPT_SSL_VERIFYHOST, false)->formBody(prepareRequest($authRequestData))->getJson(); if (isset($responseData["doc"]["auth"]["$id"])) { set("ispmanager_session", $responseData["doc"]["auth"]["$id"]); } else { throw new Exception("Error while create auth session"); } } function prepareRequest($requestData) { $config = get("ispmanager"); $dsnData = parse_url($config["api"]["dsn"]); if (!isset($requestData["out"])) { $requestData["out"] = "json"; } if (!$config["api"]["secure"]) { $requestData["authinfo"] = $dsnData["user"] . ":" . $dsnData["pass"]; } else { if (get("ispmanager_session") != '') { $requestData["auth"] = get("ispmanager_session"); } } return $requestData; } function generatePassword($lenght) { return substr(md5(uniqid()), 0, $lenght); } before("ispmanager:domain-alias-create", "ispmanager:init"); before("ispmanager:domain-alias-delete", "ispmanager:init"); before("ispmanager:domain-create", "ispmanager:init"); before("ispmanager:domain-delete", "ispmanager:init"); before("ispmanager:domain-php-select", "ispmanager:init"); before("ispmanager:db-create", "ispmanager:init"); before("ispmanager:db-delete", "ispmanager:init"); ?>

Did this file decode correctly?

Original Code

<?php
 namespace Deployer; use Deployer\Exception\Exception; use Deployer\Utility\Httpie; set("\151\163\x70\x6d\x61\156\141\x67\145\162\137\x6f\x77\156\145\162", "\x77\167\x77\x2d\x72\x6f\157\x74"); set("\151\163\160\155\x61\x6e\x61\x67\x65\162\x5f\144\x6f\x63\137\x72\x6f\x6f\x74", "\x2f\166\141\x72\x2f\x77\x77\x77\57" . get("\151\x73\160\x6d\x61\156\x61\147\145\162\137\x6f\167\x6e\145\162") . "\57\144\141\x74\141\x2f"); set("\x69\x73\160\x6d\x61\156\x61\x67\145\162", array("\141\160\151" => array("\x64\x73\x6e" => "\x68\x74\164\160\x73\72\x2f\57\162\x6f\157\164\x3a\160\x61\x73\163\167\x6f\162\x64\x40\154\x6f\x63\x61\154\x68\x6f\163\x74\72\x31\x35\60\60\x2f\151\x73\160\x6d\x67\x72", "\x73\145\143\x75\x72\145" => true), "\143\x72\145\x61\164\145\104\x6f\x6d\x61\151\x6e" => NULL, "\165\160\x64\141\164\x65\104\x6f\155\x61\x69\x6e" => NULL, "\144\145\154\145\x74\x65\104\x6f\x6d\141\x69\156" => NULL, "\x63\x72\145\x61\164\145\x44\x61\164\x61\142\141\163\x65" => NULL, "\144\145\x6c\x65\164\145\x44\141\164\141\142\141\x73\x65" => NULL, "\x70\x68\x70\123\x65\x6c\x65\x63\x74" => NULL, "\143\162\x65\141\164\x65\x41\154\x69\x61\163" => NULL, "\x64\x65\x6c\x65\x74\x65\101\x6c\x69\x61\163" => NULL)); set("\166\150\157\163\164", array("\156\141\155\145" => "\173\x7b\144\x6f\x6d\141\x69\156\x7d\x7d", "\160\x68\x70\137\x65\x6e\141\142\154\145" => "\x6f\x6e", "\x61\154\x69\141\x73\x65\x73" => "\x77\167\x77\56\173\x7b\144\x6f\155\141\x69\x6e\x7d\x7d", "\x68\x6f\x6d\145" => "\167\x77\x77\57\x7b\173\144\157\x6d\x61\151\x6e\x7d\x7d", "\157\x77\156\x65\162" => get("\x69\163\160\x6d\x61\x6e\141\x67\145\162\137\157\x77\156\x65\x72"), "\145\x6d\141\151\x6c" => "\x77\145\142\x6d\141\163\164\145\x72\x40\173\173\x64\157\x6d\141\151\x6e\x7d\175", "\143\150\141\x72\x73\145\x74" => "\x6f\x66\146", "\x64\x69\162\x69\x6e\144\145\x78" => "\x69\156\x64\145\x78\x2e\x70\150\160\x20\x75\160\x6c\x6f\141\x64\145\x64\x2e\x68\164\x6d\154", "\x73\163\x69" => "\x6f\x6e", "\x70\150\x70" => "\157\156", "\x70\x68\x70\x5f\x6d\x6f\144\x65" => "\160\x68\160\x5f\155\157\x64\x65\x5f\x6d\157\x64", "\142\x61\x73\145\144\x69\162" => "\157\156", "\x70\x68\160\137\x61\x70\141\x63\x68\145\x5f\166\x65\162\x73\x69\157\156" => "\156\141\x74\x69\x76\x65", "\x63\147\151" => "\157\146\x66", "\x6c\157\x67\x5f\x61\x63\x63\145\163\x73" => "\x6f\156", "\x6c\157\x67\x5f\x65\x72\162\157\x72" => "\157\156")); set("\151\x73\x70\155\141\x6e\141\x67\x65\x72\137\x73\x65\163\x73\151\157\x6e", ''); set("\151\163\x70\155\x61\156\x61\x67\145\x72\137\x64\141\x74\141\x62\x61\163\x65\163", array("\163\x65\x72\166\x65\x72\163" => array(), "\150\x6f\x73\164\163" => array(), "\x64\142\154\x69\x73\164" => array())); set("\151\163\x70\155\x61\156\x61\x67\x65\x72\137\144\157\155\x61\x69\156\x73", array()); set("\x69\163\x70\155\x61\x6e\x61\147\145\162\137\160\150\160\x6c\x69\163\x74", array()); set("\x69\x73\160\x6d\x61\x6e\x61\147\145\x72\x5f\x61\x6c\151\141\x73\x6c\x69\163\164", array()); desc("\x49\x6e\x73\164\x61\154\154\x73\40\x69\163\160\155\x61\156\x61\147\x65\162"); task("\151\x73\x70\155\141\156\141\147\145\162\72\x69\x6e\151\164", function () { $config = get("\x69\163\160\x6d\141\156\141\147\145\162"); if (!is_null($config["\143\162\145\141\x74\145\104\141\x74\141\x62\x61\163\x65"]) || !is_null($config["\144\145\154\x65\x74\x65\104\x61\x74\141\x62\141\163\145"])) { invoke("\x69\x73\x70\155\x61\x6e\141\x67\145\x72\72\x64\x62\x2d\163\145\x72\x76\x65\162\x2d\154\151\163\164"); invoke("\x69\163\160\x6d\x61\156\141\147\145\x72\72\144\x62\x2d\154\151\163\164"); } if (!is_null($config["\143\162\145\141\x74\x65\x44\x6f\x6d\141\x69\x6e"]) || !is_null($config["\144\145\x6c\x65\x74\145\x44\157\155\x61\x69\x6e"])) { invoke("\x69\x73\160\155\x61\x6e\x61\x67\145\162\x3a\144\157\x6d\x61\151\x6e\55\154\151\x73\164"); } if (!is_null($config["\160\150\x70\123\x65\x6c\145\x63\x74"])) { invoke("\151\163\160\x6d\141\x6e\141\147\x65\162\x3a\144\x6f\155\141\x69\156\55\154\x69\163\x74"); invoke("\151\x73\x70\155\x61\x6e\141\147\x65\162\72\x67\145\164\55\160\x68\x70\x2d\154\x69\163\164"); } if (!is_null($config["\x63\x72\145\x61\x74\x65\101\x6c\x69\x61\x73"]) || !is_null($config["\x64\x65\x6c\145\x74\x65\101\154\x69\141\163"])) { invoke("\x69\x73\x70\x6d\141\156\x61\147\145\x72\x3a\144\x6f\x6d\141\x69\x6e\x2d\x6c\151\x73\x74"); } }); desc("\x54\x61\x6b\145\163\40\x64\x61\164\x61\x62\x61\163\x65\x20\163\x65\x72\x76\145\162\163\40\x6c\151\x73\x74"); task("\151\x73\160\155\x61\x6e\x61\x67\x65\x72\x3a\144\x62\x2d\163\x65\162\166\x65\x72\x2d\x6c\x69\x73\x74", function () { $response = ispmanagerRequest("\x67\145\164", array("\x66\x75\x6e\x63" => "\x64\x62\x2e\163\145\162\166\x65\162")); $hostList = array(); $serverList = array(); if (isset($response["\144\157\x63"]["\145\154\x65\x6d"]) && count($response["\144\x6f\x63"]["\145\154\145\x6d"]) > 0) { foreach ($response["\144\157\x63"]["\145\154\145\x6d"] as $dbServer) { $serverList[$dbServer["\156\x61\x6d\x65"]["\44"]] = array("\150\157\163\164" => $dbServer["\150\x6f\163\x74"]["\44"], "\156\141\155\145" => $dbServer["\156\x61\155\x65"]["\x24"], "\x76\x65\x72\x73\x69\x6f\156" => $dbServer["\163\x61\x76\x65\x64\166\145\162"]["\x24"]); if (!strpos($dbServer["\x68\157\x73\x74"]["\44"], "\x3a")) { $dbHost = $dbServer["\x68\x6f\163\x74"]["\x24"] . "\72\63\x33\x30\66"; } else { $dbHost = $dbServer["\x68\157\163\x74"]["\x24"]; } $hostList[$dbHost] = array("\x68\157\x73\x74" => $dbHost, "\156\141\155\145" => $dbServer["\x6e\x61\155\145"]["\44"], "\166\145\162\x73\x69\x6f\156" => $dbServer["\x73\x61\166\145\x64\x76\145\x72"]["\44"]); } } add("\x69\x73\160\155\x61\x6e\141\147\x65\162\x5f\x64\x61\x74\141\142\141\x73\x65\163", array("\163\145\x72\x76\x65\x72\163" => $serverList, "\150\157\x73\164\x73" => $hostList)); }); desc("\124\x61\153\x65\x73\x20\x64\141\x74\141\x62\141\163\x65\x73\x20\x6c\151\163\164"); task("\x69\x73\x70\x6d\141\156\141\x67\x65\x72\x3a\144\x62\55\154\x69\x73\164", function () { $response = ispmanagerRequest("\x67\x65\164", array("\146\165\156\143" => "\144\x62")); $dbList = array(); if (isset($response["\x64\x6f\x63"]["\x65\154\x65\155"]) && count($response["\x64\x6f\x63"]["\x65\x6c\145\155"]) > 0) { foreach ($response["\144\157\x63"]["\x65\154\x65\155"] as $db) { $dbList[$db["\x70\x61\151\162"]["\x24"]] = array("\156\x61\155\145" => $db["\x6e\x61\155\x65"]["\44"], "\163\145\x72\166\x65\162" => $db["\x73\x65\162\166\145\162"]["\44"], "\154\x6f\x63\141\164\x69\157\156" => $db["\x70\x61\x69\162"]["\x24"]); } } add("\x69\x73\x70\155\x61\156\x61\147\x65\162\x5f\144\x61\x74\141\x62\141\163\x65\x73", array("\144\142\x6c\x69\163\x74" => $dbList)); }); desc("\124\x61\x6b\145\163\x20\x64\x6f\155\141\x69\x6e\40\x6c\x69\163\x74"); task("\151\x73\160\x6d\x61\156\x61\x67\x65\x72\72\x64\157\x6d\x61\151\x6e\55\x6c\151\x73\x74", function () { $response = ispmanagerRequest("\147\145\164", array("\146\x75\156\143" => "\167\145\142\x64\x6f\x6d\141\151\x6e")); $domainList = array(); if (isset($response["\x64\x6f\143"]["\145\154\x65\x6d"]) && count($response["\x64\x6f\143"]["\145\154\145\x6d"]) > 0) { foreach ($response["\144\x6f\143"]["\x65\154\x65\x6d"] as $domain) { $domainList[] = $domain["\156\141\x6d\x65"]["\44"]; } } add("\x69\163\160\155\x61\x6e\141\147\x65\162\137\x64\x6f\155\x61\x69\156\x73", $domainList); }); desc("\103\x72\145\141\164\x65\163\40\156\145\167\40\144\x61\x74\x61\142\141\x73\x65"); task("\x69\163\160\x6d\x61\x6e\x61\x67\145\162\72\x64\x62\x2d\x63\x72\x65\x61\164\145", function () { $config = get("\x69\163\x70\155\x61\x6e\141\x67\145\x72"); if (is_null($config["\x63\x72\145\x61\164\x65\x44\141\164\141\142\x61\163\145"])) { warning("\101\143\164\151\157\156\x20\x66\157\162\x20\x64\141\164\141\142\141\x73\x65\40\x63\162\x65\141\164\x65\40\151\x73\x20\x6e\157\164\x20\141\143\x74\x69\x76\x65"); return; } $dsnData = parse_url($config["\143\x72\145\x61\164\145\104\x61\164\141\142\141\x73\x65"]["\x64\x73\x6e"]); $dbInfo = get("\x69\x73\160\155\141\x6e\x61\x67\x65\x72\137\x64\141\x74\x61\142\x61\163\x65\163"); $hostInfo = NULL; foreach ($dbInfo["\150\157\x73\x74\x73"] as $hostData) { if ($hostData["\150\157\x73\x74"] == $dsnData["\x68\157\x73\x74"] . "\72" . $dsnData["\160\157\x72\164"]) { $hostInfo = $hostData; break; } } if (is_null($hostInfo)) { throw new Exception("\111\156\x63\157\x72\162\x65\x63\164\40\x44\102\x20\150\x6f\163\x74"); } $dbName = substr($dsnData["\160\x61\164\150"], 1); $dbLocation = $dbName . "\55\x3e" . $hostInfo["\156\141\155\x65"]; if (isset($dbInfo["\144\x62\x6c\x69\x73\164"][$dbLocation])) { if (!isset($config["\x63\162\145\141\x74\x65\104\x61\164\x61\142\x61\163\145"]["\163\x6b\x69\x70\x49\146\x45\x78\151\163\164"]) || !$config["\x63\162\x65\x61\x74\145\x44\x61\x74\141\142\141\163\x65"]["\163\153\151\x70\111\x66\x45\170\x69\163\164"]) { throw new Exception("\x44\x61\164\141\142\141\x73\x65\40\x61\154\162\145\141\144\x79\x20\145\x78\151\163\164\x73\x21"); } else { warning("\104\x61\164\x61\x62\x61\x73\145\40\141\x6c\x72\145\x61\x64\171\40\x65\170\151\x73\x74\163\40\x2d\40\x73\153\151\160\160\x69\x6e\147"); return; } } $dbCreateRequest = array("\146\165\x6e\x63" => "\x64\142\x2e\145\144\151\x74", "\156\x61\155\145" => $dbName, "\x6f\x77\x6e\x65\162" => get("\x69\x73\x70\x6d\x61\156\141\x67\145\162\x5f\157\167\x6e\145\162"), "\x73\145\x72\x76\145\162" => $hostInfo["\x6e\141\155\x65"], "\x63\x68\x61\162\x73\145\164" => $config["\143\x72\x65\x61\x74\x65\104\141\164\x61\142\x61\x73\145"]["\x63\x68\141\162\x73\x65\x74"], "\x73\157\x6b" => "\157\x6b"); if ($dsnData["\x75\163\145\162"] == "\x2a") { $dbCreateRequest["\x75\163\x65\x72"] = "\x2a"; $dbCreateRequest["\165\163\x65\162\x6e\x61\155\145"] = $dbName; if ($dsnData["\x70\141\x73\x73"] == "\52") { $dbCreateRequest["\160\141\x73\x73\x77\157\162\144"] = generatePassword(8); } else { $dbCreateRequest["\160\141\163\163\167\157\162\144"] = $dsnData["\x70\141\x73\x73"]; } } else { $dbCreateRequest["\x75\163\145\162"] = $dsnData["\165\x73\x65\162"]; } $response = ispmanagerRequest("\x70\x6f\x73\x74", $dbCreateRequest); if (isset($response["\144\157\143"]["\145\x72\x72\x6f\x72"]["\x6d\x73\x67"]["\44"])) { throw new Exception($response["\144\x6f\143"]["\145\162\x72\157\x72"]["\155\x73\x67"]["\x24"]); } else { info("\x44\x61\x74\x61\x62\141\x73\x65\x20\163\165\143\x63\145\x73\163\146\x75\154\x6c\x79\x20\143\x72\145\x61\164\x65\144"); } }); desc("\104\145\154\145\x74\145\x73\40\144\141\164\x61\142\x61\x73\145"); task("\x69\x73\160\155\141\156\141\x67\x65\x72\x3a\x64\142\x2d\x64\x65\x6c\x65\164\145", function () { $config = get("\x69\163\x70\155\141\156\x61\x67\145\x72"); if (is_null($config["\x64\x65\154\145\x74\145\x44\141\164\x61\x62\141\163\x65"])) { warning("\x41\143\164\151\x6f\156\40\x66\157\162\40\144\x61\x74\x61\142\141\163\145\40\x64\x65\154\145\164\x65\40\151\x73\40\x6e\157\164\40\141\143\x74\151\166\145"); return; } $dbInfo = get("\151\x73\160\x6d\x61\156\x61\x67\x65\162\137\x64\141\x74\x61\142\x61\x73\145\163"); $dsnData = parse_url($config["\144\x65\x6c\x65\x74\x65\104\141\164\x61\x62\141\163\x65"]["\144\x73\x6e"]); $hostInfo = NULL; foreach ($dbInfo["\x68\157\x73\x74\163"] as $hostData) { if ($hostData["\x68\x6f\x73\164"] == $dsnData["\150\x6f\x73\164"] . "\x3a" . $dsnData["\x70\157\x72\164"]) { $hostInfo = $hostData; break; } } if (is_null($hostInfo)) { throw new Exception("\111\x6e\143\157\162\162\145\x63\164\x20\x44\102\x20\150\x6f\x73\164"); } $dbName = substr($dsnData["\160\141\164\150"], 1); $dbLocation = $dbName . "\55\x3e" . $hostInfo["\x6e\x61\155\x65"]; if (!isset($dbInfo["\x64\x62\154\151\x73\x74"][$dbLocation])) { if (!isset($config["\144\x65\x6c\145\x74\145\104\x61\164\x61\142\141\163\x65"]["\163\x6b\151\x70\x49\146\x4e\157\x74\x45\x78\x69\163\x74"]) || !$config["\144\x65\x6c\x65\164\x65\104\x61\164\x61\142\x61\x73\145"]["\x73\x6b\x69\x70\111\x66\116\157\164\105\x78\151\x73\x74"]) { throw new Exception("\104\141\164\141\142\141\x73\145\x20\156\157\x74\x20\145\x78\x69\x73\x74\x21"); } else { warning("\104\x61\x74\x61\142\x61\x73\x65\40\x6e\x6f\164\x20\x65\170\151\163\x74\40\55\x20\163\153\151\160\160\x69\156\x67"); return; } } $dbDeleteRequest = array("\146\165\x6e\143" => "\x64\x62\56\144\145\154\x65\164\145", "\x65\154\x69\x64" => $dbLocation); $response = ispmanagerRequest("\160\x6f\x73\164", $dbDeleteRequest); if (isset($response["\144\157\x63"]["\x65\x72\162\x6f\x72"]["\155\163\147"]["\x24"])) { throw new Exception($response["\x64\157\x63"]["\145\162\x72\157\162"]["\155\x73\147"]["\x24"]); } else { info("\104\141\164\x61\142\x61\x73\x65\40\163\165\143\143\x65\163\x73\x66\x75\154\x6c\x79\x20\144\145\154\x65\x74\x65\144"); } }); desc("\103\x72\145\141\x74\x65\x73\40\156\x65\167\x20\144\157\155\x61\x69\x6e"); task("\151\x73\160\x6d\141\156\x61\x67\145\162\x3a\144\x6f\155\141\151\156\x2d\x63\162\x65\x61\164\145", function () { $config = get("\151\163\x70\155\141\156\141\x67\145\x72"); if (is_null($config["\x63\162\x65\141\164\145\x44\157\x6d\x61\151\x6e"])) { warning("\101\x63\x74\151\157\156\x20\x66\x6f\162\x20\x64\157\155\141\x69\x6e\40\143\162\145\x61\x74\x65\40\151\x73\40\x6e\157\164\40\141\143\x74\x69\x76\145"); return; } if (!isset($config["\x63\x72\145\141\x74\145\x44\x6f\x6d\141\x69\156"]["\x6e\x61\x6d\145"]) || $config["\x63\x72\x65\x61\x74\x65\x44\x6f\x6d\x61\151\156"]["\156\x61\155\145"] == '') { throw new Exception("\111\156\x76\x61\154\151\x64\x20\x64\x6f\155\141\x69\x6e\40\x6e\x61\155\145\41"); } $existDomains = get("\x69\x73\160\155\x61\156\x61\x67\145\x72\137\x64\x6f\x6d\141\x69\156\x73"); if (in_array($config["\143\162\x65\x61\x74\x65\x44\157\x6d\141\151\156"]["\156\x61\155\145"], $existDomains)) { if (!isset($config["\x63\162\x65\x61\164\x65\104\x6f\x6d\x61\x69\156"]["\x73\x6b\x69\160\111\x66\105\170\151\x73\164"]) || !$config["\143\x72\145\x61\164\145\x44\x6f\155\141\151\x6e"]["\x73\153\151\x70\x49\x66\105\x78\x69\163\164"]) { throw new Exception("\x44\x6f\155\x61\x69\156\x20\141\154\162\x65\141\144\171\x20\145\170\x69\x73\x74\163\x21"); } else { warning("\x44\157\x6d\141\151\x6e\40\x61\x6c\x72\145\141\x64\x79\x20\x65\170\x69\163\x74\163\x20\55\40\x73\x6b\x69\x70\x70\151\x6e\147"); return; } } $vhostTemplate = get("\166\150\157\x73\x74"); $domainCreateRequest = array("\x66\165\156\143" => "\x77\x65\x62\x64\x6f\x6d\x61\151\x6e\56\145\x64\151\164", "\163\157\x6b" => "\x6f\x6b"); foreach ($vhostTemplate as $key => $value) { $domainCreateRequest[$key] = str_replace("\173\x7b\144\157\x6d\x61\x69\x6e\175\x7d", $config["\x63\162\x65\x61\x74\x65\x44\157\x6d\141\x69\156"]["\156\x61\155\x65"], $vhostTemplate[$key]); } $response = ispmanagerRequest("\x70\157\x73\164", $domainCreateRequest); if (isset($response["\x64\157\143"]["\145\162\x72\x6f\162"]["\x6d\163\x67"]["\44"])) { throw new Exception($response["\144\157\x63"]["\145\162\x72\157\162"]["\155\x73\147"]["\44"]); } else { info("\104\x6f\x6d\x61\151\156\x20\x73\x75\143\x63\145\163\163\146\x75\154\x6c\171\x20\x63\x72\145\x61\x74\145\x64"); } }); desc("\107\145\x74\163\40\141\154\x6c\x6f\x77\x65\x64\x20\x50\x48\120\40\x6d\x6f\x64\x65\163\40\x61\x6e\x64\x20\166\x65\x72\163\x69\157\x6e\163"); task("\151\x73\x70\x6d\x61\156\x61\147\145\x72\72\147\145\164\55\x70\150\160\55\x6c\151\163\x74", function () { $response = ispmanagerRequest("\147\145\164", array("\146\x75\156\143" => "\165\x73\x65\162\x2e\x65\144\151\x74", "\x65\154\151\x64" => get("\151\x73\160\x6d\x61\156\x61\147\145\162\137\157\167\156\145\162"), "\145\154\x6e\x61\x6d\x65" => get("\151\x73\160\x6d\141\x6e\x61\x67\x65\x72\137\x6f\x77\x6e\145\x72"))); $userFPMVersion = isset($response["\144\x6f\x63"]["\154\151\155\151\164\137\160\x68\160\x5f\146\160\x6d\x5f\x76\x65\162\163\151\x6f\156"]["\x24"]) ? $response["\144\157\143"]["\154\x69\155\x69\x74\x5f\x70\150\160\137\x66\160\155\137\x76\145\x72\x73\x69\x6f\156"]["\x24"] : NULL; $response = ispmanagerRequest("\x67\x65\x74", array("\146\x75\156\143" => "\160\150\160\166\145\x72\163\151\157\156\163")); $versions = array(); foreach ($response["\x64\x6f\143"]["\x65\x6c\145\x6d"] as $phpVersion) { $versions[$phpVersion["\x6b\x65\x79"]["\44"]] = array("\x6e\x61\x6d\145" => $phpVersion["\156\x61\x6d\145"]["\x24"], "\x70\x68\160\137\x6d\x6f\144\145\x5f\155\157\144" => false, "\160\150\160\137\155\x6f\144\145\x5f\x63\147\151" => false, "\x70\x68\160\x5f\155\157\x64\x65\137\146\143\147\x69\x5f\x61\160\141\143\150\145" => false, "\x70\150\x70\x5f\155\157\x64\145\x5f\146\143\147\151\x5f\156\147\151\x6e\x78\x66\x70\155" => false); if (isset($phpVersion["\144\x65\x66\141\x75\x6c\x74\137\141\160\x61\143\150\145"]) && $phpVersion["\144\145\146\x61\165\154\x74\137\x61\x70\141\x63\x68\x65"]["\44"] == "\x6f\x6e") { $versions[$phpVersion["\153\x65\x79"]["\44"]]["\x70\150\160\x5f\x6d\157\x64\145\137\155\x6f\144"] = true; } if (isset($phpVersion["\143\147\151"]) && $phpVersion["\143\x67\151"]["\x24"] == "\x6f\x6e") { $versions[$phpVersion["\x6b\145\x79"]["\44"]]["\160\150\x70\137\155\x6f\144\145\137\x63\x67\x69"] = true; } if (isset($phpVersion["\x61\160\141\143\150\145"]) && $phpVersion["\x61\160\x61\x63\150\145"]["\x24"] == "\157\156") { $versions[$phpVersion["\x6b\x65\171"]["\44"]]["\160\x68\160\x5f\x6d\x6f\144\x65\137\x66\143\x67\151\137\141\160\x61\143\x68\x65"] = true; } if (isset($phpVersion["\x66\x70\155"]) && $phpVersion["\x66\160\x6d"]["\44"] == "\x6f\156" && $phpVersion["\x6b\x65\171"]["\44"] == $userFPMVersion) { $versions[$phpVersion["\153\x65\x79"]["\44"]]["\160\150\160\137\x6d\x6f\144\x65\x5f\x66\143\147\x69\137\156\147\151\x6e\x78\x66\x70\155"] = true; } } add("\151\163\160\x6d\x61\156\x61\x67\x65\x72\137\160\x68\x70\154\151\x73\164", $versions); }); desc("\120\x72\151\156\x74\163\x20\x61\x6c\x6c\157\167\x65\x64\40\x50\x48\x50\x20\x6d\x6f\x64\145\163\40\x61\156\144\x20\x76\145\x72\x73\x69\157\x6e\163"); task("\x69\163\160\x6d\x61\156\x61\x67\x65\162\x3a\x70\162\x69\x6e\x74\55\x70\x68\160\x2d\154\151\x73\x74", function () { invoke("\x69\x73\x70\155\141\156\141\x67\145\x72\x3a\x67\145\164\55\160\x68\160\x2d\x6c\x69\163\164"); $versions = get("\x69\163\x70\x6d\141\156\x61\x67\145\162\137\x70\x68\160\x6c\x69\x73\164"); writeln("\120\110\x50\40\x76\145\162\x73\x69\157\156\163\x3a\40"); writeln(str_repeat("\52", 32)); foreach ($versions as $versionKey => $versionData) { writeln("\120\x48\x50\40" . $versionData["\156\141\x6d\145"] . "\40\50\111\x44\x3a\40" . $versionKey . "\51"); writeln(str_repeat("\x2a", 32)); if (!$versionData["\x70\x68\160\x5f\x6d\157\144\x65\x5f\155\157\x64"]) { writeln("\x41\x70\141\143\150\145\40\155\157\x64\165\x6c\145\x20\x73\x75\x70\160\157\x72\164\40\50\x70\x68\x70\137\x6d\x6f\x64\145\x5f\155\157\144\51\40\x2d\x20\x3c\x66\x67\x3d\162\145\144\x3b\x6f\x70\x74\x69\x6f\156\163\75\142\157\x6c\144\76\116\x4f\x3c\57\x3e"); } else { writeln("\101\x70\141\143\x68\145\40\x6d\157\x64\x75\x6c\145\40\163\165\x70\160\157\162\x74\40\50\160\150\160\137\x6d\157\144\145\137\x6d\157\144\x29\x20\x2d\40\x3c\x66\x67\75\x67\x72\145\145\156\x3b\157\x70\164\151\x6f\156\x73\x3d\142\157\x6c\x64\76\131\105\123\74\57\76"); } if (!$versionData["\x70\150\160\x5f\155\157\x64\x65\137\143\x67\151"]) { writeln("\103\x47\x49\40\x73\165\x70\160\x6f\x72\164\x20\x28\160\150\x70\x5f\x6d\x6f\144\145\x5f\143\x67\x69\51\x20\55\40\74\146\147\75\x72\x65\144\73\157\160\x74\151\x6f\x6e\x73\75\142\x6f\x6c\x64\76\116\x4f\x3c\57\76"); } else { writeln("\103\107\x49\x20\x73\165\160\160\x6f\x72\x74\40\x28\x70\150\160\137\155\157\144\145\x5f\x63\147\151\x29\x20\55\x20\x3c\146\147\75\147\162\145\145\156\x3b\x6f\160\x74\x69\157\x6e\x73\x3d\x62\157\154\144\76\x59\x45\123\74\57\76"); } if (!$versionData["\160\150\x70\137\x6d\x6f\144\145\x5f\x66\143\x67\151\137\x61\160\141\x63\150\x65"]) { writeln("\101\160\x61\x63\150\x65\x20\x66\141\163\x74\x2d\143\147\x69\x20\x73\165\x70\160\x6f\x72\x74\40\50\160\x68\160\x5f\x6d\x6f\x64\x65\x5f\146\143\x67\151\x5f\x61\x70\141\143\150\x65\51\40\55\40\x3c\146\x67\75\x72\x65\x64\x3b\157\x70\x74\x69\x6f\156\x73\75\142\x6f\154\144\x3e\116\x4f\x3c\x2f\76"); } else { writeln("\x41\160\x61\143\150\145\x20\146\141\163\x74\55\x63\147\151\x20\x73\165\x70\x70\157\x72\x74\40\50\160\x68\160\137\155\x6f\x64\x65\137\x66\143\x67\x69\137\141\160\x61\143\x68\145\x29\x20\55\40\x3c\x66\x67\x3d\x67\162\145\x65\x6e\73\x6f\160\x74\151\157\x6e\163\x3d\x62\x6f\x6c\x64\76\x59\x45\x53\x3c\x2f\x3e"); } if (!$versionData["\x70\x68\x70\137\155\x6f\144\x65\x5f\x66\143\x67\x69\x5f\156\147\x69\x6e\x78\146\x70\155"]) { writeln("\x6e\x67\151\x6e\170\40\x66\x61\163\164\55\x63\x67\x69\40\x73\x75\x70\160\x6f\162\x74\x20\50\160\150\160\137\155\157\144\x65\137\x66\x63\147\151\137\x6e\x67\x69\x6e\x78\146\x70\x6d\51\40\55\x20\74\x66\x67\75\162\145\x64\x3b\157\160\x74\x69\157\x6e\163\x3d\142\157\x6c\x64\76\x4e\x4f\x3c\x2f\x3e"); } else { writeln("\x6e\x67\x69\x6e\x78\40\146\141\163\164\x2d\143\x67\151\40\163\165\160\x70\x6f\x72\164\40\50\x70\150\x70\137\155\x6f\144\x65\137\x66\143\147\151\x5f\156\147\x69\x6e\170\x66\x70\x6d\x29\x20\55\40\x3c\146\147\75\x67\162\145\x65\156\x3b\x6f\160\x74\x69\x6f\x6e\163\x3d\142\x6f\x6c\x64\76\131\x45\x53\74\x2f\76"); } writeln(str_repeat("\52", 32)); } }); desc("\123\x77\x69\x74\143\x68\145\x73\40\x50\x48\x50\x20\166\145\162\x73\x69\157\x6e\x20\146\157\x72\40\144\157\155\x61\x69\x6e"); task("\151\163\160\x6d\141\156\x61\147\x65\x72\x3a\x64\157\155\141\x69\x6e\x2d\x70\150\x70\55\x73\x65\154\x65\x63\x74", function () { $config = get("\151\x73\x70\155\141\156\141\x67\x65\162"); if (is_null($config["\x70\150\160\123\x65\154\x65\143\164"])) { warning("\x41\143\164\x69\157\156\x20\x66\x6f\x72\40\144\157\x6d\x61\x69\x6e\x20\x75\x70\x64\x61\x74\145\x20\x69\x73\40\x6e\x6f\164\x20\x61\143\164\x69\166\145"); return; } if (!isset($config["\160\150\x70\123\x65\154\145\x63\164"]["\x6e\x61\155\x65"]) || $config["\160\150\x70\x53\145\x6c\x65\143\164"]["\156\141\x6d\145"] == '') { throw new Exception("\111\156\x76\x61\154\151\x64\40\x64\157\x6d\141\x69\156\40\x6e\x61\155\x65\x21"); } $existDomains = get("\151\163\160\155\141\x6e\x61\x67\x65\x72\137\144\x6f\x6d\141\151\156\x73"); if (!in_array($config["\x70\150\160\123\145\154\x65\143\x74"]["\156\141\155\x65"], $existDomains)) { throw new Exception("\104\157\155\x61\151\156\40\156\157\x74\40\145\x78\x69\x73\164\41"); } if (!isset($config["\x70\150\160\x53\145\154\x65\x63\x74"]["\155\x6f\144\145"]) || !isset($config["\160\x68\x70\123\x65\x6c\x65\x63\x74"]["\166\145\162\x73\x69\157\156"])) { throw new Exception("\111\156\143\157\162\162\x65\143\x74\x20\163\145\x74\164\x69\x6e\147\163\x20\146\x6f\x72\40\163\x65\154\x65\143\x74\x20\160\150\160\x20\166\145\x72\x73\x69\x6f\156"); } $phpVersions = get("\x69\x73\160\155\141\x6e\x61\x67\145\162\137\160\150\x70\154\x69\x73\x74"); $newVersion = $config["\x70\150\160\x53\145\x6c\x65\143\x74"]["\x76\145\162\163\151\x6f\156"]; $newMode = $config["\160\150\160\x53\x65\x6c\x65\143\x74"]["\155\157\144\145"]; if (!isset($phpVersions[$newVersion])) { throw new Exception("\111\x6e\x63\157\x72\x72\x65\x63\x74\40\160\x68\160\x20\166\145\162\163\x69\157\156"); } $versionData = $phpVersions[$newVersion]; if (!isset($versionData[$newMode]) || !$versionData[$newMode]) { throw new Exception("\x49\x6e\143\157\162\x72\145\x63\x74\40\x70\x68\160\x20\x6d\157\x64\145"); } $domainUpdateRequest = array("\146\165\x6e\x63" => "\x77\145\x62\x64\157\x6d\x61\x69\156\56\145\x64\151\x74", "\x65\x6c\x69\144" => $config["\160\150\160\x53\145\x6c\x65\x63\164"]["\156\141\155\145"], "\156\141\x6d\145" => $config["\x70\x68\x70\x53\x65\x6c\x65\x63\x74"]["\x6e\141\155\x65"], "\x70\150\x70\x5f\155\x6f\144\x65" => $newMode, "\163\x6f\153" => "\157\x6b"); if ($newMode == "\x70\x68\160\x5f\x6d\x6f\144\x65\x5f\155\x6f\144") { $domainUpdateRequest["\x70\150\160\x5f\141\160\x61\x63\x68\145\137\166\145\162\x73\x69\157\x6e"] = $newVersion; } elseif ($newMode == "\160\150\160\137\x6d\157\x64\145\137\x63\x67\x69") { $domainUpdateRequest["\160\150\160\137\x63\x67\x69\137\166\x65\x72\163\x69\x6f\x6e"] = $newVersion; } elseif ($newMode == "\x70\150\x70\x5f\155\x6f\144\145\x5f\146\143\147\x69\x5f\x61\160\x61\143\x68\145") { $domainUpdateRequest["\x70\x68\x70\x5f\143\x67\x69\x5f\166\x65\x72\x73\x69\x6f\x6e"] = $newVersion; $domainUpdateRequest["\160\150\x70\137\141\160\141\x63\150\145\137\166\145\x72\163\x69\157\x6e"] = $newVersion; } elseif ($newMode == "\x70\x68\x70\137\x6d\157\x64\x65\137\146\143\147\x69\137\156\147\151\x6e\170\x66\x70\x6d") { $domainUpdateRequest["\160\x68\x70\x5f\143\x67\x69\x5f\166\x65\162\163\151\157\x6e"] = $newVersion; $domainUpdateRequest["\160\150\160\x5f\146\160\155\137\166\x65\x72\163\x69\157\156"] = $newVersion; } else { throw new Exception("\x55\x6e\x6b\156\157\x77\156\40\x50\110\x50\40\x6d\x6f\x64\x65\41"); } $response = ispmanagerRequest("\160\157\x73\x74", $domainUpdateRequest); if (isset($response["\144\x6f\x63"]["\145\x72\x72\157\162"]["\155\x73\x67"]["\x24"])) { throw new Exception($response["\144\157\143"]["\145\162\x72\157\162"]["\x6d\x73\147"]["\44"]); } else { info("\120\110\x50\40\x73\165\x63\143\x65\163\x73\x66\x75\x6c\x6c\171\x20\x73\145\154\x65\x63\164\145\144"); } }); desc("\x43\x72\145\x61\x74\x65\163\x20\x6e\145\167\40\x64\157\155\x61\151\156\x20\141\x6c\151\x61\x73"); task("\x69\163\x70\155\x61\156\141\147\145\162\72\144\157\155\x61\151\156\x2d\141\x6c\x69\141\x73\55\x63\x72\145\141\x74\x65", function () { $config = get("\x69\x73\x70\x6d\x61\x6e\x61\x67\x65\x72"); if (is_null($config["\143\162\145\x61\x74\145\x41\x6c\151\141\x73"])) { warning("\x41\143\164\151\157\x6e\x20\x66\x6f\162\40\141\x6c\151\x61\163\x20\x63\x72\145\141\x74\x65\40\151\x73\40\156\x6f\164\40\141\143\x74\x69\166\x65"); return; } if (!isset($config["\x63\x72\145\141\164\145\101\154\x69\141\x73"]["\156\x61\155\x65"]) || $config["\x63\162\x65\x61\x74\x65\x41\154\x69\x61\163"]["\x6e\x61\155\145"] == '') { throw new Exception("\x49\156\166\x61\154\x69\144\40\x64\x6f\x6d\x61\x69\x6e\x20\x6e\x61\x6d\145\x21"); } $existDomains = get("\x69\x73\x70\x6d\141\156\x61\x67\x65\162\x5f\144\x6f\x6d\141\151\x6e\163"); if (!in_array($config["\x63\162\x65\141\x74\x65\101\154\151\141\x73"]["\x6e\x61\155\145"], $existDomains)) { throw new Exception("\x44\157\x6d\x61\151\x6e\x20\x6e\157\x74\40\145\x78\x69\163\164\41"); } if (!isset($config["\143\162\x65\141\x74\145\101\154\151\x61\x73"]["\x61\154\151\x61\x73"]) || $config["\x63\x72\145\x61\164\x65\101\154\151\141\163"]["\141\154\x69\x61\163"] == '') { throw new Exception("\x49\156\x76\141\154\151\144\40\x61\x6c\151\141\163\x20\156\141\155\x65\41"); } $response = ispmanagerRequest("\x67\x65\164", array("\x66\x75\156\143" => "\x77\145\142\144\157\155\x61\151\x6e\x2e\145\144\151\x74", "\x65\x6c\x69\144" => $config["\x63\162\x65\x61\x74\x65\101\154\x69\x61\x73"]["\156\x61\x6d\145"], "\x65\154\156\x61\x6d\x65" => $config["\x63\x72\x65\x61\164\x65\x41\x6c\x69\x61\163"]["\x6e\141\x6d\x65"])); $existAliases = array(); if (isset($response["\144\x6f\143"]["\x61\154\x69\x61\163\145\163"]["\x24"])) { $existAliases = explode("\40", $response["\144\x6f\x63"]["\x61\154\151\141\163\145\x73"]["\44"]); } $newAliasList = array(); $createAliasList = explode("\40", $config["\143\x72\x65\x61\164\x65\x41\154\x69\141\163"]["\141\x6c\151\x61\163"]); foreach ($createAliasList as $createAlias) { if (in_array($createAlias, $existAliases)) { if (!isset($config["\x63\162\x65\x61\164\x65\x41\x6c\151\x61\x73"]["\x73\x6b\151\x70\111\146\105\x78\151\x73\x74"]) || !$config["\143\162\145\141\164\145\x41\x6c\x69\141\x73"]["\163\x6b\151\x70\x49\x66\x45\170\x69\x73\x74"]) { throw new Exception("\101\154\x69\x61\x73\40\141\154\x72\x65\x61\x64\171\x20\145\170\151\x73\164\x73\x21"); } else { warning("\101\154\151\x61\x73\x20" . $createAlias . "\40\141\154\162\145\141\x64\171\x20\x65\170\151\163\164\163\40\55\40\163\x6b\151\x70\x70\151\x6e\x67"); continue; } } $newAliasList[] = $createAlias; } $saveAliases = array_merge($existAliases, $newAliasList); $domainUpdateRequest = array("\x66\165\x6e\143" => "\167\x65\142\144\157\155\141\151\x6e\x2e\145\x64\151\x74", "\145\154\x69\x64" => $config["\143\x72\x65\141\x74\x65\101\154\151\141\163"]["\x6e\x61\x6d\x65"], "\x6e\141\155\145" => $config["\143\x72\145\x61\164\145\101\x6c\151\141\x73"]["\x6e\141\x6d\x65"], "\x61\x6c\x69\141\163\145\163" => implode("\x20", $saveAliases), "\163\x6f\x6b" => "\157\153"); $response = ispmanagerRequest("\x70\x6f\163\164", $domainUpdateRequest); if (isset($response["\x64\x6f\143"]["\x65\x72\x72\x6f\162"]["\x6d\163\x67"]["\44"])) { throw new Exception($response["\x64\x6f\x63"]["\x65\x72\162\x6f\x72"]["\x6d\163\x67"]["\x24"]); } else { info("\x41\154\151\141\163\40\x73\165\143\143\145\x73\x73\x66\165\154\x6c\x79\40\143\x72\145\141\164\145\144"); } }); desc("\104\x65\154\145\x74\x65\x73\40\144\x6f\x6d\141\x69\156\40\x61\154\x69\141\x73"); task("\x69\163\160\x6d\x61\156\x61\147\145\x72\72\144\x6f\155\141\151\156\x2d\x61\x6c\x69\141\x73\x2d\144\x65\x6c\145\164\x65", function () { $config = get("\x69\163\160\x6d\x61\x6e\141\147\x65\162"); if (is_null($config["\144\x65\154\145\x74\145\x41\x6c\x69\141\163"])) { warning("\101\x63\164\x69\x6f\x6e\40\x66\157\x72\x20\x61\154\151\x61\x73\x20\143\162\x65\141\164\145\x20\x69\x73\x20\156\x6f\164\x20\141\143\164\151\166\145"); return; } if (!isset($config["\x64\x65\154\x65\x74\145\x41\x6c\151\141\163"]["\156\141\155\145"]) || $config["\x64\145\154\145\164\145\101\x6c\151\x61\163"]["\156\x61\155\x65"] == '') { throw new Exception("\x49\156\166\141\x6c\151\x64\40\144\x6f\x6d\141\151\x6e\x20\x6e\x61\x6d\x65\41"); } $existDomains = get("\x69\163\160\155\x61\x6e\x61\147\145\162\x5f\x64\157\155\x61\x69\156\x73"); if (!in_array($config["\x64\145\x6c\145\x74\x65\101\154\151\x61\163"]["\x6e\141\155\145"], $existDomains)) { throw new Exception("\104\157\x6d\x61\x69\x6e\x20\156\157\x74\x20\145\170\x69\163\x74\x21"); } if (!isset($config["\144\x65\154\x65\x74\x65\x41\x6c\x69\x61\163"]["\x61\154\x69\x61\x73"]) || $config["\144\145\x6c\145\164\145\101\154\151\141\163"]["\141\154\x69\x61\x73"] == '') { throw new Exception("\x49\x6e\x76\x61\154\x69\x64\x20\141\x6c\151\x61\x73\40\156\x61\x6d\145\41"); } $response = ispmanagerRequest("\147\x65\x74", array("\146\x75\x6e\143" => "\x77\145\142\144\x6f\x6d\x61\x69\156\x2e\145\x64\151\164", "\145\154\x69\144" => $config["\x63\x72\x65\141\164\145\x41\154\x69\x61\163"]["\x6e\x61\155\145"], "\x65\154\x6e\x61\x6d\x65" => $config["\x63\162\145\141\164\145\101\x6c\x69\141\163"]["\156\x61\155\145"])); $existAliases = array(); if (isset($response["\x64\x6f\143"]["\141\x6c\151\x61\163\x65\x73"]["\x24"])) { $existAliases = explode("\x20", $response["\144\x6f\143"]["\141\x6c\x69\141\163\145\163"]["\x24"]); } $deleteAliasList = explode("\40", $config["\x64\145\x6c\x65\164\x65\101\154\151\141\x73"]["\x61\154\x69\141\x73"]); foreach ($deleteAliasList as $deleteAlias) { if (!in_array($deleteAlias, $existAliases)) { if (!isset($config["\144\145\154\145\164\145\101\x6c\151\x61\x73"]["\x73\153\x69\160\x49\x66\x4e\x6f\x74\x45\170\151\163\x74"]) || !$config["\144\x65\x6c\145\164\145\x41\154\x69\x61\x73"]["\x73\153\x69\160\x49\146\x4e\157\x74\x45\x78\151\163\164"]) { throw new Exception("\101\154\x69\x61\x73\40\156\157\164\40\x65\170\x69\163\x74\41"); } else { warning("\x41\x6c\151\141\x73\x20" . $deleteAlias . "\40\x6e\157\x74\x20\x65\x78\x69\163\x74\x20\55\40\x73\x6b\151\x70\160\151\x6e\x67"); continue; } } if (($index = array_search($deleteAlias, $existAliases)) !== FALSE) { unset($existAliases[$index]); } } $domainUpdateRequest = array("\146\165\156\143" => "\x77\145\x62\144\157\155\x61\151\x6e\56\145\144\151\x74", "\x65\x6c\151\x64" => $config["\144\145\x6c\x65\x74\x65\x41\154\151\141\x73"]["\x6e\141\155\145"], "\x6e\141\x6d\145" => $config["\144\145\154\x65\x74\x65\x41\154\151\141\x73"]["\x6e\141\x6d\145"], "\x61\154\151\x61\163\145\163" => implode("\x20", $existAliases), "\x73\157\x6b" => "\x6f\153"); $response = ispmanagerRequest("\x70\157\x73\x74", $domainUpdateRequest); if (isset($response["\144\x6f\x63"]["\x65\162\162\x6f\162"]["\x6d\x73\147"]["\44"])) { throw new Exception($response["\x64\157\x63"]["\145\x72\162\157\162"]["\155\x73\147"]["\44"]); } else { info("\101\154\x69\141\x73\40\x73\165\x63\x63\145\x73\163\146\165\154\x6c\x79\x20\x64\x65\154\145\164\145\144"); } }); desc("\104\145\x6c\145\x74\145\163\40\144\157\155\x61\x69\156"); task("\x69\163\160\x6d\141\x6e\x61\147\145\x72\72\x64\157\155\x61\x69\x6e\55\144\145\x6c\x65\164\x65", function () { $config = get("\x69\163\160\x6d\141\x6e\141\147\145\x72"); if (is_null($config["\144\145\154\145\x74\145\x44\x6f\x6d\141\x69\156"])) { warning("\x41\143\164\151\157\156\40\x66\157\x72\40\144\157\x6d\141\x69\x6e\x20\144\145\x6c\x65\164\x65\x20\x69\163\x20\156\x6f\x74\x20\x61\x63\x74\x69\x76\x65"); return; } if (!isset($config["\144\145\154\x65\x74\x65\104\x6f\x6d\141\x69\156"]["\156\x61\155\x65"]) || $config["\x64\145\154\145\164\x65\104\x6f\155\141\x69\x6e"]["\156\141\x6d\145"] == '') { throw new Exception("\x49\x6e\x76\141\154\151\144\40\x64\157\155\141\151\156\x20\x6e\141\x6d\x65\41"); } $existDomains = get("\x69\163\160\155\141\156\x61\147\145\x72\x5f\144\x6f\155\x61\x69\x6e\163"); if (!in_array($config["\x64\x65\154\x65\x74\x65\x44\x6f\x6d\141\151\156"]["\x6e\x61\x6d\x65"], $existDomains)) { if (!isset($config["\x64\x65\154\145\164\145\x44\157\155\x61\151\156"]["\x73\153\x69\x70\111\146\116\157\x74\105\170\151\163\x74"]) || !$config["\144\145\x6c\x65\164\145\104\157\155\x61\x69\x6e"]["\163\x6b\151\160\x49\146\116\157\164\105\170\151\x73\164"]) { throw new Exception("\x44\x6f\x6d\x61\x69\156\x20\x6e\x6f\x74\40\x65\x78\151\x73\164\x21"); } else { warning("\104\157\155\141\x69\156\40\156\157\164\x20\x65\170\x69\x73\164\x20\55\x20\163\153\x69\x70\160\151\x6e\147"); return; } } $domainDeleteRequest = array("\146\165\156\x63" => "\x77\145\x62\x64\157\x6d\141\151\x6e\x2e\x64\145\154\x65\164\x65\56\x63\x6f\156\146\151\162\155", "\145\154\151\x64" => $config["\x64\x65\x6c\145\164\x65\104\x6f\x6d\141\x69\156"]["\156\x61\x6d\x65"], "\163\x6f\x6b" => "\x6f\x6b"); if (!isset($config["\x64\145\154\x65\164\x65\104\x6f\x6d\x61\151\x6e"]["\162\145\155\157\x76\145\x44\151\162"]) || !$config["\x64\x65\154\145\x74\145\104\x6f\x6d\x61\151\x6e"]["\x72\145\x6d\157\x76\x65\104\151\x72"]) { $domainDeleteRequest["\162\145\x6d\x6f\166\x65\137\144\x69\162\145\x63\x74\x6f\x72\171"] = "\157\146\146"; } else { $domainDeleteRequest["\162\145\155\157\x76\145\137\x64\151\162\x65\143\x74\x6f\x72\x79"] = "\x6f\156"; } $response = ispmanagerRequest("\160\x6f\163\164", $domainDeleteRequest); if (isset($response["\x64\x6f\143"]["\145\162\162\157\162"]["\155\x73\147"]["\44"])) { throw new Exception($response["\144\157\x63"]["\145\x72\162\157\162"]["\x6d\163\147"]["\x24"]); } else { info("\x44\x6f\x6d\141\x69\156\x20\163\x75\143\x63\145\x73\163\x66\x75\x6c\x6c\171\40\144\x65\x6c\x65\164\145\x64"); } }); desc("\101\165\164\157\x20\164\141\x73\x6b\40\x70\162\x6f\x63\x65\163\x73\x69\x6e\x67"); task("\x69\x73\x70\155\141\156\x61\147\145\x72\72\x70\x72\x6f\x63\x65\163\x73", function () { $config = get("\x69\163\x70\x6d\x61\156\x61\x67\145\162"); if (!is_null($config["\143\x72\x65\141\x74\x65\104\141\x74\x61\142\x61\x73\145"])) { invoke("\151\x73\x70\155\141\x6e\x61\147\x65\x72\72\x64\142\55\143\x72\x65\141\x74\145"); } if (!is_null($config["\144\145\154\145\x74\x65\x44\x61\164\141\142\x61\x73\145"])) { invoke("\151\163\x70\x6d\141\x6e\141\147\x65\x72\72\x64\142\x2d\x64\x65\x6c\x65\x74\145"); } if (!is_null($config["\x63\x72\x65\141\164\x65\x44\x6f\x6d\141\151\156"])) { invoke("\x69\x73\x70\x6d\141\x6e\141\147\x65\162\72\x64\157\155\141\x69\156\x2d\x63\x72\145\141\x74\x65"); } if (!is_null($config["\144\x65\154\145\x74\145\x44\157\155\x61\x69\x6e"])) { invoke("\151\x73\x70\155\x61\x6e\x61\x67\145\x72\x3a\x64\x6f\155\141\151\156\55\144\x65\154\145\x74\x65"); } if (!is_null($config["\x70\x68\x70\x53\x65\x6c\x65\143\x74"])) { invoke("\x69\x73\160\155\x61\x6e\x61\147\145\x72\x3a\144\x6f\155\141\151\x6e\x2d\160\x68\x70\x2d\x73\x65\154\145\143\164"); } if (!is_null($config["\x63\x72\x65\x61\164\145\101\x6c\151\141\163"])) { invoke("\151\163\x70\155\141\156\x61\147\x65\x72\72\x64\157\155\x61\151\156\x2d\x61\x6c\151\141\x73\x2d\x63\162\145\x61\x74\145"); } if (!is_null($config["\x64\145\x6c\145\x74\145\x41\154\151\x61\163"])) { invoke("\151\163\x70\155\x61\156\x61\x67\145\162\x3a\x64\157\155\x61\x69\x6e\x2d\x61\x6c\151\141\163\x2d\144\145\154\145\164\x65"); } }); function ispmanagerRequest($method, $requestData) { $config = get("\x69\163\160\155\141\x6e\141\x67\145\162"); $dsnData = parse_url($config["\x61\160\x69"]["\x64\x73\x6e"]); $requestUrl = $dsnData["\163\x63\x68\145\155\x65"] . "\x3a\57\x2f" . $dsnData["\x68\x6f\163\x74"] . "\72" . $dsnData["\x70\x6f\162\164"] . $dsnData["\160\141\164\150"]; if ($config["\x61\160\x69"]["\163\x65\x63\x75\x72\145"] && get("\151\163\x70\x6d\141\x6e\141\147\x65\x72\x5f\163\145\x73\163\x69\157\156") == '') { ispmanagerAuthRequest($requestUrl, $dsnData["\x75\163\145\162"], $dsnData["\160\x61\x73\x73"]); } if ($method == "\x70\x6f\x73\164") { return Httpie::post($requestUrl)->formBody(prepareRequest($requestData))->setopt(CURLOPT_SSL_VERIFYPEER, false)->setopt(CURLOPT_SSL_VERIFYHOST, false)->getJson(); } elseif ($method == "\x67\145\x74") { return Httpie::get($requestUrl)->query(prepareRequest($requestData))->setopt(CURLOPT_SSL_VERIFYPEER, false)->setopt(CURLOPT_SSL_VERIFYHOST, false)->getJson(); } else { throw new Exception("\125\x6e\x6b\x6e\x6f\x77\156\40\x72\145\161\x75\145\x73\x74\x20\155\145\164\150\x6f\x64"); } } function ispmanagerAuthRequest($url, $login, $pass) { $authRequestData = array("\x66\x75\156\143" => "\141\165\x74\x68", "\165\163\x65\162\x6e\x61\x6d\145" => $login, "\x70\141\x73\163\167\x6f\162\x64" => $pass); $responseData = Httpie::post($url)->setopt(CURLOPT_SSL_VERIFYPEER, false)->setopt(CURLOPT_SSL_VERIFYHOST, false)->formBody(prepareRequest($authRequestData))->getJson(); if (isset($responseData["\144\x6f\143"]["\141\x75\164\x68"]["\44\x69\x64"])) { set("\151\x73\160\155\141\156\141\147\145\x72\x5f\163\x65\x73\x73\x69\157\x6e", $responseData["\144\x6f\143"]["\x61\x75\164\150"]["\44\151\144"]); } else { throw new Exception("\x45\162\x72\x6f\162\x20\x77\150\151\x6c\x65\x20\x63\162\145\x61\164\x65\x20\141\165\164\x68\40\x73\x65\x73\163\151\x6f\156"); } } function prepareRequest($requestData) { $config = get("\x69\163\160\155\141\x6e\x61\x67\145\162"); $dsnData = parse_url($config["\141\x70\151"]["\x64\x73\x6e"]); if (!isset($requestData["\157\x75\164"])) { $requestData["\157\165\164"] = "\x6a\163\x6f\x6e"; } if (!$config["\141\x70\x69"]["\163\145\143\165\162\x65"]) { $requestData["\141\165\x74\x68\151\x6e\x66\x6f"] = $dsnData["\x75\x73\x65\x72"] . "\x3a" . $dsnData["\160\141\163\x73"]; } else { if (get("\x69\163\x70\155\x61\156\141\x67\145\162\x5f\x73\145\163\163\x69\x6f\x6e") != '') { $requestData["\x61\165\x74\x68"] = get("\x69\163\160\155\141\156\x61\x67\145\x72\x5f\163\145\163\163\151\x6f\x6e"); } } return $requestData; } function generatePassword($lenght) { return substr(md5(uniqid()), 0, $lenght); } before("\x69\x73\x70\155\141\156\141\147\x65\162\x3a\144\x6f\155\141\151\x6e\x2d\141\154\151\x61\x73\55\143\162\145\x61\x74\x65", "\x69\x73\160\x6d\141\x6e\141\x67\x65\162\72\x69\156\151\164"); before("\x69\x73\160\x6d\x61\156\x61\x67\x65\162\x3a\144\x6f\155\x61\151\x6e\x2d\x61\154\x69\141\163\55\x64\x65\154\x65\x74\x65", "\151\163\160\x6d\141\x6e\x61\x67\145\x72\72\x69\x6e\151\164"); before("\151\x73\160\155\x61\156\x61\147\x65\162\x3a\x64\157\155\141\x69\x6e\x2d\x63\x72\145\141\x74\x65", "\151\163\160\155\x61\156\x61\147\x65\162\72\x69\x6e\151\x74"); before("\151\x73\160\x6d\x61\156\x61\147\145\x72\72\144\x6f\155\x61\151\x6e\55\x64\x65\x6c\x65\164\145", "\x69\163\160\x6d\141\x6e\x61\x67\x65\162\72\151\156\151\x74"); before("\151\x73\160\155\141\156\x61\147\x65\162\72\x64\157\x6d\x61\151\x6e\x2d\160\150\160\x2d\x73\145\154\x65\143\164", "\151\163\x70\x6d\x61\156\141\x67\145\162\72\x69\x6e\x69\164"); before("\x69\163\x70\155\x61\156\x61\147\145\x72\72\x64\x62\55\x63\x72\x65\x61\164\x65", "\x69\x73\x70\x6d\x61\156\141\147\145\162\72\x69\x6e\x69\164"); before("\x69\163\160\x6d\x61\x6e\x61\x67\145\x72\x3a\144\142\55\x64\145\x6c\x65\164\145", "\151\163\160\x6d\x61\x6e\141\x67\145\x72\72\151\x6e\151\x74");

Function Calls

None

Variables

None

Stats

MD5 1487eeb356dfbe9a9381eaf30d112339
Eval Count 0
Decode Time 235 ms