コード例 #1
0
ファイル: namedmanager.php プロジェクト: claybbs/namedmanager
 function log_write($timestamp, $log_type, $log_contents)
 {
     log_write("debug", "api_namedmanager", "Executing get_customer_from_by_code({$code_customer})");
     if ($this->auth_online) {
         // refuse authentication if logging disabled
         if (!$GLOBALS["config"]["FEATURE_LOGS_API"]) {
             throw new SoapFault("Sender", "FEATURE_DISABLED");
         }
         // sanitise input
         $timestamp = @security_script_input_predefined("int", $timestamp);
         $log_type = @security_script_input_predefined("any", $log_type);
         $log_contents = @security_script_input_predefined("any", $log_contents);
         if (!$timestamp || $timestamp == "error" || !$log_type || $log_type == "error" || !$log_contents || $log_contents == "error") {
             throw new SoapFault("Sender", "INVALID_INPUT");
         }
         // write log
         $log = new changelog();
         $log->id_server = $this->auth_server;
         $log->log_post($log_type, $log_contents, $timestamp);
     } else {
         throw new SoapFault("Sender", "ACCESS_DENIED");
     }
 }
コード例 #2
0
ファイル: inc_domain.php プロジェクト: claybbs/namedmanager
 function action_delete_record()
 {
     log_debug("domain", "Executing action_delete_record()");
     /*
     	Start Transaction
     */
     $this->sql_obj->trans_begin();
     /*
     	Delete domain record
     */
     $this->sql_obj->string = "DELETE FROM `dns_records` WHERE id='" . $this->id_record . "' LIMIT 1";
     $this->sql_obj->execute();
     /*
     	Commit
     */
     if (error_check()) {
         $this->sql_obj->trans_rollback();
         log_write("error", "domain_records", "An error occured whilst trying to delete the selected domain record.");
         return 0;
     } else {
         $this->sql_obj->trans_commit();
         log_write("notification", "domain_records", "The domain record has been successfully deleted.");
         $log = new changelog();
         $log->id_domain = $this->id;
         $log->log_post("audit", "Domain record type " . $this->data_record["type"] . " " . $this->data_record["name"] . "/" . $this->data_record["content"] . " has been deleted from domain " . $this->data["domain_name"] . "");
         return 1;
     }
 }
コード例 #3
0
ファイル: inc_servers.php プロジェクト: claybbs/namedmanager
 function action_update_config_version($version)
 {
     log_debug("name_server", "Executing action_update_config_version({$version})");
     /*
     	Start Transaction
     */
     $sql_obj = new sql_query();
     $sql_obj->trans_begin();
     /*
     	Update configuration version
     */
     $sql_obj->string = "UPDATE `name_servers` SET api_sync_config='{$version}' WHERE id='" . $this->id . "' LIMIT 1";
     $sql_obj->execute();
     /*
     	Commit
     */
     if (error_check()) {
         $sql_obj->trans_rollback();
         log_write("error", "name_server", "An error occured when updating the name server.");
         return 0;
     } else {
         $sql_obj->trans_commit();
         log_write("notification", "name_server", "Name server version has been successfully updated.");
         $log = new changelog();
         $log->id_server = $this->id;
         $log->log_post("server", "Updated name server " . $this->data["server_name"] . " to configuration version " . $version . " and reloaded");
         return 1;
     }
 }