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 303... Line 303...
303
        public function tree_search($request) {
303
        public function tree_search($request) {
304
                return false;
304
                return false;
305
        }
305
        }
306
 
306
 
307
        public function implementsFeature($id) {
307
        public function implementsFeature($id) {
308
                if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.5') return true; // alternativeLoginMethods
308
                if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.5') return true; // alternativeLoginMethods()
-
 
309
                if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.8') return true; // getNotifications()
309
                return false;
310
                return false;
310
        }
311
        }
311
 
312
 
312
        public function alternativeLoginMethods() {
313
        public function alternativeLoginMethods() {
-
 
314
                // Interface 1.3.6.1.4.1.37476.2.5.2.3.5
313
                $logins = array();
315
                $logins = array();
314
                if (OIDplus::baseConfig()->getValue('LDAP_ENABLED', false)) {
316
                if (OIDplus::baseConfig()->getValue('LDAP_ENABLED', false)) {
315
                        $logins[] = array(
317
                        $logins[] = array(
316
                                'oidplus:login_ldap',
318
                                'oidplus:login_ldap',
317
                                _L('Login using LDAP / ActiveDirectory'),
319
                                _L('Login using LDAP / ActiveDirectory'),
318
                                OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png'
320
                                OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon16.png'
319
                        );
321
                        );
320
                }
322
                }
321
                return $logins;
323
                return $logins;
322
        }
324
        }
-
 
325
 
-
 
326
        public function getNotifications($user=null): array {
-
 
327
                // Interface 1.3.6.1.4.1.37476.2.5.2.3.8
-
 
328
                $notifications = array();
-
 
329
                if ((!$user || ($user == 'admin')) && OIDplus::authUtils()->isAdminLoggedIn()) {
-
 
330
                        if (OIDplus::baseConfig()->getValue('LDAP_ENABLED', false)) {
-
 
331
                                if (!function_exists('ldap_connect')) {
-
 
332
                                        $title = _L('LDAP Login');
-
 
333
                                        $notifications[] = array('ERR', _L('OIDplus plugin "%1" is enabled, but required PHP extension "%2" is not installed.', $title, 'php_ldap'));
-
 
334
                                }
-
 
335
                        }
-
 
336
                }
-
 
337
                return $notifications;
-
 
338
        }
-
 
339
 
323
}
340
}