diff --git a/wise-webapp/config b/wise-webapp/config new file mode 120000 index 00000000..40885268 --- /dev/null +++ b/wise-webapp/config @@ -0,0 +1 @@ +../config/ \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/model/AuthenticationSchema.java b/wise-webapp/src/main/java/com/wisemapping/model/AuthenticationSchema.java new file mode 100644 index 00000000..4a16afd2 --- /dev/null +++ b/wise-webapp/src/main/java/com/wisemapping/model/AuthenticationSchema.java @@ -0,0 +1,17 @@ +package com.wisemapping.model; + +public enum AuthenticationSchema +{ + DATABASE(0), + LDAP(1), + OPENID(2); + private final int schemaCode; + + AuthenticationSchema(int schemaCode) { + this.schemaCode = schemaCode; + } + + public int getSchemaCode() { + return schemaCode; + } +} diff --git a/wise-webapp/src/main/java/com/wisemapping/model/User.java b/wise-webapp/src/main/java/com/wisemapping/model/User.java index 29edfeb3..b0645060 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/User.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/User.java @@ -36,6 +36,7 @@ public class User private Calendar activationDate; private Set tags = new HashSet(); private boolean allowSendEmail = false; + private int schema; private String locale; @@ -114,4 +115,12 @@ public class User public void setLocale(@Nullable String locale) { this.locale = locale; } + + public int getAutheticationCode() { + return this.schema; + } + + public void setAuthenticationCode(int code) { + this.schema = code; + } } diff --git a/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java b/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java index 390795b4..fcabfda1 100644 --- a/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java +++ b/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java @@ -19,6 +19,7 @@ package com.wisemapping.security; +import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.model.User; import com.wisemapping.service.UserService; import org.jetbrains.annotations.NotNull; @@ -26,17 +27,22 @@ import org.jetbrains.annotations.Nullable; import org.springframework.dao.DataAccessException; import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.openid.OpenIDAttribute; +import org.springframework.security.openid.OpenIDAuthenticationToken; + +import java.util.Calendar; +import java.util.List; public class UserDetailsService - implements org.springframework.security.core.userdetails.UserDetailsService { + implements org.springframework.security.core.userdetails.UserDetailsService, org.springframework.security.core.userdetails.AuthenticationUserDetailsService { private UserService userService; private String adminUser; @Override public UserDetails loadUserByUsername(@NotNull String email) throws UsernameNotFoundException, DataAccessException { final User user = userService.getUserBy(email); - + if (user != null) { return new UserDetails(user, isAdmin(email)); } else { @@ -44,6 +50,56 @@ public class UserDetailsService } } + @Override + @NotNull + public UserDetails loadUserDetails(@NotNull OpenIDAuthenticationToken token) throws UsernameNotFoundException { + + final User tUser = buildUserFromToken(token); + final User dbUser = userService.getUserBy(tUser.getEmail()); + + final User result; + if (dbUser != null) { + result = dbUser; + } else { + try { + result = userService.createUser(tUser, false, false); + } catch (WiseMappingException e) { + throw new IllegalStateException(e); + } + + } + return new UserDetails(result, isAdmin(result.getEmail())); + } + + @NotNull + private User buildUserFromToken(@NotNull OpenIDAuthenticationToken token) { + final User result = new User(); + + final List attributes = token.getAttributes(); + for (OpenIDAttribute attribute : attributes) { + if (attribute.getName().equals("email")) { + final String email = attribute.getValues().get(0); + result.setEmail(email); + } + + if (attribute.getName().equals("firstname")) { + final String firstName = attribute.getValues().get(0); + result.setFirstname(firstName); + + } + + if (attribute.getName().equals("lastname")) { + final String lastName = attribute.getValues().get(0); + result.setLastname(lastName); + } + result.setPassword(""); + } + + final Calendar now = Calendar.getInstance(); + result.setActivationDate(now); + return result; + } + private boolean isAdmin(@Nullable String email) { return email != null && adminUser != null && email.trim().endsWith(adminUser); } @@ -63,4 +119,5 @@ public class UserDetailsService public void setAdminUser(String adminUser) { this.adminUser = adminUser; } + } diff --git a/wise-webapp/src/main/java/com/wisemapping/webmvc/LoginController.java b/wise-webapp/src/main/java/com/wisemapping/webmvc/LoginController.java index ddc9c240..eb3e9021 100644 --- a/wise-webapp/src/main/java/com/wisemapping/webmvc/LoginController.java +++ b/wise-webapp/src/main/java/com/wisemapping/webmvc/LoginController.java @@ -44,4 +44,5 @@ public class LoginController { } return result; } + } diff --git a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml index 636b6243..6c2f2bcd 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml @@ -75,6 +75,12 @@ + + + + + + diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index 19a977c7..636296af 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -49,6 +49,27 @@ always-use-default-target="false" authentication-failure-url="/c/login?login_error=2" login-processing-url="/c/j_spring_security_check"/> + + + + + + + + + + + + + + + + + + + diff --git a/wise-webapp/src/main/webapp/css/openid.css b/wise-webapp/src/main/webapp/css/openid.css new file mode 100644 index 00000000..8929ff07 --- /dev/null +++ b/wise-webapp/src/main/webapp/css/openid.css @@ -0,0 +1,45 @@ +#openid_form { + width: 580px; +} + #openid_form legend { + font-weight: bold; + } +#openid_choice { + display: none; +} +#openid_input_area { + clear: both; + padding: 10px; +} +#openid_btns, #openid_btns br { + clear: both; +} + #openid_highlight { + padding: 3px; + background-color: #FFFCC9; + float: left; + } + .openid_large_btn { + width: 100px; + height: 60px; + border: 1px solid #DDD; + margin: 3px; + float: left; + } + .openid_small_btn { + width: 24px; + height: 24px; + border: 1px solid #DDD; + margin: 3px; + float: left; + } + a.openid_large_btn:focus { + outline: none; + } + a.openid_large_btn:focus + { + -moz-outline-style: none; + } + .openid_selected { + border: 4px solid #DDD; + } \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/images.large/aol.gif b/wise-webapp/src/main/webapp/images.large/aol.gif new file mode 100644 index 00000000..decc4f12 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/aol.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/facebook.gif b/wise-webapp/src/main/webapp/images.large/facebook.gif new file mode 100644 index 00000000..b997b358 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/facebook.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/google.gif b/wise-webapp/src/main/webapp/images.large/google.gif new file mode 100644 index 00000000..1b6cd07b Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/google.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/mailru.gif b/wise-webapp/src/main/webapp/images.large/mailru.gif new file mode 100644 index 00000000..62fe79ed Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/mailru.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/myopenid.gif b/wise-webapp/src/main/webapp/images.large/myopenid.gif new file mode 100644 index 00000000..4885a6dd Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/myopenid.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/openid.gif b/wise-webapp/src/main/webapp/images.large/openid.gif new file mode 100644 index 00000000..c718b0e6 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/openid.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/rambler.gif b/wise-webapp/src/main/webapp/images.large/rambler.gif new file mode 100644 index 00000000..f311e6fe Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/rambler.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/verisign.gif b/wise-webapp/src/main/webapp/images.large/verisign.gif new file mode 100644 index 00000000..faa6aaaf Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/verisign.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/vkontakte.gif b/wise-webapp/src/main/webapp/images.large/vkontakte.gif new file mode 100644 index 00000000..afb5c338 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/vkontakte.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/yahoo.gif b/wise-webapp/src/main/webapp/images.large/yahoo.gif new file mode 100644 index 00000000..42adbfa5 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/yahoo.gif differ diff --git a/wise-webapp/src/main/webapp/images.large/yandex.gif b/wise-webapp/src/main/webapp/images.large/yandex.gif new file mode 100644 index 00000000..ffb36723 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.large/yandex.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/aol.ico b/wise-webapp/src/main/webapp/images.small/aol.ico new file mode 100644 index 00000000..f599e0b9 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/aol.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/aol.ico.gif b/wise-webapp/src/main/webapp/images.small/aol.ico.gif new file mode 100644 index 00000000..7ba24cc9 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/aol.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/aol.ico.png b/wise-webapp/src/main/webapp/images.small/aol.ico.png new file mode 100644 index 00000000..d8984a2c Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/aol.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/blogger.ico b/wise-webapp/src/main/webapp/images.small/blogger.ico new file mode 100644 index 00000000..1b9730b0 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/blogger.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/blogger.ico.gif b/wise-webapp/src/main/webapp/images.small/blogger.ico.gif new file mode 100644 index 00000000..7e9be595 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/blogger.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/blogger.ico.png b/wise-webapp/src/main/webapp/images.small/blogger.ico.png new file mode 100644 index 00000000..4a53a1a5 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/blogger.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/claimid.ico b/wise-webapp/src/main/webapp/images.small/claimid.ico new file mode 100644 index 00000000..2b80f491 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/claimid.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/claimid.ico.gif b/wise-webapp/src/main/webapp/images.small/claimid.ico.gif new file mode 100644 index 00000000..8a57d79a Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/claimid.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/claimid.ico.png b/wise-webapp/src/main/webapp/images.small/claimid.ico.png new file mode 100644 index 00000000..a0086c32 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/claimid.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/clickpass.ico b/wise-webapp/src/main/webapp/images.small/clickpass.ico new file mode 100644 index 00000000..a97a2e59 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/clickpass.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/clickpass.ico.gif b/wise-webapp/src/main/webapp/images.small/clickpass.ico.gif new file mode 100644 index 00000000..05e27f47 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/clickpass.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/clickpass.ico.png b/wise-webapp/src/main/webapp/images.small/clickpass.ico.png new file mode 100644 index 00000000..6fd06059 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/clickpass.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/facebook.ico b/wise-webapp/src/main/webapp/images.small/facebook.ico new file mode 100644 index 00000000..de63d7f3 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/facebook.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/facebook.ico.gif b/wise-webapp/src/main/webapp/images.small/facebook.ico.gif new file mode 100644 index 00000000..848ff1eb Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/facebook.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/facebook.ico.png b/wise-webapp/src/main/webapp/images.small/facebook.ico.png new file mode 100644 index 00000000..800bce7e Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/facebook.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/flickr.ico b/wise-webapp/src/main/webapp/images.small/flickr.ico new file mode 100644 index 00000000..11f6e07f Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/flickr.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/flickr.ico.gif b/wise-webapp/src/main/webapp/images.small/flickr.ico.gif new file mode 100644 index 00000000..5967b2c1 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/flickr.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/flickr.ico.png b/wise-webapp/src/main/webapp/images.small/flickr.ico.png new file mode 100644 index 00000000..cdb4a249 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/flickr.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/google.ico b/wise-webapp/src/main/webapp/images.small/google.ico new file mode 100644 index 00000000..ee7c943a Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/google.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/google.ico.gif b/wise-webapp/src/main/webapp/images.small/google.ico.gif new file mode 100644 index 00000000..3b6b9be6 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/google.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/google.ico.png b/wise-webapp/src/main/webapp/images.small/google.ico.png new file mode 100644 index 00000000..31dd03db Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/google.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/google_profile.ico b/wise-webapp/src/main/webapp/images.small/google_profile.ico new file mode 100644 index 00000000..ee7c943a Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/google_profile.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/google_profile.ico.gif b/wise-webapp/src/main/webapp/images.small/google_profile.ico.gif new file mode 100644 index 00000000..3b6b9be6 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/google_profile.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/google_profile.ico.png b/wise-webapp/src/main/webapp/images.small/google_profile.ico.png new file mode 100644 index 00000000..820c1ea2 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/google_profile.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/launchpad.ico b/wise-webapp/src/main/webapp/images.small/launchpad.ico new file mode 100644 index 00000000..7db6e67f Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/launchpad.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/launchpad.ico.gif b/wise-webapp/src/main/webapp/images.small/launchpad.ico.gif new file mode 100644 index 00000000..51192da6 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/launchpad.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/launchpad.ico.png b/wise-webapp/src/main/webapp/images.small/launchpad.ico.png new file mode 100644 index 00000000..1f43d33e Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/launchpad.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/linkedin.ico b/wise-webapp/src/main/webapp/images.small/linkedin.ico new file mode 100644 index 00000000..7f267aa3 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/linkedin.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/linkedin.ico.gif b/wise-webapp/src/main/webapp/images.small/linkedin.ico.gif new file mode 100644 index 00000000..b25477a3 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/linkedin.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/linkedin.ico.png b/wise-webapp/src/main/webapp/images.small/linkedin.ico.png new file mode 100644 index 00000000..a8800bad Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/linkedin.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/livejournal.ico b/wise-webapp/src/main/webapp/images.small/livejournal.ico new file mode 100644 index 00000000..f3d21ec5 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/livejournal.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/livejournal.ico.gif b/wise-webapp/src/main/webapp/images.small/livejournal.ico.gif new file mode 100644 index 00000000..8897eb25 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/livejournal.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/livejournal.ico.png b/wise-webapp/src/main/webapp/images.small/livejournal.ico.png new file mode 100644 index 00000000..ff703a28 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/livejournal.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/mailru.ico b/wise-webapp/src/main/webapp/images.small/mailru.ico new file mode 100644 index 00000000..0694727e Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/mailru.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/mailru.ico.gif b/wise-webapp/src/main/webapp/images.small/mailru.ico.gif new file mode 100644 index 00000000..2f449a5f Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/mailru.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/mailru.ico.png b/wise-webapp/src/main/webapp/images.small/mailru.ico.png new file mode 100644 index 00000000..49b21cda Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/mailru.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/myopenid.ico b/wise-webapp/src/main/webapp/images.small/myopenid.ico new file mode 100644 index 00000000..ceb06e6a Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/myopenid.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/myopenid.ico.gif b/wise-webapp/src/main/webapp/images.small/myopenid.ico.gif new file mode 100644 index 00000000..5f0af22e Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/myopenid.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/myopenid.ico.png b/wise-webapp/src/main/webapp/images.small/myopenid.ico.png new file mode 100644 index 00000000..9b96dc25 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/myopenid.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/openid.ico b/wise-webapp/src/main/webapp/images.small/openid.ico new file mode 100644 index 00000000..982b4433 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/openid.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/openid.ico.gif b/wise-webapp/src/main/webapp/images.small/openid.ico.gif new file mode 100644 index 00000000..d925305c Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/openid.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/openid.ico.png b/wise-webapp/src/main/webapp/images.small/openid.ico.png new file mode 100644 index 00000000..6040e923 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/openid.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/rambler.ico b/wise-webapp/src/main/webapp/images.small/rambler.ico new file mode 100644 index 00000000..6b9f7870 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/rambler.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/rambler.ico.gif b/wise-webapp/src/main/webapp/images.small/rambler.ico.gif new file mode 100644 index 00000000..2d5064bb Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/rambler.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/rambler.ico.png b/wise-webapp/src/main/webapp/images.small/rambler.ico.png new file mode 100644 index 00000000..39efc927 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/rambler.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/technorati.ico b/wise-webapp/src/main/webapp/images.small/technorati.ico new file mode 100644 index 00000000..fa1083c1 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/technorati.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/technorati.ico.gif b/wise-webapp/src/main/webapp/images.small/technorati.ico.gif new file mode 100644 index 00000000..290c894f Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/technorati.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/technorati.ico.png b/wise-webapp/src/main/webapp/images.small/technorati.ico.png new file mode 100644 index 00000000..9019c1fd Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/technorati.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/twitter.ico b/wise-webapp/src/main/webapp/images.small/twitter.ico new file mode 100644 index 00000000..92336ff0 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/twitter.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/twitter.ico.gif b/wise-webapp/src/main/webapp/images.small/twitter.ico.gif new file mode 100644 index 00000000..a6a018e3 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/twitter.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/twitter.ico.png b/wise-webapp/src/main/webapp/images.small/twitter.ico.png new file mode 100644 index 00000000..c3227e7c Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/twitter.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/verisign.ico b/wise-webapp/src/main/webapp/images.small/verisign.ico new file mode 100644 index 00000000..3953af93 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/verisign.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/verisign.ico.gif b/wise-webapp/src/main/webapp/images.small/verisign.ico.gif new file mode 100644 index 00000000..6a770720 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/verisign.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/verisign.ico.png b/wise-webapp/src/main/webapp/images.small/verisign.ico.png new file mode 100644 index 00000000..04869b2a Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/verisign.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/vidoop.ico b/wise-webapp/src/main/webapp/images.small/vidoop.ico new file mode 100644 index 00000000..bbd9a0d5 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/vidoop.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/vidoop.ico.gif b/wise-webapp/src/main/webapp/images.small/vidoop.ico.gif new file mode 100644 index 00000000..0a16de3d Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/vidoop.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/vidoop.ico.png b/wise-webapp/src/main/webapp/images.small/vidoop.ico.png new file mode 100644 index 00000000..30e486ee Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/vidoop.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/vkontakte.ico b/wise-webapp/src/main/webapp/images.small/vkontakte.ico new file mode 100644 index 00000000..c1e4428b Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/vkontakte.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/vkontakte.ico.gif b/wise-webapp/src/main/webapp/images.small/vkontakte.ico.gif new file mode 100644 index 00000000..c360eb1c Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/vkontakte.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/vkontakte.ico.png b/wise-webapp/src/main/webapp/images.small/vkontakte.ico.png new file mode 100644 index 00000000..06f19b2b Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/vkontakte.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/winliveid.ico b/wise-webapp/src/main/webapp/images.small/winliveid.ico new file mode 100644 index 00000000..4744dae8 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/winliveid.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/winliveid.ico.gif b/wise-webapp/src/main/webapp/images.small/winliveid.ico.gif new file mode 100644 index 00000000..a6eba9af Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/winliveid.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/winliveid.ico.png b/wise-webapp/src/main/webapp/images.small/winliveid.ico.png new file mode 100644 index 00000000..38fab9f0 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/winliveid.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/wordpress.ico b/wise-webapp/src/main/webapp/images.small/wordpress.ico new file mode 100644 index 00000000..31b7d2c2 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/wordpress.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/wordpress.ico.gif b/wise-webapp/src/main/webapp/images.small/wordpress.ico.gif new file mode 100644 index 00000000..b4f3beb4 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/wordpress.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/wordpress.ico.png b/wise-webapp/src/main/webapp/images.small/wordpress.ico.png new file mode 100644 index 00000000..7242e383 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/wordpress.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/yahoo.ico b/wise-webapp/src/main/webapp/images.small/yahoo.ico new file mode 100644 index 00000000..d7761e5a Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/yahoo.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/yahoo.ico.gif b/wise-webapp/src/main/webapp/images.small/yahoo.ico.gif new file mode 100644 index 00000000..32d27c19 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/yahoo.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/yahoo.ico.png b/wise-webapp/src/main/webapp/images.small/yahoo.ico.png new file mode 100644 index 00000000..1475eca0 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/yahoo.ico.png differ diff --git a/wise-webapp/src/main/webapp/images.small/yandex.ico b/wise-webapp/src/main/webapp/images.small/yandex.ico new file mode 100644 index 00000000..e7821975 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/yandex.ico differ diff --git a/wise-webapp/src/main/webapp/images.small/yandex.ico.gif b/wise-webapp/src/main/webapp/images.small/yandex.ico.gif new file mode 100644 index 00000000..6b1e30e3 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/yandex.ico.gif differ diff --git a/wise-webapp/src/main/webapp/images.small/yandex.ico.png b/wise-webapp/src/main/webapp/images.small/yandex.ico.png new file mode 100644 index 00000000..e09f1d99 Binary files /dev/null and b/wise-webapp/src/main/webapp/images.small/yandex.ico.png differ diff --git a/wise-webapp/src/main/webapp/images/openid-inputicon.gif b/wise-webapp/src/main/webapp/images/openid-inputicon.gif new file mode 100644 index 00000000..cde836c8 Binary files /dev/null and b/wise-webapp/src/main/webapp/images/openid-inputicon.gif differ diff --git a/wise-webapp/src/main/webapp/images/openid-providers-en.png b/wise-webapp/src/main/webapp/images/openid-providers-en.png new file mode 100644 index 00000000..f5fd7288 Binary files /dev/null and b/wise-webapp/src/main/webapp/images/openid-providers-en.png differ diff --git a/wise-webapp/src/main/webapp/images/openid-providers-ru.png b/wise-webapp/src/main/webapp/images/openid-providers-ru.png new file mode 100644 index 00000000..a1750caf Binary files /dev/null and b/wise-webapp/src/main/webapp/images/openid-providers-ru.png differ diff --git a/wise-webapp/src/main/webapp/js/openid-en.js b/wise-webapp/src/main/webapp/js/openid-en.js new file mode 100644 index 00000000..2b68c665 --- /dev/null +++ b/wise-webapp/src/main/webapp/js/openid-en.js @@ -0,0 +1,96 @@ +/* + Simple OpenID Plugin + http://code.google.com/p/openid-selector/ + + This code is licensed under the New BSD License. +*/ + +var providers_large = { + google : { + name : 'Google', + url : 'https://www.google.com/accounts/o8/id' + }, + yahoo : { + name : 'Yahoo', + url : 'http://me.yahoo.com/' + }, + aol : { + name : 'AOL', + label : 'Enter your AOL screenname.', + url : 'http://openid.aol.com/{username}' + }, + myopenid : { + name : 'MyOpenID', + label : 'Enter your MyOpenID username.', + url : 'http://{username}.myopenid.com/' + }, + openid : { + name : 'OpenID', + label : 'Enter your OpenID.', + url : null + } +}; + +var providers_small = { + livejournal : { + name : 'LiveJournal', + label : 'Enter your Livejournal username.', + url : 'http://{username}.livejournal.com/' + }, + /* flickr: { + name: 'Flickr', + label: 'Enter your Flickr username.', + url: 'http://flickr.com/{username}/' + }, */ + /* technorati: { + name: 'Technorati', + label: 'Enter your Technorati username.', + url: 'http://technorati.com/people/technorati/{username}/' + }, */ + wordpress : { + name : 'Wordpress', + label : 'Enter your Wordpress.com username.', + url : 'http://{username}.wordpress.com/' + }, + blogger : { + name : 'Blogger', + label : 'Your Blogger account', + url : 'http://{username}.blogspot.com/' + }, + verisign : { + name : 'Verisign', + label : 'Your Verisign username', + url : 'http://{username}.pip.verisignlabs.com/' + }, + /* vidoop: { + name: 'Vidoop', + label: 'Your Vidoop username', + url: 'http://{username}.myvidoop.com/' + }, */ + /* launchpad: { + name: 'Launchpad', + label: 'Your Launchpad username', + url: 'https://launchpad.net/~{username}' + }, */ + claimid : { + name : 'ClaimID', + label : 'Your ClaimID username', + url : 'http://claimid.com/{username}' + }, + clickpass : { + name : 'ClickPass', + label : 'Enter your ClickPass username', + url : 'http://clickpass.com/public/{username}' + }, + google_profile : { + name : 'Google Profile', + label : 'Enter your Google Profile username', + url : 'http://www.google.com/profiles/{username}' + } +}; + +openid.locale = 'en'; +openid.sprite = 'en'; // reused in german& japan localization +openid.demo_text = 'In client demo mode. Normally would have submitted OpenID:'; +openid.signin_text = 'Sign-In'; +openid.image_title = 'log in with {provider}'; diff --git a/wise-webapp/src/main/webapp/js/openid-jquery.js b/wise-webapp/src/main/webapp/js/openid-jquery.js new file mode 100644 index 00000000..0c98366b --- /dev/null +++ b/wise-webapp/src/main/webapp/js/openid-jquery.js @@ -0,0 +1,202 @@ +/* + Simple OpenID Plugin + http://code.google.com/p/openid-selector/ + + This code is licensed under the New BSD License. +*/ + +var providers; +var openid; +(function ($) { +openid = { + version : '1.3', // version constant + demo : false, + demo_text : null, + cookie_expires : 6 * 30, // 6 months. + cookie_name : 'openid_provider', + cookie_path : '/', + + img_path : 'images/', + locale : null, // is set in openid-.js + sprite : null, // usually equals to locale, is set in + // openid-.js + signin_text : null, // text on submit button on the form + all_small : false, // output large providers w/ small icons + no_sprite : false, // don't use sprite image + image_title : '{provider}', // for image title + + input_id : null, + provider_url : null, + provider_id : null, + + /** + * Class constructor + * + * @return {Void} + */ + init : function(input_id) { + providers = $.extend({}, providers_large, providers_small); + var openid_btns = $('#openid_btns'); + this.input_id = input_id; + $('#openid_choice').show(); + $('#openid_input_area').empty(); + var i = 0; + // add box for each provider + for (id in providers_large) { + box = this.getBoxHTML(id, providers_large[id], (this.all_small ? 'small' : 'large'), i++); + openid_btns.append(box); + } + if (providers_small) { + openid_btns.append('
'); + for (id in providers_small) { + box = this.getBoxHTML(id, providers_small[id], 'small', i++); + openid_btns.append(box); + } + } + $('#openid_form').submit(this.submit); + var box_id = this.readCookie(); + if (box_id) { + this.signin(box_id, true); + } + }, + + /** + * @return {String} + */ + getBoxHTML : function(box_id, provider, box_size, index) { + if (this.no_sprite) { + var image_ext = box_size == 'small' ? '.ico.gif' : '.gif'; + return ''; + } + var x = box_size == 'small' ? -index * 24 : -index * 100; + var y = box_size == 'small' ? -60 : 0; + return ''; + }, + + /** + * Provider image click + * + * @return {Void} + */ + signin : function(box_id, onload) { + var provider = providers[box_id]; + if (!provider) { + return; + } + this.highlight(box_id); + this.setCookie(box_id); + this.provider_id = box_id; + this.provider_url = provider['url']; + // prompt user for input? + if (provider['label']) { + this.useInputBox(provider); + } else { + $('#openid_input_area').empty(); + if (!onload) { + $('#openid_form').submit(); + } + } + }, + + /** + * Sign-in button click + * + * @return {Boolean} + */ + submit : function() { + var url = openid.provider_url; + if (url) { + url = url.replace('{username}', $('#openid_username').val()); + openid.setOpenIdUrl(url); + } + if (openid.demo) { + alert(openid.demo_text + "\r\n" + document.getElementById(openid.input_id).value); + return false; + } + if (url.indexOf("javascript:") == 0) { + url = url.substr("javascript:".length); + eval(url); + return false; + } + return true; + }, + + /** + * @return {Void} + */ + setOpenIdUrl : function(url) { + var hidden = document.getElementById(this.input_id); + if (hidden != null) { + hidden.value = url; + } else { + $('#openid_form').append(''); + } + }, + + /** + * @return {Void} + */ + highlight : function(box_id) { + // remove previous highlight. + var highlight = $('#openid_highlight'); + if (highlight) { + highlight.replaceWith($('#openid_highlight a')[0]); + } + // add new highlight. + $('.' + box_id).wrap('
'); + }, + + setCookie : function(value) { + var date = new Date(); + date.setTime(date.getTime() + (this.cookie_expires * 24 * 60 * 60 * 1000)); + var expires = "; expires=" + date.toGMTString(); + document.cookie = this.cookie_name + "=" + value + expires + "; path=" + this.cookie_path; + }, + + readCookie : function() { + var nameEQ = this.cookie_name + "="; + var ca = document.cookie.split(';'); + for ( var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) == ' ') + c = c.substring(1, c.length); + if (c.indexOf(nameEQ) == 0) + return c.substring(nameEQ.length, c.length); + } + return null; + }, + + /** + * @return {Void} + */ + useInputBox : function(provider) { + var input_area = $('#openid_input_area'); + var html = ''; + var id = 'openid_username'; + var value = ''; + var label = provider['label']; + var style = ''; + if (label) { + html = '

' + label + '

'; + } + if (provider['name'] == 'OpenID') { + id = this.input_id; + value = 'http://'; + style = 'background: #FFF url(' + this.img_path + 'openid-inputicon.gif) no-repeat scroll 0 50%; padding-left:18px;'; + } + html += '' + + ''; + input_area.empty(); + input_area.append(html); + $('#' + id).focus(); + }, + + setDemoMode : function(demoMode) { + this.demo = demoMode; + } +}; +})(jQuery); diff --git a/wise-webapp/src/main/webapp/jsp/login.jsp b/wise-webapp/src/main/webapp/jsp/login.jsp index daecaa31..539ba572 100644 --- a/wise-webapp/src/main/webapp/jsp/login.jsp +++ b/wise-webapp/src/main/webapp/jsp/login.jsp @@ -3,6 +3,23 @@ <%--@elvariable id="isHsql" type="boolean"--%> + + + + + + + + + + + + + + + + + + + + Your login attempt was not successful, try again.

+ Reason: . +
+
+ + +
+ + +
+ Sign-in or Create New Account + +
+

Please click your account provider:

+
+ +
+ +
+ + +
+ +
+
+ + + + diff --git a/wise-webapp/src/main/webapp/jsp/openidlogin.jsp b/wise-webapp/src/main/webapp/jsp/openidlogin.jsp new file mode 100644 index 00000000..38c24891 --- /dev/null +++ b/wise-webapp/src/main/webapp/jsp/openidlogin.jsp @@ -0,0 +1,64 @@ +<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %> + + + + + OpenID Login + + + + + + + + + + + + + + + + + Your login attempt was not successful, try again.

+ Reason: . +
+
+ + +
+ + +
+ Sign-in or Create New Account + +
+

Please click your account provider:

+
+ +
+ +
+ + +
+ +
+
+ + + +