AnonSec Shell
Server IP : 104.21.37.246  /  Your IP : 104.23.243.32   [ Reverse IP ]
Web Server : Apache
System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64
User : cp648411 ( 1354)
PHP Version : 7.2.34
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/2388322/task/2388322/cwd/sharedjs/zone_editor/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /proc/2388322/task/2388322/cwd/sharedjs/zone_editor/utils/recordSet.js
/*
# cpanel - base/sharedjs/zone_editor/utils/recordSet.js
#                                                  Copyright 2022 cPanel, L.L.C.
#                                                           All rights reserved.
# [email protected]                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
*/

define( [
    "lodash",
], function(_) {
    "use strict";

    // cf. DNS_RDATATYPEATTR_SINGLETON in bind9.
    var IS_SINGLETON_TYPE = {
        CNAME: true,

        // DNAME and SOA are also singleton types, but
        // we don’t handle DNAME, and this interface doesn’t
        // expose controls to create additional SOAs.
    };

    function RecordSet() {
        this.records = [];
    }
    Object.assign(
        RecordSet.prototype,
        {
            _ttlsAllMatch: true,

            _ttl: null,

            add: function add(record) {
                record.ttl = parseInt(record.ttl, 10);

                this.records.push(record);

                if (this._ttl) {
                    this._ttlsAllMatch = (this._ttl === record.ttl);
                } else {
                    this._ttl = record.ttl;
                }
            },

            ttlsMismatch: function ttlsMismatch() {
                return !this._ttlsAllMatch;
            },

            singletonExcess: function singletonExcess() {
                return IS_SINGLETON_TYPE[this.records[0].record_type] ? this.records.length > 1 : false;
            },

            ttls: function ttls() {
                return _.uniq(
                    this.records.map(
                        function(r) {
                            return r.ttl;
                        }
                    )
                );
            },

            count: function count() {
                return this.records.length;
            },

            name: function name() {
                return this.records[0].name;
            },

            type: function type() {
                return this.records[0].record_type;
            },
        }
    );

    return RecordSet;
});

Anon7 - 2022
AnonSec Team