Subversion Repositories oidplus

Rev

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

Rev 457 Rev 459
Line 74... Line 74...
74
        }
74
        }
75
 
75
 
76
        public static function raCheckPassword($ra_email, $password) {
76
        public static function raCheckPassword($ra_email, $password) {
77
                $ra = new OIDplusRA($ra_email);
77
                $ra = new OIDplusRA($ra_email);
78
 
78
 
79
                list($salt, $authkey) = $ra->getAuthInfo();
79
                $authInfo = $ra->getAuthInfo();
80
 
80
 
81
                $plugins = OIDplus::getAuthPlugins();
81
                $plugins = OIDplus::getAuthPlugins();
82
                if (count($plugins) == 0) {
82
                if (count($plugins) == 0) {
83
                        throw new OIDplusException(_L('No RA authentication plugins found'));
83
                        throw new OIDplusException(_L('No RA authentication plugins found'));
84
                }
84
                }
85
                foreach ($plugins as $plugin) {
85
                foreach ($plugins as $plugin) {
86
                        if ($plugin->verify($authkey, $salt, $password)) return true;
86
                        if ($plugin->verify($authInfo, $password)) return true;
87
                }
87
                }
88
 
88
 
89
                return false;
89
                return false;
90
        }
90
        }
91
 
91
 
Line 218... Line 218...
218
                }
218
                }
219
        }
219
        }
220
 
220
 
221
        // Generate RA passwords
221
        // Generate RA passwords
222
 
222
 
223
        public static function raGeneratePassword($password) {
223
        public static function raGeneratePassword($password): OIDInfoRAAuthInfo {
224
                $def_method = OIDplus::config()->getValue('default_ra_auth_method');
224
                $def_method = OIDplus::config()->getValue('default_ra_auth_method');
225
 
225
 
226
                $plugins = OIDplus::getAuthPlugins();
226
                $plugins = OIDplus::getAuthPlugins();
227
                foreach ($plugins as $plugin) {
227
                foreach ($plugins as $plugin) {
228
                        if (basename($plugin->getPluginDirectory()) === $def_method) {
228
                        if (basename($plugin->getPluginDirectory()) === $def_method) {