PageSourceSearch

https://farmxl.com.au/farmxl/.static/LoginFunctions.js

js farmxl.com.au collected 2026-10-02 01:17:09 UTC 6,187 bytes, 161 lines download raw bytes

1function show_login_screen(logon_name, plain_password, invite_code){
2     location.replace('/farmxl/trylogin?LogonName=' + logon_name + '&PlainPassword='
3                    + plain_password + '&InviteCode=' + invite_code + '');
4}
5
6
7function attempt_login(){
8    var logon_name = document.getElementById("LogonName").value;
9    var plain_password = document.getElementById("PlainPassword").value;
10    var invite_code = document.getElementById("InviteCode").value;
11    var dont_jump = document.getElementById("DontJump").value;
12    var goto_url = document.getElementById("GotoURL").value;
13
14    $.post("/farmxl/trylogin/json",
15    {
16      LogonName: logon_name,
17      PlainPassword: plain_password,
18      InviteCode: invite_code,
19      DontJump: dont_jump,
20	  GotoURL: goto_url,
21    },
22    function(data,status){
23		if (data.TryLoginResult.GotoDashboard)
24		{
25			location.replace('/farmxl/dashboard');
26		}
27		else if (data.TryLoginResult.GotoDefault)
28		{
29			location.replace('/farmxl/default');
30		}
31		else if (data.TryLoginResult.JumpToURL)
32        {
33			newurl = data.TryLoginResult.GotoURL;
34			newurl = '/' + decodeURI(newurl);
35            location.replace(newurl);
36        }
37		else if (data.TryLoginResult.GotoAcceptInvite)
38        {
39            location.replace('/farmxl/property/AcceptInvite?InviteCode=' + data.TryLoginResult.InviteCode
40                               + '&Email=' + data.TryLoginResult.LogonName);
41        }
42		else if (data.TryLoginResult.DontJump)
43        {
44            $("#login_dialog").modal("hide");
45        }
46		else
47        {
48			document.getElementById("dialog_title").innerHTML = "Login failed!";
49			document.getElementById("dialog_content").innerHTML = data.TryLoginResult.ErrMsg;
50			$("#ModalDialog").modal();
51        }
52    })
53    .fail(function() {
54		document.getElementById("dialog_title").innerHTML = "Login Failed!";
55		document.getElementById("dialog_content").innerHTML = "Unable to contact the server at this time. Try again later.";
56		$("#ModalDialog").modal();
57    })
58    ;
59}
60
61
62
63function sign_up(){
64        var user_name = document.getElementById("sign_up_dialog_username").value;
65        var email_addr = document.getElementById("sign_up_dialog_email").value;
66        var new_password = document.getElementById("sign_up_dialog_psw1").value;
67        var retry_password = document.getElementById("sign_up_dialog_psw2").value;
68        var invite_code = document.getElementById("invite_code").value;
69
70        if (new_password != retry_password)
71        {
72            $('#sign_up_dialog_different_password_error').show();
73        }
74
75        else
76        {
77            $.post("/farmxl/signup/json",
78            {
79              UserName: user_name,
80              Email: email_addr,
81              Password:  new_password,
82              InviteCode: invite_code,
83
84            },
85            function(data,status){
86              if (data.SignUpResult.Success)
87                {
88                  $("#sign_up_dialog").modal("hide");
89                  document.getElementById("dialog_title").innerHTML = "Sign Up Email Sent";
90                  document.getElementById("dialog_content").innerHTML = "A validation email has been sent to your email address. You must validate your account using the link in the email, before you can login. NOTE: Check your SPAM folder if the email does not appear in your inbox.";
91                  $("#ModalDialog").modal();
92                  if (data.SignUpResult.InviteCode != null)
93                    {
94                      $("#ModalDialog").on('hide.bs.modal', function() {
95                          //location.reload();
96                          location.assign(location.protocol + "//" + location.hostname
97                              + location.pathname + "?AcceptedAfterSignIn=true");
98                        });
99                    }
100                }
101              else
102                {
103                  document.getElementById("dialog_title").innerHTML = "Sign Up FAILED!";
104                  document.getElementById("dialog_content").innerHTML = data.SignUpResult.ErrMsg;
105                  $("#ModalDialog").modal();
106                }
107            })
108            .fail(function() {
109              document.getElementById("dialog_title").innerHTML = "Sign Up FAILED!";
110              document.getElementById("dialog_content").innerHTML = "Unable to contact the server at this time. Try again later.";
111              $("#ModalDialog").modal();
112            })
113            ;
114        }
115}
116
117
118
119function show_forgot_password_dialog(){
120  var prev_email = document.getElementById("LogonName").value;
121      $("#login_dialog").modal("hide");
122
123      document.getElementById("forgot_password_dialog_email").value = prev_email;
124      $("#forgot_password_dialog").modal();
125}
126
127
128
129function forgot_password(){
130        var email_addr = document.getElementById("forgot_password_dialog_email").value;
131
132        $.post("/farmxl/forgotpassword/json",
133        {
134          Email: email_addr
135
136        },
137        function(data,status){
138          if (data.ForgotPasswordResult.Success)
139            {
140              $("#forgot_password_dialog").modal("hide");
141              document.getElementById("dialog_title").innerHTML = "Forgot Password Email Sent";
142              document.getElementById("dialog_content").innerHTML = "A password reset email has been sent to your email address. You can change your password using the link in that email.";
143              $("#ModalDialog").modal();
144            }
145          else
146            {
147              document.getElementById("dialog_title").innerHTML = "Password reset FAILED!";
148              document.getElementById("dialog_content").innerHTML = data.ForgotPasswordResult.ErrMsg;
149              $("#ModalDialog").modal();
150            }
151        })
152        .fail(function() {
153          document.getElementById("dialog_title").innerHTML = "Password reset FAILED!";
154          document.getElementById("dialog_content").innerHTML = "Unable to contact the server at this time. Try again later.";
155          $("#ModalDialog").modal();
156        })
157        ;
158}
159
160
161

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.