Subversion Repositories oidplus

Rev

Rev 702 | Rev 1036 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 702 Rev 1016
Line 14... Line 14...
14
 * See the License for the specific language governing permissions and
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
15
 * limitations under the License.
16
 */
16
 */
17
 
17
 
18
captcha_plugin_combobox_change_callbacks.push(function(strPlugin) {
18
captcha_plugin_combobox_change_callbacks.push(function(strPlugin) {
19
        $("#CAPTCHAPLUGIN_PARAMS_RECAPTCHA")[0].style.display = (strPlugin == 'ReCAPTCHA') ? "Block" : "None";
19
        $("#CAPTCHAPLUGIN_PARAMS_RECAPTCHA")[0].style.display = (strPlugin.toLowerCase() == 'reCAPTCHA'.toLowerCase()) ? "Block" : "None";
20
});
20
});
21
 
21
 
22
rebuild_callbacks.push(function() {
22
rebuild_callbacks.push(function() {
23
        var e = $("#captcha_plugin")[0];
23
        var e = $("#captcha_plugin")[0];
24
        var strPlugin = e.options[e.selectedIndex].value;
24
        var strPlugin = e.options[e.selectedIndex].value;
25
        if (strPlugin != 'ReCAPTCHA') return true;
25
        if (strPlugin.toLowerCase() != 'reCAPTCHA'.toLowerCase()) return true;
26
 
26
 
27
        $("#recaptcha_public")[0].innerHTML = '';
27
        $("#recaptcha_public")[0].innerHTML = '';
28
        $("#recaptcha_private")[0].innerHTML = '';
28
        $("#recaptcha_private")[0].innerHTML = '';
29
 
29
 
30
        error = false;
30
        error = false;
31
 
31
 
32
        // Check 1: Public key must not be empty
32
        // Check 1: Public key must not be empty
33
        if ($("#recaptcha_public")[0].value.length == 0)
33
        if ($("#recaptcha_public")[0].value.length == 0)
34
        {
34
        {
35
                $("#recaptcha_public_warn")[0].innerHTML = '<font color="red">'+_L('Please specify a public key!')+'</font>';
35
                $("#recaptcha_public_warn")[0].innerHTML = '<font color="red">'+_L('Please specify a public key!')+'</font>';
36
                $("#config")[0].innerHTML = '<b>&lt?php</b><br><br><i>// ERROR: Please specify a ReCAPTCHA public key!</i>'; // do not translate
36
                $("#config")[0].innerHTML = '<b>&lt?php</b><br><br><i>// ERROR: Please specify a reCAPTCHA public key!</i>'; // do not translate
37
                error = true;
37
                error = true;
38
        } else {
38
        } else {
39
                $("#recaptcha_public_warn")[0].innerHTML = '';
39
                $("#recaptcha_public_warn")[0].innerHTML = '';
40
        }
40
        }
41
 
41
 
42
        // Check 2: Private key must not be empty
42
        // Check 2: Private key must not be empty
43
        if ($("#recaptcha_private")[0].value.length == 0)
43
        if ($("#recaptcha_private")[0].value.length == 0)
44
        {
44
        {
45
                $("#recaptcha_private_warn")[0].innerHTML = '<font color="red">'+_L('Please specify a private key!')+'</font>';
45
                $("#recaptcha_private_warn")[0].innerHTML = '<font color="red">'+_L('Please specify a private key!')+'</font>';
46
                $("#config")[0].innerHTML = '<b>&lt?php</b><br><br><i>// ERROR: Please specify a ReCAPTCHA private key!</i>'; // do not translate
46
                $("#config")[0].innerHTML = '<b>&lt?php</b><br><br><i>// ERROR: Please specify a reCAPTCHA private key!</i>'; // do not translate
47
                error = true;
47
                error = true;
48
        } else {
48
        } else {
49
                $("#recaptcha_private_warn")[0].innerHTML = '';
49
                $("#recaptcha_private_warn")[0].innerHTML = '';
50
        }
50
        }
51
 
51
 
Line 53... Line 53...
53
});
53
});
54
 
54
 
55
captcha_rebuild_config_callbacks.push(function() {
55
captcha_rebuild_config_callbacks.push(function() {
56
        var e = $("#captcha_plugin")[0];
56
        var e = $("#captcha_plugin")[0];
57
        var strPlugin = e.options[e.selectedIndex].value;
57
        var strPlugin = e.options[e.selectedIndex].value;
58
        if (strPlugin != 'ReCAPTCHA') return '';
58
        if (strPlugin.toLowerCase() != 'reCAPTCHA'.toLowerCase()) return '';
-
 
59
        return 'OIDplus::baseConfig()->setValue(\'RECAPTCHA_VERSION\', '+$("#recaptcha_version").find('option:selected').attr("name")+');<br>' +
59
        return 'OIDplus::baseConfig()->setValue(\'RECAPTCHA_PUBLIC\',  \''+$("#recaptcha_public")[0].value+'\');<br>' +
60
               'OIDplus::baseConfig()->setValue(\'RECAPTCHA_PUBLIC\',  \''+$("#recaptcha_public")[0].value+'\');<br>' +
60
               'OIDplus::baseConfig()->setValue(\'RECAPTCHA_PRIVATE\', \''+$("#recaptcha_private")[0].value+'\');<br>';
61
               'OIDplus::baseConfig()->setValue(\'RECAPTCHA_PRIVATE\', \''+$("#recaptcha_private")[0].value+'\');<br>';
61
});
62
});