Subversion Repositories oidplus

Rev

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

Rev 329 Rev 360
Line 33... Line 33...
33
                return ($res->num_rows() > 0);
33
                return ($res->num_rows() > 0);
34
        }
34
        }
35
 
35
 
36
        public function raName() {
36
        public function raName() {
37
                $res = OIDplus::db()->query("select ra_name from ###ra where email = ?", array($this->email));
37
                $res = OIDplus::db()->query("select ra_name from ###ra where email = ?", array($this->email));
38
                if ($res->num_rows() == 0) return "(RA not in database)";
38
                if ($res->num_rows() == 0) return _L('(RA not in database)');
39
                $row = $res->fetch_array();
39
                $row = $res->fetch_array();
40
                return $row['ra_name'];
40
                return $row['ra_name'];
41
        }
41
        }
42
 
42
 
43
        public static function getAllRAs() {
43
        public static function getAllRAs() {
Line 70... Line 70...
70
                if ($ra_res->num_rows() == 0) return false; // User not found
70
                if ($ra_res->num_rows() == 0) return false; // User not found
71
                $ra_row = $ra_res->fetch_array();
71
                $ra_row = $ra_res->fetch_array();
72
 
72
 
73
                $plugins = OIDplus::getAuthPlugins();
73
                $plugins = OIDplus::getAuthPlugins();
74
                if (count($plugins) == 0) {
74
                if (count($plugins) == 0) {
75
                        throw new OIDplusException("No RA authentication plugins found");
75
                        throw new OIDplusException(_L('No RA authentication plugins found'));
76
                }
76
                }
77
                foreach ($plugins as $plugin) {
77
                foreach ($plugins as $plugin) {
78
                        if ($plugin->verify($ra_row['authkey'], $ra_row['salt'], $password)) return true;
78
                        if ($plugin->verify($ra_row['authkey'], $ra_row['salt'], $password)) return true;
79
                }
79
                }
80
 
80