Subversion Repositories oidplus

Rev

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

Rev 635 Rev 702
Line 97... Line 97...
97
                                throw new OIDplusException(_L('LDAP authentication is disabled on this system.'));
97
                                throw new OIDplusException(_L('LDAP authentication is disabled on this system.'));
98
                        }
98
                        }
99
 
99
 
100
                        if (!function_exists('ldap_connect')) throw new OIDplusConfigInitializationException(_L('PHP extension "%1" not installed','LDAP'));
100
                        if (!function_exists('ldap_connect')) throw new OIDplusConfigInitializationException(_L('PHP extension "%1" not installed','LDAP'));
101
 
101
 
102
                        if (OIDplus::baseConfig()->getValue('RECAPTCHA_ENABLED', false)) {
-
 
103
                                $secret=OIDplus::baseConfig()->getValue('RECAPTCHA_PRIVATE', '');
-
 
104
                                _CheckParamExists($params, 'captcha');
102
                        OIDplus::getActiveCaptchaPlugin()->captchaVerify($params, 'captcha');
105
                                $response=$params["captcha"];
-
 
106
                                $verify=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secret}&response={$response}");
-
 
107
                                $captcha_success=json_decode($verify);
-
 
108
                                if ($captcha_success->success==false) {
-
 
109
                                        throw new OIDplusException(_L('CAPTCHA not successfully verified'));
-
 
110
                                }
-
 
111
                        }
-
 
112
 
103
 
113
                        _CheckParamExists($params, 'email');
104
                        _CheckParamExists($params, 'email');
114
                        _CheckParamExists($params, 'password');
105
                        _CheckParamExists($params, 'password');
115
 
106
 
116
                        $upn = $params['email'];
107
                        $upn = $params['email'];
Line 233... Line 224...
233
                        $out['text'] .= '<noscript>';
224
                        $out['text'] .= '<noscript>';
234
                        $out['text'] .= '<p>'._L('You need to enable JavaScript to use the login area.').'</p>';
225
                        $out['text'] .= '<p>'._L('You need to enable JavaScript to use the login area.').'</p>';
235
                        $out['text'] .= '</noscript>';
226
                        $out['text'] .= '</noscript>';
236
 
227
 
237
                        $out['text'] .= '<div id="loginLdapArea" style="visibility: hidden">';
228
                        $out['text'] .= '<div id="loginLdapArea" style="visibility: hidden">';
238
                        $out['text'] .= (OIDplus::baseConfig()->getValue('RECAPTCHA_ENABLED', false) ?
-
 
-
 
229
 
239
                                        '<p>'._L('Before logging in, please solve the following CAPTCHA').'</p>'.
230
                        $out['text'] .= OIDplus::getActiveCaptchaPlugin()->captchaGenerate(_L('Before logging in, please solve the following CAPTCHA'));
240
                                        '<div id="g-recaptcha" class="g-recaptcha" data-sitekey="'.OIDplus::baseConfig()->getValue('RECAPTCHA_PUBLIC', '').'"></div>'.
-
 
241
                                        '<script> grecaptcha.render($("#g-recaptcha")[0], { "sitekey" : "'.OIDplus::baseConfig()->getValue('RECAPTCHA_PUBLIC', '').'" }); </script>' : '');
-
 
242
                        $out['text'] .= '<br>';
231
                        $out['text'] .= '<br>';
243
 
232
 
244
                        $out['text'] .= '<p><a '.OIDplus::gui()->link('oidplus:login').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Regular login method').'</a></p>';
233
                        $out['text'] .= '<p><a '.OIDplus::gui()->link('oidplus:login').'><img src="img/arrow_back.png" width="16" alt="'._L('Go back').'"> '._L('Regular login method').'</a></p>';
245
 
234
 
246
                        $out['text'] .= '<h2>'._L('Login as RA').'</h2>';
235
                        $out['text'] .= '<h2>'._L('Login as RA').'</h2>';