Subversion Repositories oidplus

Rev

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

Rev 1206 Rev 1267
Line 91... Line 91...
91
         */
91
         */
92
        private function doLoginRA(bool $remember_me, string $email, array $ldap_userinfo) {
92
        private function doLoginRA(bool $remember_me, string $email, array $ldap_userinfo) {
93
                $ra = new OIDplusRA($email);
93
                $ra = new OIDplusRA($email);
94
                if (!$ra->existing()) {
94
                if (!$ra->existing()) {
95
                        $this->registerRA($ra, $ldap_userinfo);
95
                        $this->registerRA($ra, $ldap_userinfo);
96
                        OIDplus::logger()->log("[INFO]RA(%1)!", "RA '%1' was created because of successful LDAP login", $email);
96
                        OIDplus::logger()->log("V2:[INFO]RA(%1)", "RA '%1' was created because of successful LDAP login", $email);
97
                }
97
                }
98
 
98
 
99
                OIDplus::authUtils()->raLoginEx($email, $remember_me, 'LDAP');
99
                OIDplus::authUtils()->raLoginEx($email, $remember_me, 'LDAP');
100
 
100
 
101
                OIDplus::db()->query("UPDATE ###ra set last_login = ".OIDplus::db()->sqlDate()." where email = ?", array($email));
101
                OIDplus::db()->query("UPDATE ###ra set last_login = ".OIDplus::db()->sqlDate()." where email = ?", array($email));
Line 160... Line 160...
160
                                // Note: Will throw an Exception if connect fails
160
                                // Note: Will throw an Exception if connect fails
161
                                $ldap->connect($cfg_ldap_server, $cfg_ldap_port);
161
                                $ldap->connect($cfg_ldap_server, $cfg_ldap_port);
162
 
162
 
163
                                if (!$ldap->login($upn, $password)) {
163
                                if (!$ldap->login($upn, $password)) {
164
                                        if (OIDplus::config()->getValue('log_failed_ra_logins', false)) {
164
                                        if (OIDplus::config()->getValue('log_failed_ra_logins', false)) {
165
                                                OIDplus::logger()->log("[WARN]A!", "Failed login to RA account '%1' using LDAP", $upn);
165
                                                OIDplus::logger()->log("V2:[WARN]A", "Failed login to RA account '%1' using LDAP", $upn);
166
                                        }
166
                                        }
167
                                        throw new OIDplusException(_L('Wrong password or user not registered'));
167
                                        throw new OIDplusException(_L('Wrong password or user not registered'));
168
                                }
168
                                }
169
 
169
 
170
                                $ldap_userinfo = $ldap->getUserInfo($upn, $cfg_ldap_base_dn);
170
                                $ldap_userinfo = $ldap->getUserInfo($upn, $cfg_ldap_base_dn);