PageSourceSearch

https://gongwer.com/login/login.js

js gongwer.com collected 2026-10-04 00:25:05 UTC 3,641 bytes, 118 lines download raw bytes

1/**
2 * @author Christopher Klaver
3 */
4
5var widgetId1;
6var onloadCallback = function() {
7    // Renders the HTML element with id 'example1' as a reCAPTCHA widget.
8    // The id of the reCAPTCHA widget is assigned to 'widgetId1'.
9    widgetId1 = grecaptcha.render('logingrcheck', {
10      'sitekey' : '6LckaQ0bAAAAAAtrUPqKLhoP7J1DXTqTQmsuS5MN',
11      'theme' : 'light',
12      'size' : 'normal'
13    });
14};
15
16function sendPassword() {
17    var emailSubmitted = document.getElementById('email').value,
18    $grResponse = grecaptcha.getResponse(onloadCallback.widgetId1);
19    var emailValid = echeck(emailSubmitted);
20    if (emailValid == false) {
21        alert("You have not entered a valid email address.");
22        return false;
23    }
24    if ($grResponse.length <= 1) {
25        alert('You must answer the reCAPTCHA to submit the form.');
26        return false;
27    }
28    //url = "passwordsubmit.cfm";
29    let formReturn = "email=" + emailSubmitted + "&G-RECAPTCHA-RESPONSE=" + $grResponse;
30    // console.log(formReturn);
31    $.ajax ({
32        type: "POST",
33        url: "passwordsubmit.cfm",
34        data: "email=" + emailSubmitted + "&G-RECAPTCHA-RESPONSE=" + $grResponse,
35        success: function(result){
36            if (confirm("Your request to reset you password has been sent to " + emailSubmitted + ".\nIf you have an active subscription, you should receive an email with reset instructions shortly.\nIf you do not, please use the Contact Us link below to contact Gongwer News Service.")){
37                window.location = 'index.cfm';
38            }
39        }
40    });
41    return false;
42}
43
44function validateForm() {
45
46    var $form = $('#formLogin'),
47        $password = $form.find('#password'),
48        $confirmPassword = $form.find('#password2');
49
50    var password = $password.val(),
51        confirmPassword = $confirmPassword.val();
52
53    if (password.length == 0) {
54        alert('You have not entered a password.');
55        $confirmPassword.focus();
56        return false;
57    }
58
59    if (password != confirmPassword) {
60        alert('The passwords you entered do not match.');
61        $confirmPassword.focus();
62        return false;
63    }
64    
65 	return true;
66}
67
68function loginTest() {
69    var $password = document.getElementById('password'),
70        $username = document.getElementById('username'),
71        returnVal = true;
72    if ($username.value == '' || $password.value == '') {
73        alert('You did not provide full login credentials.');
74        returnVal = false;
75    }
76    return returnVal;
77}
78
79function checkMFA() {
80    let pageReturn = false
81    let $mfa = document.getElementById('mfa');
82
83    if ($mfa.value == '') {
84        alert('You must enter your one-time password.');
85    }
86    if ($mfa.value.length != 6) {
87        alert('Your one-time password must be 6 digits.');
88    }
89    else {
90        pageReturn = true;
91        const cookies = siteCookies();
92        if (!isNaN(cookies.SID)) {
93            document.getElementById('sessionID').value = cookies.SID;
94        }
95    }
96    return pageReturn;
97}
98
99function resendMFA() {
100
101    const cookies = siteCookies();
102
103    if (!isNaN(cookies.SID)) {
104        let url = "login.cfc?method=sendMFA&sessionID=" + cookies.SID;
105        $.get(url);
106        alert('A new one-time password has been sent to your email address.');
107    }
108}
109
110function siteCookies() {
111    const cookies = document.cookie.split(';').reduce((acc, cookie) => {
112        const [name, value] = cookie.trim().split('=');
113        acc[name] = value;
114        return acc;
115    }, {});
116
117    return cookies;
118}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.