function check_update_version() { log_write("debug", "api_namedmanager", "Executing check_update_version()"); if ($this->auth_online) { $obj_server = new name_server(); $obj_server->id = $this->auth_server; $obj_server->load_data(); if ($obj_server->data["sync_status_config"]) { log_write("debug", "api_namedmanager", "Configuration is OUT OF SYNC!"); return sql_get_singlevalue("SELECT value FROM config WHERE name='SYNC_STATUS_CONFIG' LIMIT 1"); } else { log_write("debug", "api_namedmanager", "Configuration is all up-to-date"); return 0; } } else { throw new SoapFault("Sender", "ACCESS_DENIED"); } }
require "../include/config.php"; require "../include/amberphplib/main.php"; require "../include/application/main.php"; if (user_permissions_get('namedadmins')) { /* Form Input */ $obj_name_server = new name_server(); $obj_name_server->id = security_form_input_predefined("int", "id_name_server", 0, ""); // are we editing an existing server or adding a new one? if ($obj_name_server->id) { if (!$obj_name_server->verify_id()) { log_write("error", "process", "The name server you have attempted to edit - " . $obj_name_server->id . " - does not exist in this system."); } else { // load existing data $obj_name_server->load_data(); } } // Server/API Type $obj_name_server->data["server_type"] = security_form_input_predefined("any", "server_type", 1, ""); switch ($obj_name_server->data["server_type"]) { case "route53": $obj_name_server->data["server_name"] = security_form_input("/^[\\S\\s]*\$/", "server_name", 1, "Must be a simple string, eg \"Route53 Cloud\""); $obj_name_server->data["server_primary"] = 0; $obj_name_server->data["server_record"] = 1; $obj_name_server->data["route53_access_key"] = security_form_input_predefined("any", "route53_access_key", 1, ""); $obj_name_server->data["route53_secret_key"] = security_form_input_predefined("any", "route53_secret_key", 0, ""); // we store both credentials in the single api filed as serialized keys if (empty($obj_name_server->data["route53_secret_key"]) && !empty($obj_name_server->data["api_auth_key"])) { // we have existing credetials, unserize the old secret key and pass it back. $keys = unserialize($obj_name_server->data["api_auth_key"]);