✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ webm004.cluster127.gra.hosting.ovh.net ​🇻​♯➤ 6.18.42-ovh-vps-grsec-zfs+ #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 54.36.91.62 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.191
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ _dyuweyrj4,_dyuweyrj4r,dl

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/cli/auth/cgi_bin/js//BaseAuth.js
class BaseAuth {
    constructor(root, settings) {
        this.root = root;
        this.settings = settings;
        this.translatableStrings = {
            keyCopied: this.settings.translatables.keyCopied,
            // ... add more strings as needed
        };
    }
    getElement = (id) => document.getElementById(id);

    getCheckedInputValue = (name) => document.querySelector(`input[name="${name}"]:checked`).value;

    /**
     * Performs a fetch operation.
     *
     * @param {string} urlExtension - The URL extension to perform the fetch operation on.
     * @param {Object} data - The data to be sent in the fetch operation.
     * @param {string} [method='POST'] - The HTTP method to be used in the fetch operation. Defaults to 'POST'.
     * @returns {Promise} - A Promise that resolves with the response of the fetch operation.
     */
    performFetchOp = (urlExtension, data, method = 'POST') => {
        let url = this.root + urlExtension;
        let fetchParams = {
            method: method,
            headers: {'Content-Type': 'application/json',},
        };
        if (method === 'POST') {
            fetchParams.body = JSON.stringify(data);
        }
        return fetch(url, fetchParams);
    };

    assignClickListener = (id, callback) => {
        const element = this.getElement(id);
        if (element) {
            element.addEventListener('click', function (e) {
                e.preventDefault();
                callback();
            });
        }
    }



    logFetchError = (error) => console.error('There has been a problem with your fetch operation:', error);

    /**
     * Generates a QR code for Two-Factor Authentication using the TOTP URL.
     * If the TOTP URL is not available, nothing will be generated.
     *
     * @function qr_generator
     * @returns {void} Nothing is returned.
     */
    qr_generator = () => {
        const totp_url = this.settings.totp_data.totp_url;
        if (!totp_url) {
            return;
        }

        let qr = qrcode(0, 'L');
        qr.addData(totp_url);
        qr.make();
        let qrElem = document.querySelector('#two-factor-qr-code a');
        if (qrElem != null) {
            qrElem.innerHTML = qr.createSvgTag(5);
        }
    };

    /**
     * Downloads backup codes as a text file.
     *
     * @function download_codes
     */
    download_codes = () => {
        let TextToCode = this.settings.totp_data.backup_codes;
        let TextToCodeString = '';
        TextToCode.forEach(function (item) {
            TextToCodeString += item + '\n';
        });
        let downloadLink = document.createElement('a');
        downloadLink.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(TextToCodeString));
        downloadLink.setAttribute('download', 'backup_codes.txt');
        downloadLink.style.display = 'none';
        document.body.appendChild(downloadLink);
        downloadLink.click();
        document.body.removeChild(downloadLink);
    };

    /**
     * This function copies the text from the `totp_data.key` property of the `settings` object
     * using the Clipboard API. It then shows a success message and reverts back to the original display
     * after a specified timeout.
     *
     * @function copyTextAndShowMessage
     * @memberof BaseAuth
     */
    copyTextAndShowMessage = () => {
        let text = this.settings.totp_data.key; // Get the text to be copied

        // Use Clipboard API to copy the text
        navigator.clipboard.writeText(text).then(() => {
            // Change the display of the key
            let originalText = this.getElement('totp-key').innerText;
            this.getElement('totp-key').innerText = this.translatableStrings.keyCopied;
            this.getElement('totp-key').style.color = 'green';

            // Revert back to original text after a timeout
            setTimeout(() => {
                this.getElement('totp-key').innerText = originalText;
                this.getElement('totp-key').style.color = ''; // Reset the color
            }, 2000); // Adjust timeout as needed

        }, function (err) {
            console.error(this.settings.translatables.keyCopiedFailed, err);
        });
    }

}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
26 Sep 2026 5.34 PM
docteuh / users
0755
BaseAuth.js
4.133 KB
18 Jun 2026 6.25 PM
docteuh / users
0644
initialize_two_fa.js
2.539 KB
18 Jun 2026 6.25 PM
docteuh / users
0644
onboarding.js
7.529 KB
18 Jun 2026 6.25 PM
docteuh / users
0644
profile.js
8.281 KB
18 Jun 2026 6.25 PM
docteuh / users
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF