Subversion Repositories oidplus

Rev

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

Rev 801 Rev 1000
Line 63... Line 63...
63
        public function tree_search($request) {
63
        public function tree_search($request) {
64
                return false;
64
                return false;
65
        }
65
        }
66
 
66
 
67
        public function implementsFeature($id) {
67
        public function implementsFeature($id) {
68
                if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.5') return true; // alternativeLoginMethods
68
                if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.5') return true; // alternativeLoginMethods()
-
 
69
                if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.8') return true; // getNotifications()
69
                return false;
70
                return false;
70
        }
71
        }
71
 
72
 
72
        public function alternativeLoginMethods() {
73
        public function alternativeLoginMethods() {
-
 
74
                // Interface 1.3.6.1.4.1.37476.2.5.2.3.5
73
                $logins = array();
75
                $logins = array();
74
                if (OIDplus::baseConfig()->getValue('GOOGLE_OAUTH2_ENABLED', false)) {
76
                if (OIDplus::baseConfig()->getValue('GOOGLE_OAUTH2_ENABLED', false)) {
75
                        $logins[] = array(
77
                        $logins[] = array(
76
                                'oidplus:login_google',
78
                                'oidplus:login_google',
77
                                _L('Login using Google'),
79
                                _L('Login using Google'),
78
                                OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png'
80
                                OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png'
79
                        );
81
                        );
80
                }
82
                }
81
                return $logins;
83
                return $logins;
82
        }
84
        }
-
 
85
 
-
 
86
        public function getNotifications($user=null): array {
-
 
87
                // Interface 1.3.6.1.4.1.37476.2.5.2.3.8
-
 
88
                $notifications = array();
-
 
89
                if ((!$user || ($user == 'admin')) && OIDplus::authUtils()->isAdminLoggedIn()) {
-
 
90
                        if (OIDplus::baseConfig()->getValue('GOOGLE_OAUTH2_ENABLED', false)) {
-
 
91
                                if (!function_exists('curl_init')) {
-
 
92
                                        $title = _L('Google OAuth Login');
-
 
93
                                        $notifications[] = array('ERR', _L('OIDplus plugin "%1" is enabled, but required PHP extension "%2" is not installed.', $title, 'php_curl'));
-
 
94
                                }
-
 
95
                        }
-
 
96
                }
-
 
97
                return $notifications;
-
 
98
        }
-
 
99
 
83
}
100
}