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
This commit is contained in:
Massimiliano Assante 2017-02-01 16:40:57 +00:00
parent 5106ab87a6
commit 85d17b016c
31 changed files with 1247 additions and 0 deletions

32
.classpath Normal file
View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

42
.project Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>login-hook-1.0.0</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>

13
.settings/.jsdtscope Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/webapp"/>
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

View File

@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding/<project>=UTF-8

View File

@ -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

View File

@ -0,0 +1,4 @@
activeProfiles=gcube
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="login-hook-1.0">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="java-output-path" value="/login-hook/target/classes"/>
<property name="context-root" value="login-hook"/>
</wb-module>
</project-modules>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="jst.web" version="2.4"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="liferay.hook" version="6.0"/>
<installed facet="java" version="1.7"/>
</faceted-project>

View File

@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary

View File

@ -0,0 +1 @@
Window

View File

@ -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

1
distro/LICENSE Normal file
View File

@ -0,0 +1 @@
${gcube.license}

64
distro/README Normal file
View File

@ -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.

5
distro/changelog.xml Normal file
View File

@ -0,0 +1,5 @@
<ReleaseNotes>
<Changeset component="gr.cite.login.login-hook.1-0-0" date="2016-03-30">
<Change>Login hook for liferay login portlet. Offers a more attractive social login UI</Change>
</Changeset>
</ReleaseNotes>

31
distro/descriptor.xml Normal file
View File

@ -0,0 +1,31 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>servicearchive</id>
<formats>
<format>tar.gz</format>
</formats>
<baseDirectory>/</baseDirectory>
<fileSets>
<fileSet>
<directory>${distroDirectory}</directory>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<includes>
<include>README</include>
<include>LICENSE</include>
<include>changelog.xml</include>
<include>profile.xml</include>
</includes>
<fileMode>755</fileMode>
<filtered>true</filtered>
</fileSet>
</fileSets>
<files>
<file>
<source>target/${build.finalName}.${project.packaging}</source>
<outputDirectory>/${artifactId}</outputDirectory>
</file>
</files>
</assembly>

25
distro/profile.xml Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<Resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID />
<Type>Service</Type>
<Profile>
<Description>${description}</Description>
<Class>Portal</Class>
<Name>${artifactId}</Name>
<Version>${version}</Version>
<Packages>
<Software>
<Name>${artifactId}</Name>
<Version>${version}</Version>
<MavenCoordinates>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
</MavenCoordinates>
<Files>
<File>target/${build.finalName}.war</File>
</Files>
</Software>
</Packages>
</Profile>
</Resource>

134
pom.xml Normal file
View File

@ -0,0 +1,134 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.0.0</version>
</parent>
<groupId>org.gcube.portal</groupId>
<artifactId>login-hook</artifactId>
<packaging>war</packaging>
<name>login-hook Hook</name>
<version>1.1.0-SNAPSHOT</version>
<scm>
<connection>scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/branches/portal/login-hook/1.0</connection>
<developerConnection>scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/branches/portal/login-hook/1.0</developerConnection>
<url>https://svn.d4science.research-infrastructures.eu/gcube/branches/portal/login-hook/1.0</url>
</scm>
<properties>
<liferay.version>6.2.2</liferay.version>
<liferay.auto.deploy.dir>${system.CATALINA_HOME}/../deploy</liferay.auto.deploy.dir>
<distroDirectory>${project.basedir}/distro</distroDirectory>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>com.liferay.maven.plugins</groupId>
<artifactId>liferay-maven-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<phase>generate-sources</phase>
</execution>
</executions>
<configuration>
<autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
<appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir>
<appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir>
<appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir>
<liferayVersion>${liferay.version}</liferayVersion>
<pluginType>hook</pluginType>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>${distroDirectory}/descriptor.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>servicearchive</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-java</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common.portal</groupId>
<artifactId>portal-manager</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,2 @@
data-e-Infrastructure-gateway-home=Data e-Infrastructure gateway Home
shared-workspace=Shared Workspace

View File

@ -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

View File

@ -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<String, String> 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) {
%>
<script>
$(".portlet-title-text").text("Sign in to approve application");
</script>
<div style="text-align: center;">
<%
if (app.getLogoURL() != null && !app.getLogoURL().isEmpty()) {
%>
<p>
<img style="width: 100px;" src="<%=app.getLogoURL()%>" />
<p>
<%
}
%>
<p class="lead">
<span style="font-weight: bolder;"><%=app.getApplicationId()%></span>
would like to access some of your D4Science info: <br /> Name, photo,
email and current roles
<%
if (scope != null && scope.compareTo("") != 0) {
%>
on context: <span style="font-weight: bolder;"><%=scope%></span>
<%
}
%>
<p>
<p>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.
<p>
<p>
<button class="btn" onClick="location.href='<%=context.getGatewayURL(request)%>'">Cancel</button>
</p>
</div>
<%
} else {
System.out.println(
"The client_id does not exist or something occurred in retrieving it from IS: "
+ clientId);
}
}
}
}
%>

View File

@ -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;
}

View File

@ -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" %>

View File

@ -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);

View File

@ -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);

View File

@ -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');
});
});

View File

@ -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"%>
<script>
window.jQuery
|| document
.write('<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"><\/script>')
</script>
<script type="text/javascript"
src="/html/portlet/login/js/bootstrap-collapse.js"></script>
<script type="text/javascript"
src="/html/portlet/login/js/bootstrap-transition.js"></script>
<script type="text/javascript"
src="/html/portlet/login/js/login-hook.js"></script>
<link rel="stylesheet" href="/html/portlet/login/css/login-hook.css">
<%
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;
%>
<c:choose>
<c:when test="<%= themeDisplay.isSignedIn() %>">
<%
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 = "<a class=\"signed-in\" href=\"javascript:Liferay.Util.openWindow({dialog: {destroyOnHide: true}, title: '" + HtmlUtil.escapeJS(LanguageUtil.get(pageContext, "my-account")) + "', uri: '" + HtmlUtil.escapeJS(myAccountURL) + "'});\">" + signedInAs + "</a>";
}
else {
myAccountURL = HttpUtil.setParameter(myAccountURL, "controlPanelCategory", PortletCategoryKeys.MY);
signedInAs = "<a class=\"signed-in\" href=\"" + HtmlUtil.escape(myAccountURL) + "\">" + signedInAs + "</a>";
}
}
%>
<%
String siteMarkUp = "<a href=\"" + HtmlUtil.escape(siteUrl) + "\">" + themeDisplay.getSiteGroupName() +"</a>";
String workSpaceMarkUp = "<a href=\"" + HtmlUtil.escape(workspaceUrl) + "\">" + LanguageUtil.get(pageContext, "shared-workspace") +"</a>";
%>
<%= LanguageUtil.format(pageContext, "you-are-signed-in-as-x", signedInAs, false) %>
<br>
<%= LanguageUtil.format(pageContext, "go-to-x", siteMarkUp, false) %>
<br>
<%= LanguageUtil.format(pageContext, "go-to-x", workSpaceMarkUp, false) %>
</c:when>
<c:otherwise>
<%
String redirect = ParamUtil.getString(request, "redirect");%>
<!-- include for recongnizing requesting apps-->
<%@ include file="/html/portlet/login/RequestingApplication.jsp"%>
<!-- end include for recongnizing requesting apps-->
<h4 class="login-sign-in"><%= LanguageUtil.get(pageContext, "sign-in") %></h4>
<%
String login = LoginUtil.getLogin(request, "login", company);
String password = StringPool.BLANK;
boolean rememberMe = ParamUtil.getBoolean(request, "rememberMe");
if (Validator.isNull(authType)) {
authType = company.getAuthType();
}
%>
<portlet:actionURL
secure="<%= PropsValues.COMPANY_SECURITY_AUTH_REQUIRES_HTTPS || request.isSecure() %>"
var="loginURL">
<portlet:param name="struts_action" value="/login/login" />
</portlet:actionURL>
<aui:form action="<%= loginURL %>"
autocomplete='<%= PropsValues.COMPANY_SECURITY_LOGIN_FORM_AUTOCOMPLETE ? "on" : "off" %>'
cssClass="sign-in-form" method="post" name="fm">
<aui:input name="saveLastPath" type="hidden" value="<%= false %>" />
<aui:input name="redirect" type="hidden" value="<%= redirect %>" />
<aui:input name="doActionAfterLogin" type="hidden"
value="<%= portletName.equals(PortletKeys.FAST_LOGIN) ? true : false %>" />
<c:choose>
<c:when test='<%= SessionMessages.contains(request, "userAdded") %>'>
<%
String userEmailAddress = (String)SessionMessages.get(request, "userAdded");
String userPassword = (String)SessionMessages.get(request, "userAddedPassword");
%>
<div class="alert alert-success">
<c:choose>
<c:when
test="<%= company.isStrangersVerify() || Validator.isNull(userPassword) %>">
<%= LanguageUtil.get(pageContext, "thank-you-for-creating-an-account") %>
<c:if test="<%= company.isStrangersVerify() %>">
<%= LanguageUtil.format(pageContext, "your-email-verification-code-has-been-sent-to-x", userEmailAddress) %>
</c:if>
</c:when>
<c:otherwise>
<%= LanguageUtil.format(pageContext, "thank-you-for-creating-an-account.-your-password-is-x", userPassword, false) %>
</c:otherwise>
</c:choose>
<%-- <c:if test="<%= PrefsPropsUtil.getBoolean(company.getCompanyId(), PropsKeys.ADMIN_EMAIL_USER_ADDED_ENABLED) %>">
<%= LanguageUtil.format(pageContext, "your-password-has-been-sent-to-x", userEmailAddress) %>
</c:if> --%>
</div>
</c:when>
<c:when
test='<%= SessionMessages.contains(request, "userPending") %>'>
<%
String userEmailAddress = (String)SessionMessages.get(request, "userPending");
%>
<div class="alert alert-success">
<%= LanguageUtil.format(pageContext, "thank-you-for-creating-an-account.-you-will-be-notified-via-email-at-x-when-your-account-has-been-approved", userEmailAddress) %>
</div>
</c:when>
</c:choose>
<liferay-ui:error exception="<%= AuthException.class %>"
message="authentication-failed" />
<liferay-ui:error exception="<%= CompanyMaxUsersException.class %>"
message="unable-to-login-because-the-maximum-number-of-users-has-been-reached" />
<liferay-ui:error
exception="<%= CookieNotSupportedException.class %>"
message="authentication-failed-please-enable-browser-cookies" />
<liferay-ui:error exception="<%= NoSuchUserException.class %>"
message="authentication-failed" />
<liferay-ui:error exception="<%= PasswordExpiredException.class %>"
message="your-password-has-expired" />
<liferay-ui:error exception="<%= UserEmailAddressException.class %>"
message="authentication-failed" />
<liferay-ui:error exception="<%= UserLockoutException.class %>"
message="this-account-has-been-locked" />
<liferay-ui:error exception="<%= UserPasswordException.class %>"
message="authentication-failed" />
<liferay-ui:error exception="<%= UserScreenNameException.class %>"
message="authentication-failed" />
<aui:fieldset>
<%
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";
}
%>
<div class="custom-form-login-wrapper">
<aui:input
autoFocus="<%= windowState.equals(LiferayWindowState.EXCLUSIVE) || windowState.equals(WindowState.MAXIMIZED) %>"
cssClass="clearable login-identifier input-xlarge"
placeholder="<%= loginLabel %>" label="" name="login"
showRequiredLabel="<%= false %>" type="text">
<aui:validator name="required" />
</aui:input>
<aui:input name="password" placeholder="password"
cssClass="login-password input-xlarge" label=""
showRequiredLabel="<%= false %>" type="password"
value="<%= password %>">
<aui:validator name="required" />
</aui:input>
<aui:button type="submit"
cssClass="login-sign-in-button input-xlarge" value="sign-in" />
<span id="<portlet:namespace />passwordCapsLockSpan"
style="display: none;"><liferay-ui:message
key="caps-lock-is-on" /></span>
<c:if
test="<%= company.isAutoLogin() && !PropsValues.SESSION_DISABLED %>">
<div class="login-remember-me">
<aui:input checked="<%= rememberMe %>" name="rememberMe"
type="checkbox" />
</div>
</c:if>
</div>
</aui:fieldset>
</aui:form>
<liferay-util:include page="/html/portlet/login/navigation.jsp" />
<c:if test="<%= socials.length > 0 %>">
<div class="accordion" id="accordion" role="tablist">
<div class="accordion-group">
<div class="accordion-heading">
<a data-toggle="collapse" data-parent="#accordion"
href="#collapseMe" aria-expanded="true"
aria-controls="collapseMe">
<h4>
<i class="icon-double-angle-up"></i>
</h4>
</a>
</div>
<div id="collapseMe" class="accordion-body collapse in">
<div class="accordion-inner">
<liferay-util:include page="/html/portlet/login/social.jsp" />
</div>
</div>
</div>
</div>
</c:if>
<aui:script use="aui-base">
var password = A.one('#<portlet:namespace />password');
if (password) {
password.on(
'keypress',
function(event) {
Liferay.Util.showCapsLock(event, '<portlet:namespace />passwordCapsLockSpan');
}
);
}
</aui:script>
</c:otherwise>
</c:choose>
<c:if test="<%= hideCreateAccountAndForgotPassword == true %>">
<script>
$(".taglib-icon-list").hide();
</script>
</c:if>

View File

@ -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" %>
<liferay-util:buffer var="navigation">
<liferay-ui:icon-list>
<%
for (String section : PropsValues.LOGIN_FORM_NAVIGATION_PRE) {
%>
<liferay-util:include page='<%= "/html/portlet/login/navigation/" + _getSectionJsp(section) + ".jsp" %>' portletId="<%= portletDisplay.getRootPortletId() %>" />
<%
}
for (String section : PropsValues.LOGIN_FORM_NAVIGATION_POST) {
%>
<liferay-util:include page='<%= "/html/portlet/login/navigation/" + _getSectionJsp(section) + ".jsp" %>' portletId="<%= portletDisplay.getRootPortletId() %>" />
<%
}
%>
</liferay-ui:icon-list>
</liferay-util:buffer>
<%
navigation = navigation.trim();
%>
<c:if test="<%= Validator.isNotNull(navigation) %>">
<div class="navigation">
<%= navigation %>
</div>
</c:if>
<%!
private String _getSectionJsp(String name) {
return TextFormatter.format(name, TextFormatter.N);
}
%>

View File

@ -0,0 +1,18 @@
<%@ include file="/html/portlet/login/init.jsp" %>
<%
String[] socials = PropsUtil.getArray("login.form.navigation.socials");
%>
<div class="socials">
<% for (String social : socials){ %>
<div class="social">
<liferay-util:include page='<%= "/html/portlet/login/navigation/" + social + ".jsp" %>' portletId="<%= portletDisplay.getRootPortletId() %>" />
</div>
<% } %>
</div>

View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook>
<portal-properties>portal.properties</portal-properties>
<language-properties>content/Language.properties</language-properties>
<custom-jsp-dir>/META-INF/custom_jsps</custom-jsp-dir>
</hook>

View File

@ -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

View File

@ -0,0 +1,4 @@
<?xml version="1.0"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
</web-app>