Rev 642 | Rev 833 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 642 | Rev 702 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | data: { |
33 | data: { |
34 | csrf_token: csrf_token, |
34 | csrf_token: csrf_token, |
35 | plugin: OIDplusPageRaInvite.oid, |
35 | plugin: OIDplusPageRaInvite.oid, |
36 | action: "invite_ra", |
36 | action: "invite_ra", |
37 | email: $("#email").val(), |
37 | email: $("#email").val(), |
38 | captcha: $(".g-recaptcha").length > 0 ? grecaptcha.getResponse() : null |
38 | captcha: oidplus_captcha_response() |
39 | }, |
39 | }, |
40 | error:function(jqXHR, textStatus, errorThrown) { |
40 | error:function(jqXHR, textStatus, errorThrown) { |
41 | if (errorThrown == "abort") return; |
41 | if (errorThrown == "abort") return; |
42 | alert(_L("Error: %1",errorThrown)); |
42 | alert(_L("Error: %1",errorThrown)); |
43 | if ($(".g-recaptcha").length > 0) grecaptcha.reset(); |
43 | oidplus_captcha_reset(); |
44 | }, |
44 | }, |
45 | success: function(data) { |
45 | success: function(data) { |
46 | if ("error" in data) { |
46 | if ("error" in data) { |
47 | alert(_L("Error: %1",data.error)); |
47 | alert(_L("Error: %1",data.error)); |
48 | if ($(".g-recaptcha").length > 0) grecaptcha.reset(); |
48 | oidplus_captcha_reset(); |
49 | } else if (data.status >= 0) { |
49 | } else if (data.status >= 0) { |
50 | alert(_L("The RA has been invited via email.")); |
50 | alert(_L("The RA has been invited via email.")); |
51 | window.location.href = '?goto='+$("#origin").val(); |
51 | window.location.href = '?goto='+$("#origin").val(); |
52 | //reloadContent(); |
52 | //reloadContent(); |
53 | } else { |
53 | } else { |
54 | alert(_L("Error: %1",data)); |
54 | alert(_L("Error: %1",data)); |
55 | if ($(".g-recaptcha").length > 0) grecaptcha.reset(); |
55 | oidplus_captcha_reset(); |
56 | } |
56 | } |
57 | } |
57 | } |
58 | }); |
58 | }); |
59 | return false; |
59 | return false; |
60 | }, |
60 | }, |