Subversion Repositories oidplus

Rev

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

Rev 1015 Rev 1016
Line 346... Line 346...
346
        public static function getActiveDatabasePlugin() {
346
        public static function getActiveDatabasePlugin() {
347
                $db_plugin_name = OIDplus::baseConfig()->getValue('DATABASE_PLUGIN','');
347
                $db_plugin_name = OIDplus::baseConfig()->getValue('DATABASE_PLUGIN','');
348
                if ($db_plugin_name === '') {
348
                if ($db_plugin_name === '') {
349
                        throw new OIDplusConfigInitializationException(_L('No database plugin selected in config file'));
349
                        throw new OIDplusConfigInitializationException(_L('No database plugin selected in config file'));
350
                }
350
                }
351
                if (!isset(self::$dbPlugins[$db_plugin_name])) {
351
                foreach (self::$dbPlugins as $name => $plugin) {
352
                        throw new OIDplusConfigInitializationException(_L('Database plugin "%1" not found',$db_plugin_name));
352
                        if (strtolower($name) == strtolower($db_plugin_name)) {
-
 
353
                                return $plugin;
-
 
354
                        }
353
                }
355
                }
354
                return self::$dbPlugins[$db_plugin_name];
356
                throw new OIDplusConfigInitializationException(_L('Database plugin "%1" not found',$db_plugin_name));
355
        }
357
        }
356
 
358
 
357
        private static $dbMainSession = null;
359
        private static $dbMainSession = null;
358
        public static function db() {
360
        public static function db() {
359
                if (is_null(self::$dbMainSession)) {
361
                if (is_null(self::$dbMainSession)) {
Line 395... Line 397...
395
        public static function getActiveCaptchaPluginId() {
397
        public static function getActiveCaptchaPluginId() {
396
                $captcha_plugin_name = OIDplus::baseConfig()->getValue('CAPTCHA_PLUGIN', '');
398
                $captcha_plugin_name = OIDplus::baseConfig()->getValue('CAPTCHA_PLUGIN', '');
397
 
399
 
398
                if (OIDplus::baseConfig()->getValue('RECAPTCHA_ENABLED', false) && ($captcha_plugin_name === '')) {
400
                if (OIDplus::baseConfig()->getValue('RECAPTCHA_ENABLED', false) && ($captcha_plugin_name === '')) {
399
                        // Legacy config file support!
401
                        // Legacy config file support!
400
                        $captcha_plugin_name = 'ReCAPTCHA';
402
                        $captcha_plugin_name = 'reCAPTCHA';
401
                }
403
                }
402
 
404
 
403
                if ($captcha_plugin_name === '') $captcha_plugin_name = 'None'; // the "None" plugin is a must-have!
405
                if ($captcha_plugin_name === '') $captcha_plugin_name = 'None'; // the "None" plugin is a must-have!
404
 
406
 
405
                return $captcha_plugin_name;
407
                return $captcha_plugin_name;
406
        }
408
        }
407
 
409
 
408
        public static function getActiveCaptchaPlugin() {
410
        public static function getActiveCaptchaPlugin() {
409
                $captcha_plugin_name = OIDplus::getActiveCaptchaPluginId();
411
                $captcha_plugin_name = OIDplus::getActiveCaptchaPluginId();
410
 
-
 
411
                if (!isset(self::$captchaPlugins[$captcha_plugin_name])) {
412
                foreach (self::$captchaPlugins as $name => $plugin) {
412
                        throw new OIDplusConfigInitializationException(_L('CAPTCHA plugin "%1" not found',$captcha_plugin_name));
413
                        if (strtolower($name) == strtolower($captcha_plugin_name)) {
-
 
414
                                return $plugin;
-
 
415
                        }
413
                }
416
                }
414
                return self::$captchaPlugins[$captcha_plugin_name];
417
                throw new OIDplusConfigInitializationException(_L('CAPTCHA plugin "%1" not found',$captcha_plugin_name));
415
        }
418
        }
416
 
419
 
417
        # --- Page plugin
420
        # --- Page plugin
418
 
421
 
419
        private static function registerPagePlugin(OIDplusPagePlugin $plugin) {
422
        private static function registerPagePlugin(OIDplusPagePlugin $plugin) {