Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
104 | daniel-mar | 1 | /* |
2 | * OIDplus 2.0 |
||
3 | * Copyright 2019 Daniel Marschall, ViaThinkSoft |
||
4 | * |
||
5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
||
6 | * you may not use this file except in compliance with the License. |
||
7 | * You may obtain a copy of the License at |
||
8 | * |
||
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
||
10 | * |
||
11 | * Unless required by applicable law or agreed to in writing, software |
||
12 | * distributed under the License is distributed on an "AS IS" BASIS, |
||
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||
14 | * See the License for the specific language governing permissions and |
||
15 | * limitations under the License. |
||
16 | */ |
||
17 | |||
18 | function forgotPasswordFormOnSubmit() { |
||
19 | $.ajax({ |
||
20 | url: "action.php", |
||
21 | type: "POST", |
||
22 | data: { |
||
23 | action: "forgot_password", |
||
24 | email: $("#email").val(), |
||
25 | captcha: document.getElementsByClassName('g-recaptcha').length > 0 ? grecaptcha.getResponse() : null |
||
26 | }, |
||
27 | success: function(data) { |
||
28 | if (data != "OK") { |
||
29 | alert("Error: " + data); |
||
30 | grecaptcha.reset(); |
||
31 | } else { |
||
32 | alert("E-Mail sent."); |
||
33 | document.location = '?goto=oidplus:login'; |
||
34 | //reloadContent(); |
||
35 | } |
||
36 | } |
||
37 | }); |
||
38 | return false; |
||
39 | } |
||
40 | |||
41 | function resetPasswordFormOnSubmit() { |
||
42 | $.ajax({ |
||
43 | url: "action.php", |
||
44 | type: "POST", |
||
45 | data: { |
||
46 | action: "reset_password", |
||
47 | email: $("#email").val(), |
||
48 | auth: $("#auth").val(), |
||
49 | password1: $("#password1").val(), |
||
50 | password2: $("#password2").val(), |
||
51 | timestamp: $("#timestamp").val() |
||
52 | }, |
||
53 | success: function(data) { |
||
54 | if (data != "OK") { |
||
55 | alert("Error: " + data); |
||
56 | } else { |
||
57 | alert("Password sucessfully changed. You can now log in."); |
||
58 | document.location = '?goto=oidplus:login'; |
||
59 | //reloadContent(); |
||
60 | } |
||
61 | } |
||
62 | }); |
||
63 | return false; |
||
64 | } |
||
65 |