Пример #1
0
 function log_post($log_type, $log_contents, $timestamp = NULL)
 {
     log_debug("changelog", "Executing log_post({$log_type}, {$log_contents}, {$timestamp})");
     // check audit logging
     if (!$GLOBALS["config"]["FEATURE_LOGS_AUDIT"] && $log_type == "audit") {
         // audit logging is disabled
         return 0;
     }
     // do retention clean check
     if ($GLOBALS["config"]["LOG_RETENTION_PERIOD"]) {
         // check when we last ran a retention clean
         if ($GLOBALS["config"]["LOG_RETENTION_CHECKTIME"] < time() - 86400) {
             $this->log_retention_clean();
         }
     }
     if (empty($timestamp)) {
         $timestamp = time();
     }
     // write log
     $sql_obj = new sql_query();
     $sql_obj->string = "INSERT INTO logs (id_server, id_domain, username, timestamp, log_type, log_contents) VALUES ('" . $this->id_server . "', '" . $this->id_domain . "', '" . $this->username . "', '{$timestamp}', '{$log_type}', '{$log_contents}')";
     $sql_obj->execute();
     // update last sync on name server
     if ($this->id_server) {
         $obj_server = new name_server();
         $obj_server->id = $this->id_server;
         $obj_server->action_update_log_version($timestamp);
     }
     return 1;
 }
Пример #2
0
	servers/edit-process.php

	access:
		namedadmins

	Updates or creates a new name server entry.
*/
// includes
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\"");
Пример #3
0
 function set_update_version($version)
 {
     log_write("debug", "api_namedmanager", "Executing set_update_version({$version})");
     if ($this->auth_online) {
         $obj_server = new name_server();
         $obj_server->id = $this->auth_server;
         return $obj_server->action_update_config_version($version);
     } else {
         throw new SoapFault("Sender", "ACCESS_DENIED");
     }
 }
Пример #4
0
	servers/delete-process.php

	access:
		namedadmins

	Deletes an unwanted server.
*/
// includes
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, "");
    // for error return if needed
    @security_form_input_predefined("any", "server_name", 1, "");
    @security_form_input_predefined("any", "server_description", 0, "");
    // confirm deletion
    @security_form_input_predefined("any", "delete_confirm", 1, "You must confirm the deletion");
    /*
    	Verify Data
    */
    // verify the selected server exists
    if (!$obj_name_server->verify_id()) {
        log_write("error", "process", "The server you have attempted to delete - " . $obj_name_server->id . " - does not exist in this system.");
    }
    /*
    	Process Data