diff options
author | Simon Rettberg | 2018-12-07 10:14:10 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-12-07 10:14:10 +0100 |
commit | baba267635c92ca052ff434b433b7a0f118e6f72 (patch) | |
tree | 3e5a483e17d9cc4296b87836bf8431d531cb6e23 /pam.php | |
parent | [inc/Session] Don't suppress setcookie errors (diff) | |
download | bwlp-webadmin-baba267635c92ca052ff434b433b7a0f118e6f72.tar.gz bwlp-webadmin-baba267635c92ca052ff434b433b7a0f118e6f72.tar.xz bwlp-webadmin-baba267635c92ca052ff434b433b7a0f118e6f72.zip |
[pam.php] Helper for bwIDM PAM login
Returns list of IdPs as key value pairs:
org-suffix=ECP-Endpoint
Diffstat (limited to 'pam.php')
-rw-r--r-- | pam.php | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -0,0 +1,22 @@ +<?php + +// Autoload classes from ./inc which adhere to naming scheme <lowercasename>.inc.php +function slxAutoloader($class) +{ + $file = 'inc/' . preg_replace('/[^a-z0-9]/', '', mb_strtolower($class)) . '.inc.php'; + if (!file_exists($file)) + return; + require_once $file; +} +spl_autoload_register('slxAutoloader'); + +require_once 'config.php'; + +Header('Content-Type: text/plain; charset=utf-8'); + +$res = Database::simpleQuery("SELECT suffix, authmethod FROM organization INNER JOIN organization_suffix USING(organizationid)"); +while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + if (substr($row['authmethod'], 0, 5) === 'https') { + echo $row['suffix'], '=', $row['authmethod'], "\n"; + } +} |