diff --git a/authenticator/.classpath b/authenticator/.classpath
new file mode 100644
index 0000000..ad56917
--- /dev/null
+++ b/authenticator/.classpath
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/authenticator/.project b/authenticator/.project
new file mode 100644
index 0000000..6cd9e3c
--- /dev/null
+++ b/authenticator/.project
@@ -0,0 +1,17 @@
+
+
+ authenticator
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/authenticator/.settings/org.eclipse.jdt.core.prefs b/authenticator/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..b2e1563
--- /dev/null
+++ b/authenticator/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Tue Sep 07 14:25:06 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/authenticator/.settings/org.eclipse.jst.jsp.core.prefs b/authenticator/.settings/org.eclipse.jst.jsp.core.prefs
new file mode 100644
index 0000000..cd0f548
--- /dev/null
+++ b/authenticator/.settings/org.eclipse.jst.jsp.core.prefs
@@ -0,0 +1,30 @@
+#Tue Sep 07 16:36:06 CEST 2010
+eclipse.preferences.version=1
+validateFragments=false
+validation.actions-missing-required-attribute=-1
+validation.actions-non-empty-inline-tag=-1
+validation.actions-unexpected-rtexprvalue=-1
+validation.actions-unknown-attribute=-1
+validation.directive-include-fragment-file-not-found=-1
+validation.directive-include-fragment-file-not-specified=-1
+validation.directive-taglib-duplicate-prefixes-different-uris=-1
+validation.directive-taglib-duplicate-prefixes-same-uris=-1
+validation.directive-taglib-missing-prefix=-1
+validation.directive-taglib-missing-uri-or-tagdir=-1
+validation.directive-taglib-unresolvable-uri-or-tagdir=-1
+validation.el-general-syntax=-1
+validation.el-lexical-failure=-1
+validation.java-=-1
+validation.java-local-variable-is-never-used=-1
+validation.java-null-local-variable-reference=-1
+validation.java-potential-null-local-variable-reference=-1
+validation.java-unused-import=-1
+validation.translation-tag-class-not-found=-1
+validation.translation-tei-class-not-found=-1
+validation.translation-tei-class-not-instantiated=-1
+validation.translation-tei-class-runtime-exception=-1
+validation.translation-tei-message=-1
+validation.translation-usebean-ambiguous-type-info=-1
+validation.translation-usebean-invalid-id=-1
+validation.translation-usebean-missing-type-info=-1
+validation.use-project-settings=true
diff --git a/authenticator/.settings/org.eclipse.wst.validation.prefs b/authenticator/.settings/org.eclipse.wst.validation.prefs
new file mode 100644
index 0000000..938a9d4
--- /dev/null
+++ b/authenticator/.settings/org.eclipse.wst.validation.prefs
@@ -0,0 +1,18 @@
+#Tue Sep 07 16:37:46 CEST 2010
+DELEGATES_PREFERENCE=delegateValidatorList
+USER_BUILD_PREFERENCE=enabledBuildValidatorList
+USER_MANUAL_PREFERENCE=enabledManualValidatorList
+USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationtrueversion1.2.200.v201005271900
+eclipse.preferences.version=1
+override=true
+suspend=true
+vals/org.eclipse.jst.jsp.core.JSPBatchValidator/global=FF01
+vals/org.eclipse.jst.jsp.core.JSPContentValidator/global=FF01
+vals/org.eclipse.jst.jsp.core.TLDValidator/global=FF01
+vals/org.eclipse.wst.dtd.core.dtdDTDValidator/global=FF01
+vals/org.eclipse.wst.html.ui.HTMLValidator/global=FF01
+vals/org.eclipse.wst.wsdl.validation.wsdl/global=FF02158org.eclipse.wst.wsdl.validation.internal.eclipse.Validator
+vals/org.eclipse.wst.xml.core.xml/global=FF03
+vals/org.eclipse.wst.xsd.core.xsd/global=FF02162org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator
+vals/org.eclipse.wst.xsl.core.xsl/global=FF02
+vf.version=3
diff --git a/authenticator/.settings/org.eclipse.wst.xsl.core.prefs b/authenticator/.settings/org.eclipse.wst.xsl.core.prefs
new file mode 100644
index 0000000..cf6206b
--- /dev/null
+++ b/authenticator/.settings/org.eclipse.wst.xsl.core.prefs
@@ -0,0 +1,12 @@
+#Tue Sep 07 16:36:08 CEST 2010
+CHECK_CALL_TEMPLATES=2
+CHECK_XPATHS=2
+CIRCULAR_REF=2
+DUPLICATE_PARAMETER=2
+EMPTY_PARAM=1
+MISSING_INCLUDE=2
+MISSING_PARAM=1
+NAME_ATTRIBUTE_EMPTY=2
+NAME_ATTRIBUTE_MISSING=2
+TEMPLATE_CONFLICT=2
+eclipse.preferences.version=1
diff --git a/authenticator/build.xml b/authenticator/build.xml
new file mode 100644
index 0000000..2d3696d
--- /dev/null
+++ b/authenticator/build.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/authenticator/lib/cas-server-core-3.4.2.1.jar b/authenticator/lib/cas-server-core-3.4.2.1.jar
new file mode 100644
index 0000000..0dda4b6
Binary files /dev/null and b/authenticator/lib/cas-server-core-3.4.2.1.jar differ
diff --git a/authenticator/lib/commons-codec-1.4.jar b/authenticator/lib/commons-codec-1.4.jar
new file mode 100644
index 0000000..458d432
Binary files /dev/null and b/authenticator/lib/commons-codec-1.4.jar differ
diff --git a/authenticator/src/de/hsadmin/cas/SmtpAuthenticator.java b/authenticator/src/de/hsadmin/cas/SmtpAuthenticator.java
new file mode 100644
index 0000000..f1f5596
--- /dev/null
+++ b/authenticator/src/de/hsadmin/cas/SmtpAuthenticator.java
@@ -0,0 +1,143 @@
+package de.hsadmin.cas;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+
+import org.apache.commons.codec.binary.Base64;
+import org.jasig.cas.authentication.handler.AuthenticationException;
+import org.jasig.cas.authentication.handler.AuthenticationHandler;
+import org.jasig.cas.authentication.principal.Credentials;
+import org.jasig.cas.authentication.principal.UsernamePasswordCredentials;
+
+public class SmtpAuthenticator implements AuthenticationHandler {
+
+ private static final int SMTPS_PORT = 465;
+
+ public boolean authenticate(Credentials creds)
+ throws AuthenticationException {
+ UsernamePasswordCredentials ucreds = (UsernamePasswordCredentials) creds;
+ try {
+ return isAuthenticated(ucreds.getUsername(), ucreds.getPassword());
+ } catch (SmtpAuthException e) {
+ return false;
+ }
+ }
+
+ public boolean supports(Credentials creds) {
+ return creds instanceof UsernamePasswordCredentials;
+ }
+
+ public boolean isAuthenticated(String user, String passwd)
+ throws SmtpAuthException {
+ boolean isAuth = false;
+ Socket socket = null;
+ try {
+ SSLContext sc = SSLContext.getInstance("SSLv3");
+ sc.init(null, null, null);
+ SSLSocketFactory ssf = sc.getSocketFactory();
+ if ( user == null || user.length() < 2 || user.length() == 4 ) {
+ return false;
+ }
+ if (user.indexOf('@') > 0) {
+ return false;
+ }
+ try {
+ if (user.length() == 2) {
+ user = "hsh01-" + user;
+ }
+ if (user.length() == 3) {
+ user = "hsh00-" + user;
+ }
+ socket = ssf.createSocket(user.substring(0, 5)
+ + ".hostsharing.net", SMTPS_PORT);
+ } catch (StringIndexOutOfBoundsException e) {
+ return false;
+ }
+ Writer out = new OutputStreamWriter(socket.getOutputStream(),
+ "ISO-8859-1");
+ BufferedReader sin = new BufferedReader(new InputStreamReader(
+ socket.getInputStream(), "ISO-8859-1"));
+ write(out, "EHLO login.hostsharing.net\r\n");
+ String answer = read(sin, "220 ");
+ answer = read(sin, "250-");
+ StringBuffer userPasswd = new StringBuffer();
+ userPasswd.append('\000');
+ userPasswd.append(user);
+ userPasswd.append('\000');
+ userPasswd.append(passwd);
+ write(out, "AUTH PLAIN "
+ + new String(Base64.encodeBase64(userPasswd.toString().getBytes())) + "\r\n");
+ answer = read(sin, "000");
+ isAuth = answer.startsWith("235");
+ write(out, "QUIT\r\n");
+ } catch (NoSuchAlgorithmException e) {
+ throw new SmtpAuthException(e.getMessage());
+ } catch (KeyManagementException e) {
+ throw new SmtpAuthException(e.getMessage());
+ } catch (UnknownHostException e) {
+ throw new SmtpAuthException(e.getMessage());
+ } catch (IOException e) {
+ throw new SmtpAuthException(e.getMessage());
+ } finally {
+ if (socket != null) {
+ try {
+ socket.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ return isAuth;
+ }
+
+ private void write(Writer wr, String line) {
+ try {
+ wr.write(line);
+ wr.flush();
+ } catch (IOException e) {
+ }
+ }
+
+ private String read(BufferedReader rd, String returnCode) {
+ try {
+ String line = rd.readLine();
+ while (line != null && line.startsWith(returnCode)) {
+ line = rd.readLine();
+ }
+ return line;
+ } catch (IOException e) {
+ }
+ return "";
+ }
+
+ public class SmtpAuthException extends Exception {
+
+ private static final long serialVersionUID = 2394310295147904537L;
+
+ public SmtpAuthException(String message) {
+ super(message);
+ }
+ }
+
+ public static void main(String[] args) {
+ SmtpAuthenticator auth = new SmtpAuthenticator();
+ try {
+ if (auth.isAuthenticated(args[0], args[1])) {
+ System.out.println("Login " + args[0] + " Ok");
+ } else {
+ System.out.println("Falsches Login");
+ }
+ } catch (SmtpAuthException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+}
diff --git a/authenticator/webapp/WEB-INF/cas.properties b/authenticator/webapp/WEB-INF/cas.properties
new file mode 100644
index 0000000..560b01b
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/cas.properties
@@ -0,0 +1,11 @@
+cas.securityContext.serviceProperties.service=http://login.hostsharing.net/cas/services/j_acegi_cas_security_check
+# Names of roles allowed to access the CAS service manager
+cas.securityContext.serviceProperties.adminRoles=ROLE_ADMIN
+cas.securityContext.casProcessingFilterEntryPoint.loginUrl=http://login.hostsharing.net/cas/login
+cas.securityContext.ticketValidator.casServerUrlPrefix=http://login.hostsharing.net/cas
+cas.themeResolver.defaultThemeName=hostsharing
+cas.viewResolver.basename=hostsharing_views
+host.name=login.hostsharing.net
+#database.hibernate.dialect=org.hibernate.dialect.OracleDialect
+#database.hibernate.dialect=org.hibernate.dialect.MySQLDialect
+database.hibernate.dialect=org.hibernate.dialect.HSQLDialect
diff --git a/authenticator/webapp/WEB-INF/classes/de/hsadmin/cas/SmtpAuthenticator$SmtpAuthException.class b/authenticator/webapp/WEB-INF/classes/de/hsadmin/cas/SmtpAuthenticator$SmtpAuthException.class
new file mode 100644
index 0000000..3bf3954
Binary files /dev/null and b/authenticator/webapp/WEB-INF/classes/de/hsadmin/cas/SmtpAuthenticator$SmtpAuthException.class differ
diff --git a/authenticator/webapp/WEB-INF/classes/de/hsadmin/cas/SmtpAuthenticator.class b/authenticator/webapp/WEB-INF/classes/de/hsadmin/cas/SmtpAuthenticator.class
new file mode 100644
index 0000000..c70dab4
Binary files /dev/null and b/authenticator/webapp/WEB-INF/classes/de/hsadmin/cas/SmtpAuthenticator.class differ
diff --git a/authenticator/webapp/WEB-INF/classes/hostsharing.properties b/authenticator/webapp/WEB-INF/classes/hostsharing.properties
new file mode 100644
index 0000000..d4cdf0c
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/classes/hostsharing.properties
@@ -0,0 +1,2 @@
+mobile.custom.css.file=css/default-mobile-custom.css
+standard.custom.css.file=themes/hostsharing/cas.css
diff --git a/authenticator/webapp/WEB-INF/classes/hostsharing_views.properties b/authenticator/webapp/WEB-INF/classes/hostsharing_views.properties
new file mode 100644
index 0000000..ee03dbf
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/classes/hostsharing_views.properties
@@ -0,0 +1,38 @@
+### Login view (/login)
+casLoginView.(class)=org.springframework.web.servlet.view.JstlView
+casLoginView.url=/WEB-INF/view/jsp/hostsharing/ui/casLoginView.jsp
+
+### Login confirmation view (logged in, warn=true)
+casLoginConfirmView.(class)=org.springframework.web.servlet.view.JstlView
+casLoginConfirmView.url=/WEB-INF/view/jsp/hostsharing/ui/casConfirmView.jsp
+
+### Logged-in view (logged in, no service provided)
+casLoginGenericSuccessView.(class)=org.springframework.web.servlet.view.JstlView
+casLoginGenericSuccessView.url=/WEB-INF/view/jsp/hostsharing/ui/casGenericSuccess.jsp
+
+### Logout view (/logout)
+casLogoutView.(class)=org.springframework.web.servlet.view.JstlView
+casLogoutView.url=/WEB-INF/view/jsp/hostsharing/ui/casLogoutView.jsp
+
+### CAS error view
+viewServiceErrorView.(class)=org.springframework.web.servlet.view.JstlView
+viewServiceErrorView.url=/WEB-INF/view/jsp/hostsharing/ui/serviceErrorView.jsp
+
+viewServiceSsoErrorView.(class)=org.springframework.web.servlet.view.JstlView
+viewServiceSsoErrorView.url=/WEB-INF/view/jsp/hostsharing/ui/serviceErrorSsoView.jsp
+
+### Services Management Views
+addServiceView.(class)=org.springframework.web.servlet.view.JstlView
+addServiceView.url=/WEB-INF/view/jsp/services/add.jsp
+
+editServiceView.(class)=org.springframework.web.servlet.view.JstlView
+editServiceView.url=/WEB-INF/view/jsp/services/add.jsp
+
+manageServiceView.(class)=org.springframework.web.servlet.view.JstlView
+manageServiceView.url=/WEB-INF/view/jsp/services/manage.jsp
+
+serviceLogoutView.(class)=org.springframework.web.servlet.view.JstlView
+serviceLogoutView.url=/WEB-INF/view/jsp/services/logout.jsp
+
+viewStatisticsView.(class)=org.springframework.web.servlet.view.JstlView
+viewStatisticsView.url=/WEB-INF/view/jsp/services/viewStatistics.jsp
diff --git a/authenticator/webapp/WEB-INF/deployerConfigContext.xml b/authenticator/webapp/WEB-INF/deployerConfigContext.xml
new file mode 100644
index 0000000..c7d7ff9
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/deployerConfigContext.xml
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casBlockedView.jsp b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casBlockedView.jsp
new file mode 100644
index 0000000..44a2214
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casBlockedView.jsp
@@ -0,0 +1,8 @@
+
+
+
+
diff --git a/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casConfirmView.jsp b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casConfirmView.jsp
new file mode 100644
index 0000000..513e8d9
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casConfirmView.jsp
@@ -0,0 +1,3 @@
+
+
+
diff --git a/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casGenericSuccess.jsp b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casGenericSuccess.jsp
new file mode 100644
index 0000000..a9919fd
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casGenericSuccess.jsp
@@ -0,0 +1,8 @@
+
+
+
+
diff --git a/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casLoginView.jsp b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casLoginView.jsp
new file mode 100644
index 0000000..8abed75
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casLoginView.jsp
@@ -0,0 +1,68 @@
+<%--
+
+ Licensed to Jasig under one or more contributor license
+ agreements. See the NOTICE file distributed with this work
+ for additional information regarding copyright ownership.
+ Jasig licenses this file to you under the Apache License,
+ Version 2.0 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a
+ copy of the License at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on
+ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+--%>
+
+<%@ page contentType="text/html; charset=UTF-8" %>
+
+
+
+
+
+
Bitte geben Sie Ihren Benutzernamen und Ihr Passwort ein.
+
+ Benutzername
+
+ ${sessionScope.openIdLocalId}
+
+
+
+
+
+
+
+
+
+ Passwort
+ <%--
+ NOTE: Certain browsers will offer the option of caching passwords for a user. There is a non-standard attribute,
+ "autocomplete" that when set to "off" will tell certain browsers not to prompt to cache credentials. For more
+ information, see the following web page:
+ http://www.geocities.com/technofundo/tech/web/ie_autocomplete.html
+ --%>
+
+
+
+
+ " type="checkbox" checked="checked" />
+
+
+
+
+
+
+ " tabindex="4" type="submit" />
+ " tabindex="5" type="reset" />
+
+
+
+
+
+
diff --git a/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casLogoutView.jsp b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casLogoutView.jsp
new file mode 100644
index 0000000..e0e7ada
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/casLogoutView.jsp
@@ -0,0 +1,30 @@
+<%--
+
+ Licensed to Jasig under one or more contributor license
+ agreements. See the NOTICE file distributed with this work
+ for additional information regarding copyright ownership.
+ Jasig licenses this file to you under the Apache License,
+ Version 2.0 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a
+ copy of the License at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on
+ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+--%>
+
+
+
+
+
diff --git a/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/includes/bottom.jsp b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/includes/bottom.jsp
new file mode 100644
index 0000000..b58d45e
--- /dev/null
+++ b/authenticator/webapp/WEB-INF/view/jsp/hostsharing/ui/includes/bottom.jsp
@@ -0,0 +1,8 @@
+
+
+
+
+