From 85d17b016c6f276e4dcdc35801555d5c98a23482 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Wed, 1 Feb 2017 16:40:57 +0000 Subject: [PATCH] Initial import. git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/liferay62-plugins/login-hook@141998 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 32 +++ .project | 42 +++ .settings/.jsdtscope | 13 + .settings/org.eclipse.core.resources.prefs | 4 + .settings/org.eclipse.jdt.core.prefs | 8 + .settings/org.eclipse.m2e.core.prefs | 4 + .settings/org.eclipse.wst.common.component | 10 + ....eclipse.wst.common.project.facet.core.xml | 8 + ...rg.eclipse.wst.jsdt.ui.superType.container | 1 + .../org.eclipse.wst.jsdt.ui.superType.name | 1 + .settings/org.eclipse.wst.validation.prefs | 10 + distro/LICENSE | 1 + distro/README | 64 +++++ distro/changelog.xml | 5 + distro/descriptor.xml | 31 ++ distro/profile.xml | 25 ++ pom.xml | 134 +++++++++ .../resources/content/Language.properties | 2 + src/main/resources/portal.properties | 13 + .../portlet/login/RequestingApplication.jsp | 66 +++++ .../html/portlet/login/css/login-hook.css | 90 ++++++ .../custom_jsps/html/portlet/login/init.jsp | 76 +++++ .../portlet/login/js/bootstrap-collapse.js | 167 +++++++++++ .../portlet/login/js/bootstrap-transition.js | 60 ++++ .../html/portlet/login/js/login-hook.js | 19 ++ .../custom_jsps/html/portlet/login/login.jsp | 265 ++++++++++++++++++ .../html/portlet/login/navigation.jsp | 57 ++++ .../custom_jsps/html/portlet/login/social.jsp | 18 ++ src/main/webapp/WEB-INF/liferay-hook.xml | 8 + .../WEB-INF/liferay-plugin-package.properties | 9 + src/main/webapp/WEB-INF/web.xml | 4 + 31 files changed, 1247 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/.jsdtscope create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 .settings/org.eclipse.wst.common.component create mode 100644 .settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.name create mode 100644 .settings/org.eclipse.wst.validation.prefs create mode 100644 distro/LICENSE create mode 100644 distro/README create mode 100644 distro/changelog.xml create mode 100644 distro/descriptor.xml create mode 100644 distro/profile.xml create mode 100644 pom.xml create mode 100644 src/main/resources/content/Language.properties create mode 100644 src/main/resources/portal.properties create mode 100644 src/main/webapp/META-INF/custom_jsps/html/portlet/login/RequestingApplication.jsp create mode 100644 src/main/webapp/META-INF/custom_jsps/html/portlet/login/css/login-hook.css create mode 100644 src/main/webapp/META-INF/custom_jsps/html/portlet/login/init.jsp create mode 100644 src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/bootstrap-collapse.js create mode 100644 src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/bootstrap-transition.js create mode 100644 src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/login-hook.js create mode 100644 src/main/webapp/META-INF/custom_jsps/html/portlet/login/login.jsp create mode 100644 src/main/webapp/META-INF/custom_jsps/html/portlet/login/navigation.jsp create mode 100644 src/main/webapp/META-INF/custom_jsps/html/portlet/login/social.jsp create mode 100644 src/main/webapp/WEB-INF/liferay-hook.xml create mode 100644 src/main/webapp/WEB-INF/liferay-plugin-package.properties create mode 100644 src/main/webapp/WEB-INF/web.xml diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..b9ced66 --- /dev/null +++ b/.classpath @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..6023abf --- /dev/null +++ b/.project @@ -0,0 +1,42 @@ + + + login-hook-1.0.0 + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope new file mode 100644 index 0000000..585c967 --- /dev/null +++ b/.settings/.jsdtscope @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..cf6931b --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..c788ee3 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..7b27f1a --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles=gcube +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..c96c8df --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..c7bc593 --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 0000000..8408139 --- /dev/null +++ b/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,10 @@ +DELEGATES_PREFERENCE=delegateValidatorList +USER_BUILD_PREFERENCE=enabledBuildValidatorList +USER_MANUAL_PREFERENCE=enabledManualValidatorList +USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.700.v201508251749 +disabled=06target +eclipse.preferences.version=1 +override=true +suspend=false +vals/org.eclipse.jst.jsp.core.JSPBatchValidator/groups=0107include01113projectNature131org.eclipse.jdt.core.javanature0107include110111contentType134org.eclipse.jst.jsp.core.jspsourceT111contentType142org.eclipse.jst.jsp.core.jspfragmentsourceT111contentType134org.eclipse.jst.jsp.core.tagsourceT07fileext03jspF07fileext04jspfF07fileext03jsfF07fileext03tagF07fileext04tagfF07fileext03jsvF07fileext04jtplF0107exclude0104file136src/main/webapp/META-INF/custom_jspsT02 +vf.version=3 diff --git a/distro/LICENSE b/distro/LICENSE new file mode 100644 index 0000000..2d9616a --- /dev/null +++ b/distro/LICENSE @@ -0,0 +1 @@ +${gcube.license} \ No newline at end of file diff --git a/distro/README b/distro/README new file mode 100644 index 0000000..b181405 --- /dev/null +++ b/distro/README @@ -0,0 +1,64 @@ +The gCube System - ${name} +-------------------------------------------------- + +${description} + + +${gcube.description} + +${gcube.funding} + + +Version +-------------------------------------------------- + +${version} (${buildDate}) + +Please see the file named "changelog.xml" in this directory for the release notes. + + +Authors +-------------------------------------------------- + +* Michalis Nikolopoulos (mnikolopoulos@cite.gr), CITE S.A. + +Maintainers +----------- + +* Michalis Nikolopoulos (mnikolopoulos@cite.gr), CITE S.A. + + +Download information +-------------------------------------------------- + +Source code is available from SVN: + ${scm.url} + +Binaries can be downloaded from the gCube website: + ${gcube.website} + + +Installation +-------------------------------------------------- + +Use the respective war + + +Documentation +-------------------------------------------------- + +Documentation is available on-line in the gCube Wiki: + ${gcube.wikiRoot} + + +Support +-------------------------------------------------- + +Bugs and support requests can be reported in the gCube issue tracking tool: + ${gcube.issueTracking} + + +Licensing +-------------------------------------------------- + +This software is licensed under the terms you may find in the file named "LICENSE" in this directory. \ No newline at end of file diff --git a/distro/changelog.xml b/distro/changelog.xml new file mode 100644 index 0000000..d706368 --- /dev/null +++ b/distro/changelog.xml @@ -0,0 +1,5 @@ + + + Login hook for liferay login portlet. Offers a more attractive social login UI + + diff --git a/distro/descriptor.xml b/distro/descriptor.xml new file mode 100644 index 0000000..b3f5628 --- /dev/null +++ b/distro/descriptor.xml @@ -0,0 +1,31 @@ + + servicearchive + + tar.gz + + / + + + ${distroDirectory} + / + true + + README + LICENSE + changelog.xml + profile.xml + + 755 + true + + + + + target/${build.finalName}.${project.packaging} + /${artifactId} + + + \ No newline at end of file diff --git a/distro/profile.xml b/distro/profile.xml new file mode 100644 index 0000000..6615973 --- /dev/null +++ b/distro/profile.xml @@ -0,0 +1,25 @@ + + + + Service + + ${description} + Portal + ${artifactId} + ${version} + + + ${artifactId} + ${version} + + ${groupId} + ${artifactId} + ${version} + + + target/${build.finalName}.war + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d8363c8 --- /dev/null +++ b/pom.xml @@ -0,0 +1,134 @@ + + + + 4.0.0 + + + maven-parent + org.gcube.tools + 1.0.0 + + + org.gcube.portal + login-hook + war + login-hook Hook + 1.1.0-SNAPSHOT + + + scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/branches/portal/login-hook/1.0 + scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/branches/portal/login-hook/1.0 + https://svn.d4science.research-infrastructures.eu/gcube/branches/portal/login-hook/1.0 + + + + 6.2.2 + ${system.CATALINA_HOME}/../deploy + ${project.basedir}/distro + + + + + + org.gcube.distribution + maven-portal-bom + LATEST + pom + import + + + + + + + + + com.liferay.maven.plugins + liferay-maven-plugin + 2.5 + + + generate-sources + + + + ${liferay.auto.deploy.dir} + ${liferay.app.server.deploy.dir} + ${liferay.app.server.lib.global.dir} + ${liferay.app.server.portal.dir} + ${liferay.version} + hook + + + + maven-compiler-plugin + 2.5 + + UTF-8 + 1.7 + 1.7 + + + + maven-resources-plugin + 2.5 + + UTF-8 + + + + org.apache.maven.plugins + maven-assembly-plugin + + + ${distroDirectory}/descriptor.xml + + + + + servicearchive + install + + single + + + + + + + + + com.liferay.portal + portal-service + provided + + + com.liferay.portal + util-java + provided + + + javax.portlet + portlet-api + provided + + + javax.servlet + servlet-api + 2.4 + provided + + + javax.servlet.jsp + jsp-api + 2.0 + provided + + + org.gcube.common.portal + portal-manager + provided + + + \ No newline at end of file diff --git a/src/main/resources/content/Language.properties b/src/main/resources/content/Language.properties new file mode 100644 index 0000000..befca80 --- /dev/null +++ b/src/main/resources/content/Language.properties @@ -0,0 +1,2 @@ +data-e-Infrastructure-gateway-home=Data e-Infrastructure gateway Home +shared-workspace=Shared Workspace \ No newline at end of file diff --git a/src/main/resources/portal.properties b/src/main/resources/portal.properties new file mode 100644 index 0000000..c9d2e50 --- /dev/null +++ b/src/main/resources/portal.properties @@ -0,0 +1,13 @@ +########################################################################################################################### +## ## +## Read this!!!! ## +## ## +## In this option add the the name of the already deployed social login ## +## (the name of the .jsp file e.g google for the google.jsp which is in navigation folder of the google-hook-login), ## +## comma separate the social logins e.g for google-hook-login and linkedin-hook-login the option goes like this ## +## ## +## login.form.navigation.socials=google, linkedIn, windowsLive ## +## ## +########################################################################################################################### + +login.form.navigation.socials=google, linkedIn, windowsLive \ No newline at end of file diff --git a/src/main/webapp/META-INF/custom_jsps/html/portlet/login/RequestingApplication.jsp b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/RequestingApplication.jsp new file mode 100644 index 0000000..98ba49e --- /dev/null +++ b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/RequestingApplication.jsp @@ -0,0 +1,66 @@ +<%-- +/** + * Copyright (c) gCube Framework. All rights reserved. + * + * @Author Massimiliano Assante, CNR-ISTI Italy + */ +--%> + +<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> + +<% + if (redirect.startsWith(siteUrl + GCubePortalConstants.AUTHORIZATION_FRIENDLY_URL)) { + hideCreateAccountAndForgotPassword = true; + Map queryMap = AuthUtil.getQueryMap(redirect); + if (!queryMap.isEmpty()) { + String clientId = queryMap.get(GET_CLIENT_ID_PARAMETER); + String scope = queryMap.get(GET_SCOPE_PARAMETER); + if (clientId != null && clientId.compareTo("") != 0) { + RequestingApp app = AuthUtil.getAuthorisedApplicationInfoFromIs(clientId); + if (app != null) { +%> + +
+ <% + if (app.getLogoURL() != null && !app.getLogoURL().isEmpty()) { + %> +

+ +

+ <% + } + %> + +

+ <%=app.getApplicationId()%> + would like to access some of your D4Science info:
Name, photo, + email and current roles + <% + if (scope != null && scope.compareTo("") != 0) { + %> + on context: <%=scope%> + <% + } + %> + +

+

By signing in with your D4Science credentials you are approving + this application's request to access your member data and interact + with D4Science on your behalf. +

+

+ +

+
+<% + } else { + System.out.println( + "The client_id does not exist or something occurred in retrieving it from IS: " + + clientId); + } + } + } + } +%> \ No newline at end of file diff --git a/src/main/webapp/META-INF/custom_jsps/html/portlet/login/css/login-hook.css b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/css/login-hook.css new file mode 100644 index 0000000..88be589 --- /dev/null +++ b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/css/login-hook.css @@ -0,0 +1,90 @@ +.portlet-login .accordion .accordion-heading > a, #signinmodal .accordion .accordion-heading > a{ + display: block; + text-align: center; + text-decoration: none; + border-top: 2px rgb(2, 113, 190) solid; + margin-top: 5px; + color: rgb(2, 113, 190); +} + +.portlet-login .accordion div.accordion-inner, #signinmodal .accordion div.accordion-inner { + border-top: none; +} + +.portlet-login div.navigation, #signinmodal div.navigation { + background: white; + border-top: none; +} + +.portlet-login input.login-identifier, .portlet-login input.login-password, +#signinmodal input.login-identifier, #signinmodal input.login-password { + border-radius: 5px; + height: 25px; +} + +.portlet-login button.login-sign-in-button, #signinmodal button.login-sign-in-button { + display : block; + background : rgb(2, 113, 190); + border-radius : 5px; + padding : 6px; + border : none; + box-shadow : 1px 1px 1px 1px rgba(0,0,0,0.5); + margin : auto; +} + +.portlet-login .portlet-borderless-container .login-sign-in { + color: rgb(2, 113, 190); + margin: 0px 0px 15px 10px; +} + +.portlet-login .portlet-content-container .login-sign-in { + display:none; +} + +.portlet-login .login-remember-me, #signinmodal .login-remember-me { + margin-top : 10px; + margin-left: 11px; +} + +.portlet-login .login-remember-me > .control-group, #signinmodal .login-remember-me > .control-group { + margin-bottom: 10px; +} + +.portlet-login .navigation li[role=presentation] > a, +#signinmodal .navigation li[role=presentation] > a, +.portlet-login .login-remember-me label, +#signinmodal .login-remember-me label { + color: #9E9696; +} + +.portlet-login form, #signinmodal form{ + margin : 0; +} + +.portlet-login .taglib-icon-list li, #signinmodal .taglib-icon-list li{ + float : none; +} + +.portlet-login .navigation, #signinmodal .navigation{ + padding : 0px 10px 10px 10px; +} + +.portlet-login .custom-form-login-wrapper, #signinmodal .custom-form-login-wrapper{ + text-align : center; +} + +.portlet-login div.navigation > ul, +#signinmodal div.navigation > ul{ + text-align : center; +} + +.portlet-login .help-inline, +#signinmodal .help-inline { + display : block; + padding-left : 0xp; +} + +.portlet-login .social, +#signinmodal .social { + margin-bottom: 5px; +} \ No newline at end of file diff --git a/src/main/webapp/META-INF/custom_jsps/html/portlet/login/init.jsp b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/init.jsp new file mode 100644 index 0000000..6d5af80 --- /dev/null +++ b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/init.jsp @@ -0,0 +1,76 @@ +<%-- +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ +--%> + +<%@ include file="/html/portlet/init.jsp" %> + +<%@ page import="com.liferay.portal.AddressCityException" %><%@ +page import="com.liferay.portal.AddressStreetException" %><%@ +page import="com.liferay.portal.AddressZipException" %><%@ +page import="com.liferay.portal.CompanyMaxUsersException" %><%@ +page import="com.liferay.portal.ContactFirstNameException" %><%@ +page import="com.liferay.portal.ContactFullNameException" %><%@ +page import="com.liferay.portal.ContactLastNameException" %><%@ +page import="com.liferay.portal.CookieNotSupportedException" %><%@ +page import="com.liferay.portal.DuplicateOpenIdException" %><%@ +page import="com.liferay.portal.DuplicateUserEmailAddressException" %><%@ +page import="com.liferay.portal.DuplicateUserIdException" %><%@ +page import="com.liferay.portal.DuplicateUserScreenNameException" %><%@ +page import="com.liferay.portal.EmailAddressException" %><%@ +page import="com.liferay.portal.GroupFriendlyURLException" %><%@ +page import="com.liferay.portal.NoSuchCountryException" %><%@ +page import="com.liferay.portal.NoSuchListTypeException" %><%@ +page import="com.liferay.portal.NoSuchRegionException" %><%@ +page import="com.liferay.portal.PasswordExpiredException" %><%@ +page import="com.liferay.portal.PhoneNumberException" %><%@ +page import="com.liferay.portal.RequiredFieldException" %><%@ +page import="com.liferay.portal.RequiredReminderQueryException" %><%@ +page import="com.liferay.portal.ReservedUserEmailAddressException" %><%@ +page import="com.liferay.portal.ReservedUserIdException" %><%@ +page import="com.liferay.portal.ReservedUserScreenNameException" %><%@ +page import="com.liferay.portal.SendPasswordException" %><%@ +page import="com.liferay.portal.TermsOfUseException" %><%@ +page import="com.liferay.portal.UserActiveException" %><%@ +page import="com.liferay.portal.UserEmailAddressException" %><%@ +page import="com.liferay.portal.UserIdException" %><%@ +page import="com.liferay.portal.UserLockoutException" %><%@ +page import="com.liferay.portal.UserPasswordException" %><%@ +page import="com.liferay.portal.UserReminderQueryException" %><%@ +page import="com.liferay.portal.UserScreenNameException" %><%@ +page import="com.liferay.portal.WebsiteURLException" %><%@ +page import="com.liferay.portal.kernel.facebook.FacebookConnectUtil" %><%@ +page import="com.liferay.portal.security.auth.AuthException" %><%@ +page import="com.liferay.portal.util.OpenIdUtil" %><%@ +page import="com.liferay.portlet.login.util.LoginUtil" %> + +<%@ page import="org.openid4java.association.AssociationException" %><%@ +page import="org.openid4java.consumer.ConsumerException" %><%@ +page import="org.openid4java.discovery.DiscoveryException" %><%@ +page import="org.openid4java.message.MessageException" %> + +<%@ page import="org.gcube.common.portal.GCubePortalConstants" %> +<%@ page import="org.gcube.common.portal.PortalContext" %> +<%@ page import="org.gcube.portal.auth.AuthUtil" %> +<%@ page import="org.gcube.portal.auth.RequestingApp" %> +<%@ page import="java.io.UnsupportedEncodingException" %> + + + + +<% +String authType = portletPreferences.getValue("authType", StringPool.BLANK); +%> + +<%@ include file="/html/portlet/login/init-ext.jsp" %> \ No newline at end of file diff --git a/src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/bootstrap-collapse.js b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/bootstrap-collapse.js new file mode 100644 index 0000000..76f7aa3 --- /dev/null +++ b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/bootstrap-collapse.js @@ -0,0 +1,167 @@ +/* ============================================================= + * bootstrap-collapse.js v2.3.2 + * http://getbootstrap.com/2.3.2/javascript.html#collapse + * ============================================================= + * Copyright 2013 Twitter, Inc. + * + * Licensed 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. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) + + if (this.options.parent) { + this.$parent = $(this.options.parent) + } + + this.options.toggle && this.toggle() + } + + Collapse.prototype = { + + constructor: Collapse + + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + , show: function () { + var dimension + , scroll + , actives + , hasData + + if (this.transitioning || this.$element.hasClass('in')) return + + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') + + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + $.support.transition && this.$element[dimension](this.$element[0][scroll]) + } + + , hide: function () { + var dimension + if (this.transitioning || !this.$element.hasClass('in')) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) + } + + , reset: function (size) { + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth + + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') + + return this + } + + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } + + this.$element.trigger(startEvent) + + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSE NO CONFLICT + * ==================== */ + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + $(target).collapse(option) + }) + +}(window.jQuery); \ No newline at end of file diff --git a/src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/bootstrap-transition.js b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/bootstrap-transition.js new file mode 100644 index 0000000..9d81a6c --- /dev/null +++ b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/bootstrap-transition.js @@ -0,0 +1,60 @@ +/* =================================================== + * bootstrap-transition.js v2.3.2 + * http://getbootstrap.com/2.3.2/javascript.html#transitions + * =================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed 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. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) + * ======================================================= */ + + $(function () { + + $.support.transition = (function () { + + var transitionEnd = (function () { + + var el = document.createElement('bootstrap') + , transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + , name + + for (name in transEndEventNames){ + if (el.style[name] !== undefined) { + return transEndEventNames[name] + } + } + + }()) + + return transitionEnd && { + end: transitionEnd + } + + })() + + }) + +}(window.jQuery); \ No newline at end of file diff --git a/src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/login-hook.js b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/login-hook.js new file mode 100644 index 0000000..1766310 --- /dev/null +++ b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/js/login-hook.js @@ -0,0 +1,19 @@ +$(document).ready( + function() { + $('.portlet-login #collapseMe').on('show', function(e){ + $('.portlet-login .icon-double-angle-down').removeClass('icon-double-angle-down').addClass('icon-double-angle-up'); + }); + + $('.portlet-login #collapseMe').on('hidden', function(e){ + $('.portlet-login .icon-double-angle-up').removeClass('icon-double-angle-up').addClass('icon-double-angle-down'); + }); + + $('#signinmodal #collapseMe').on('show', function(e){ + $('.portlet-login .icon-double-angle-down').removeClass('icon-double-angle-down').addClass('icon-double-angle-up'); + }); + + $('#signinmodal #collapseMe').on('hidden', function(e){ + $('.portlet-login .icon-double-angle-up').removeClass('icon-double-angle-up').addClass('icon-double-angle-down'); + }); + + }); \ No newline at end of file diff --git a/src/main/webapp/META-INF/custom_jsps/html/portlet/login/login.jsp b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/login.jsp new file mode 100644 index 0000000..90b17e1 --- /dev/null +++ b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/login.jsp @@ -0,0 +1,265 @@ +<%-- +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ +--%> + +<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> +<%@ include file="/html/portlet/login/init.jsp"%> + + + + + + + + +<% + +String[] socials = PropsUtil.getArray("login.form.navigation.socials"); + +PortalContext context = PortalContext.getConfiguration(); +String siteUrl = context.getSiteLandingPagePath(request); +String workspaceUrl = siteUrl + GCubePortalConstants.USER_WORKSPACE_FRIENDLY_URL; +final String GET_CLIENT_ID_PARAMETER = "client_id"; +final String GET_SCOPE_PARAMETER = "scope"; +boolean hideCreateAccountAndForgotPassword = false; +%> + + + + <% + String signedInAs = HtmlUtil.escape(user.getFullName()); + + if (themeDisplay.isShowMyAccountIcon() && (themeDisplay.getURLMyAccount() != null)) { + String myAccountURL = String.valueOf(themeDisplay.getURLMyAccount()); + + if (PropsValues.DOCKBAR_ADMINISTRATIVE_LINKS_SHOW_IN_POP_UP) { + signedInAs = "" + signedInAs + ""; + } + else { + myAccountURL = HttpUtil.setParameter(myAccountURL, "controlPanelCategory", PortletCategoryKeys.MY); + + signedInAs = "" + signedInAs + ""; + } + } + %> + + <% + String siteMarkUp = "" + themeDisplay.getSiteGroupName() +""; + String workSpaceMarkUp = "" + LanguageUtil.get(pageContext, "shared-workspace") +""; + %> + + <%= LanguageUtil.format(pageContext, "you-are-signed-in-as-x", signedInAs, false) %> +
+ <%= LanguageUtil.format(pageContext, "go-to-x", siteMarkUp, false) %> +
+ <%= LanguageUtil.format(pageContext, "go-to-x", workSpaceMarkUp, false) %> + +
+ + <% + String redirect = ParamUtil.getString(request, "redirect");%> + + + <%@ include file="/html/portlet/login/RequestingApplication.jsp"%> + + + + + + <% + String login = LoginUtil.getLogin(request, "login", company); + String password = StringPool.BLANK; + boolean rememberMe = ParamUtil.getBoolean(request, "rememberMe"); + + if (Validator.isNull(authType)) { + authType = company.getAuthType(); + } + %> + + + + + + + + + + + + + + <% + String userEmailAddress = (String)SessionMessages.get(request, "userAdded"); + String userPassword = (String)SessionMessages.get(request, "userAddedPassword"); + %> + +
+ + + <%= LanguageUtil.get(pageContext, "thank-you-for-creating-an-account") %> + + + <%= LanguageUtil.format(pageContext, "your-email-verification-code-has-been-sent-to-x", userEmailAddress) %> + + + + <%= LanguageUtil.format(pageContext, "thank-you-for-creating-an-account.-your-password-is-x", userPassword, false) %> + + + + <%-- + <%= LanguageUtil.format(pageContext, "your-password-has-been-sent-to-x", userEmailAddress) %> + --%> +
+
+ + + <% + String userEmailAddress = (String)SessionMessages.get(request, "userPending"); + %> + +
+ <%= LanguageUtil.format(pageContext, "thank-you-for-creating-an-account.-you-will-be-notified-via-email-at-x-when-your-account-has-been-approved", userEmailAddress) %> +
+
+
+ + + + + + + + + + + + + + <% + String loginLabel = null; + + if (authType.equals(CompanyConstants.AUTH_TYPE_EA)) { + loginLabel = "email-address"; + } + else if (authType.equals(CompanyConstants.AUTH_TYPE_SN)) { + loginLabel = "screen-name"; + } + else if (authType.equals(CompanyConstants.AUTH_TYPE_ID)) { + loginLabel = "id"; + } + %> + + + +
+ + + + +
+
+ +
+
+ +
+
+
+
+
+ + + + var password = A.one('#password'); + + if (password) { + password.on( + 'keypress', + function(event) { + Liferay.Util.showCapsLock(event, 'passwordCapsLockSpan'); + } + ); + } + +
+
+ + + diff --git a/src/main/webapp/META-INF/custom_jsps/html/portlet/login/navigation.jsp b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/navigation.jsp new file mode 100644 index 0000000..e857d2b --- /dev/null +++ b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/navigation.jsp @@ -0,0 +1,57 @@ +<%-- +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ +--%> + +<%@ include file="/html/portlet/login/init.jsp" %> + + + + + <% + for (String section : PropsValues.LOGIN_FORM_NAVIGATION_PRE) { + %> + + + + <% + } + + for (String section : PropsValues.LOGIN_FORM_NAVIGATION_POST) { + %> + + + + <% + } + %> + + + + +<% +navigation = navigation.trim(); +%> + + + + + +<%! +private String _getSectionJsp(String name) { + return TextFormatter.format(name, TextFormatter.N); +} +%> \ No newline at end of file diff --git a/src/main/webapp/META-INF/custom_jsps/html/portlet/login/social.jsp b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/social.jsp new file mode 100644 index 0000000..a4d2607 --- /dev/null +++ b/src/main/webapp/META-INF/custom_jsps/html/portlet/login/social.jsp @@ -0,0 +1,18 @@ +<%@ include file="/html/portlet/login/init.jsp" %> + +<% + +String[] socials = PropsUtil.getArray("login.form.navigation.socials"); + +%> + + +
+<% for (String social : socials){ %> + + + +<% } %> +
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/liferay-hook.xml b/src/main/webapp/WEB-INF/liferay-hook.xml new file mode 100644 index 0000000..2ee64fc --- /dev/null +++ b/src/main/webapp/WEB-INF/liferay-hook.xml @@ -0,0 +1,8 @@ + + + + + portal.properties + content/Language.properties + /META-INF/custom_jsps + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/liferay-plugin-package.properties b/src/main/webapp/WEB-INF/liferay-plugin-package.properties new file mode 100644 index 0000000..04165c7 --- /dev/null +++ b/src/main/webapp/WEB-INF/liferay-plugin-package.properties @@ -0,0 +1,9 @@ +name=login-hook +module-group-id=liferay +module-incremental-version=1 +tags= +short-description= +change-log= +page-url=http://www.liferay.com +author=Liferay, Inc. +licenses=LGPL \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..7d8c082 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file