commit 72be6fdeca96bec6d16f4e7338d07ebfc7fcffb7
parent 521e6e36e236832a499ad6046fb7306752ce0bda
Author: Jan Dankert <devnull@localhost>
Date: Mon, 5 Nov 2012 23:48:03 +0100
Weitere Auth-Module: SSL, SingleSignon
Diffstat:
5 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/auth/Auth.class.php b/auth/Auth.class.php
@@ -2,7 +2,21 @@
interface Auth
{
+ /**
+ * Prüft den eingegebenen Benutzernamen und das Kennwort
+ * auf Richtigkeit.
+ *
+ * @param Benutzername
+ * @param Kennwort
+ */
function login( $username, $password );
+
+
+
+ /**
+ * Ermittelt den Benutzernamen.
+ */
+ function username();
}
?>
\ No newline at end of file
diff --git a/auth/SSLAuth.class.php b/auth/SSLAuth.class.php
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Authentifizierung ueber ein SSL-Zertifikat.
+ *
+ * @author dankert
+ */
+class SSLAuth implements Auth
+{
+ public function username()
+ {
+ }
+
+
+ /**
+ * Ueberpruefen des Kennwortes ist über Ident nicht möglich.
+ */
+ public function login( $user, $password )
+ {
+ return false;
+ }
+}
+
+?>+
\ No newline at end of file
diff --git a/auth/SingleSignonAuth.class.php b/auth/SingleSignonAuth.class.php
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Single-Signon-Authentifizierung.
+ *
+ * @author dankert
+ */
+class SingleSignonAuth implements Auth
+{
+ public function username()
+ {
+ }
+
+
+ /**
+ * Ueberpruefen des Kennwortes ist über Ident nicht möglich.
+ */
+ public function login( $user, $password )
+ {
+ return false;
+ }
+}
+
+?>+
\ No newline at end of file
diff --git a/auth/include.inc.php b/auth/include.inc.php
@@ -8,5 +8,7 @@ require_once( OR_AUTHCLASSES_DIR."InternalAuth.class.".PHP_EXT );
require_once( OR_AUTHCLASSES_DIR."LdapAuth.class.".PHP_EXT );
require_once( OR_AUTHCLASSES_DIR."OpenIdAuth.class.".PHP_EXT );
require_once( OR_AUTHCLASSES_DIR."PersonasAuth.class.".PHP_EXT );
+require_once( OR_AUTHCLASSES_DIR."SingleSignonAuth.class.".PHP_EXT );
+require_once( OR_AUTHCLASSES_DIR."SSLAuth.class.".PHP_EXT );
?>
\ No newline at end of file
diff --git a/util/Http.class.php b/util/Http.class.php
@@ -526,6 +526,27 @@ HTML;
$httpAccept = getenv('HTTP_ACCEPT');
return $types = explode(',',$httpAccept);
}
+
+
+ public static function getClientIP()
+ {
+ $ip = '';
+
+ if ( isset($_SERVER["REMOTE_ADDR"]) )
+ {
+ $ip = $_SERVER["REMOTE_ADDR"];
+ }
+ elseif ( isset($_SERVER["HTTP_X_FORWARDED_FOR"]) )
+ {
+ $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
+ }
+ elseif ( isset($_SERVER["HTTP_CLIENT_IP"]) )
+ {
+ $ip = $_SERVER["HTTP_CLIENT_IP"];
+ }
+
+ return $ip;
+ }
}
?>
\ No newline at end of file