File modules/cms/auth/SSLAuth.class.php

Last commit: Sun Nov 29 21:46:57 2020 +0100	Jan Dankert	Auth modules should only use the Auth::STATUS_* constants as return value.
1 <?php 2 3 namespace cms\auth; 4 5 use cms\base\Configuration; 6 7 /** 8 * Authentifizierung ueber ein SSL-Zertifikat. 9 * 10 * @author dankert 11 */ 12 class SSLAuth implements Auth 13 { 14 public function username() 15 { 16 $envName = Configuration::subset(['security', 'ssl'] )->get('client_cert_dn_env','SSL_CLIENT_S_DN_CN'); 17 18 $dn = @$_SERVER[ $envName ]; 19 20 if ( $dn ) 21 return $dn; 22 23 return null; 24 } 25 26 27 /** 28 * Ueberpruefen des Kennwortes ist nicht möglich. 29 */ 30 public function login($user, $password, $token) 31 { 32 return ( $this->username() == $user ) ? Auth::STATUS_SUCCESS : Auth::STATUS_FAILED;; 33 } 34 } 35
Download modules/cms/auth/SSLAuth.class.php
History Sun, 29 Nov 2020 21:46:57 +0100 Jan Dankert Auth modules should only use the Auth::STATUS_* constants as return value. Mon, 16 Nov 2020 13:21:57 +0100 Jan Dankert Code cleanup: Externalize calling the auth modules. Sun, 1 Nov 2020 00:36:50 +0100 Jan Dankert Refactoring: Only using the configuration object. Sat, 26 Sep 2020 04:26:55 +0200 Jan Dankert Refactoring: read configuration values with a class. Sun, 23 Feb 2020 04:49:34 +0100 Jan Dankert Refactoring with Namespaces for the cms modules, part 2. Sun, 23 Feb 2020 04:01:30 +0100 Jan Dankert Refactoring with Namespaces for the cms modules, part 1: moving.