diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.classpath b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.classpath
deleted file mode 100644
index 81819043..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.classpath
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.project b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.project
deleted file mode 100644
index c5c939f3..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.project
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
- sicilia-login-hook
-
-
-
-
-
- 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.jem.workbench.JavaEMFNature
- org.eclipse.wst.common.modulecore.ModuleCoreNature
- org.eclipse.wst.common.project.facet.core.nature
- org.eclipse.jdt.core.javanature
- org.apache.ivyde.eclipse.ivynature
- org.eclipse.wst.jsdt.core.jsNature
-
-
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/.jsdtscope b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/.jsdtscope
deleted file mode 100644
index 840a01d5..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/.jsdtscope
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.jdt.core.prefs b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f42de363..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-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.source=1.7
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.common.component b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.common.component
deleted file mode 100644
index bacfbb69..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.common.component
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
deleted file mode 100644
index 1f9ee534..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.common.project.facet.core.xml b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.common.project.facet.core.xml
deleted file mode 100644
index 02ccc82b..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.jsdt.ui.superType.container b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.jsdt.ui.superType.container
deleted file mode 100644
index 3bd5d0a4..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.jsdt.ui.superType.container
+++ /dev/null
@@ -1 +0,0 @@
-org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.jsdt.ui.superType.name b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.jsdt.ui.superType.name
deleted file mode 100644
index 05bd71b6..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/.settings/org.eclipse.wst.jsdt.ui.superType.name
+++ /dev/null
@@ -1 +0,0 @@
-Window
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/build.xml b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/build.xml
deleted file mode 100644
index c2d19b37..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/build.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/META-INF/MANIFEST.MF b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/META-INF/MANIFEST.MF
deleted file mode 100644
index 5e949512..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/.gitignore b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/.gitignore
deleted file mode 100644
index 840e7d31..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/classes/
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/liferay-hook.xml b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/liferay-hook.xml
deleted file mode 100644
index 4ba27c04..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/liferay-hook.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- portal.properties
-
- Sicilia SSO
- it.mwg.sicilia.login.SiciliaLoginFilter
-
-
- Sicilia SSO
- /c/portal/login
- FORWARD
- REQUEST
-
-
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/liferay-plugin-package.properties b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/liferay-plugin-package.properties
deleted file mode 100644
index fca51bc8..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/liferay-plugin-package.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-name=Sicilia Login Hook
-module-group-id=liferay
-module-incremental-version=1
-tags=
-short-description=
-long-description=
-change-log=
-page-url=http://www.liferay.com
-author=Liferay, Inc.
-licenses=LGPL
-liferay-versions=6.2.0+
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/constants/ApiConstants.java b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/constants/ApiConstants.java
deleted file mode 100644
index e5e5b9bc..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/constants/ApiConstants.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package it.mwg.sicilia.constants;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class ApiConstants {
- public static final String LABEL_ERROR_CODE = "code";
- public static final String LABEL_DESCRIPTION = "description";
- public static final String LABEL_STATUS = "status";
-
- public static final int ERROR_OK = 0;
- public static final int ERROR_INVALID_AUTH = 1;
- public static final int ERROR_INVALID_LOGIN = 2;
- public static final int ERROR_INVALID_TOKEN = 3;
- public static final int ERROR_INVALID_INPUT = 4;
- public static final int ERROR_MISSING_PARAMETER = 5;
- public static final int ERROR_INVALID_PASSWORD = 6;
-
- public static final String STATUS_OK = "success";
- public static final String STATUS_ERROR = "error";
-
- public static final String API_USERNAME = "sismica";
- public static final String API_PASSWORD = "4Tr-D%fO!sli5";
-
- public static final String PARAMETER_AUTH = "auth";
- public static final String PARAMETER_CALLBACK_URL = "callback";
- public static final String PARAMETER_TOKEN = "token";
- public static final String PARAMETER_USERNAME = "username";
- public static final String PARAMETER_PASSWORD = "password";
- public static final String PARAMETER_FIRST_NAME = "nome";
- public static final String PARAMETER_LAST_NAME = "cognome";
- public static final String PARAMETER_CODICE_FISCALE = "codice_fiscale";
-
- private static final String SESSION_BASE = "SICILIA_HOOK_";
- public static final String SESSION_AUTH = SESSION_BASE + PARAMETER_AUTH.toUpperCase();
- public static final String SESSION_TOKEN = SESSION_BASE + PARAMETER_TOKEN.toUpperCase();
- public static final String SESSION_USER_DATA = SESSION_BASE + "USER_DATA";
-
- public static final String LOGIN_SERVER = "https://autenticazione.lavoripubblici.sicilia.it/";
- private static final String ENDPOINT_BASE = LOGIN_SERVER + "api/v1/";
- public static final String ENDPOINT_LOGIN = ENDPOINT_BASE + "login.cgi";
- public static final String ENDPOINT_GET_TOKEN = ENDPOINT_BASE + "get_token.cgi";
- public static final String ENDPOINT_GET_USER = ENDPOINT_BASE + "get_user.cgi";
-
- public static final String HTTP_USER_AGENT = "Sicilia Login like Mozilla/5.0";
-}
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/login/SiciliaAutoLogin.java b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/login/SiciliaAutoLogin.java
deleted file mode 100644
index 0c2074e0..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/login/SiciliaAutoLogin.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package it.mwg.sicilia.login;
-
-import it.mwg.sicilia.constants.ApiConstants;
-
-import java.util.Date;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import com.liferay.portal.kernel.exception.PortalException;
-import com.liferay.portal.kernel.exception.SystemException;
-import com.liferay.portal.kernel.log.Log;
-import com.liferay.portal.kernel.log.LogFactoryUtil;
-import com.liferay.portal.kernel.security.SecureRandom;
-import com.liferay.portal.kernel.util.StringPool;
-import com.liferay.portal.kernel.util.Validator;
-import com.liferay.portal.model.User;
-import com.liferay.portal.security.auth.AutoLogin;
-import com.liferay.portal.security.auth.AutoLoginException;
-import com.liferay.portal.service.ServiceContext;
-import com.liferay.portal.service.UserLocalServiceUtil;
-import com.liferay.portal.util.PortalUtil;
-
-/**
- * @author Manifattura Web Group per Regione Siciliana
- *
- */
-public class SiciliaAutoLogin implements AutoLogin {
- private static final Log _log = LogFactoryUtil.getLog(SiciliaAutoLogin.class);
-
- @Override
- public String[] login(HttpServletRequest request, HttpServletResponse response) throws AutoLoginException {
- User user = null;
- HttpSession session = request.getSession();
- Map userData = (Map) session
- .getAttribute(ApiConstants.SESSION_USER_DATA);
- if (Validator.isNotNull(userData)) {
- long companyId = PortalUtil.getCompanyId(request);
- user = logUser(companyId, userData.get(ApiConstants.PARAMETER_CODICE_FISCALE),
- userData.get(ApiConstants.PARAMETER_FIRST_NAME),
- userData.get(ApiConstants.PARAMETER_LAST_NAME));
- if (Validator.isNotNull(user)) {
- return new String[] { String.valueOf(user.getUserId()), user.getPassword(),
- String.valueOf(user.isPasswordEncrypted()) };
- }
- }
- return null;
- }
-
- @Override
- public String[] handleException(HttpServletRequest request, HttpServletResponse response, Exception e)
- throws AutoLoginException {
- _log.error(e);
- return null;
- }
-
- private User logUser(long companyId, String screenName, String firstName, String lastName) {
- _log.info("Cerco l'utente " + screenName + " (" + firstName + " " + lastName + ")");
- User user = null;
- try {
- user = UserLocalServiceUtil.fetchUserByScreenName(companyId, screenName);
-
- if (Validator.isNull(user)) {
- long creatorUserId = UserLocalServiceUtil.getDefaultUserId(companyId);
- boolean autoPassword = true;
- String password = randomPassword(24);
- boolean autoScreenName = false;
- String emailAddress = screenName + "@no-email.regione.sicilia.it";
- long facebookId = 0;
- String openId = StringPool.BLANK;
- Locale locale = Locale.ITALY;
- String middleName = StringPool.BLANK;
- int prefixId = 0;
- int suffixId = 0;
- boolean male = true;
- int birthdayMonth = 0;
- int birthdayDay = 1;
- int birthdayYear = 1970;
- String jobTitle = StringPool.BLANK;
- long[] groupIds = null;
- long[] organizationIds = null;
- long[] roleIds = null;
- long[] userGroupIds = null;
- boolean sendEmail = false;
- ServiceContext serviceContext = new ServiceContext();
- user = UserLocalServiceUtil.addUser(creatorUserId, companyId, autoPassword, password,
- password, autoScreenName, screenName, emailAddress, facebookId, openId, locale,
- firstName, middleName, lastName, prefixId, suffixId, male, birthdayMonth,
- birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds, roleIds,
- userGroupIds, sendEmail, serviceContext);
- user.setPasswordModified(true);
- user.setPasswordModifiedDate(new Date());
- user.setPasswordReset(false);
- UserLocalServiceUtil.updateUser(user);
- }
- } catch (SystemException | PortalException e) {
- _log.error("Errore durante l'autenticazione/creazione dell'utente " + screenName, e);
- }
- return user;
- }
-
- private String randomPassword(int length) {
- SecureRandom rnd = new SecureRandom();
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < length; i++) {
- sb.append((char) (32 + rnd.nextInt(95)));
- }
- return sb.toString();
- }
-}
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/login/SiciliaLoginFilter.java b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/login/SiciliaLoginFilter.java
deleted file mode 100644
index b94c6ef9..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/login/SiciliaLoginFilter.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package it.mwg.sicilia.login;
-
-import it.mwg.sicilia.constants.ApiConstants;
-import it.mwg.sicilia.util.ApiUtil;
-
-import java.io.IOException;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import com.liferay.portal.kernel.exception.PortalException;
-import com.liferay.portal.kernel.exception.SystemException;
-import com.liferay.portal.kernel.log.Log;
-import com.liferay.portal.kernel.log.LogFactoryUtil;
-import com.liferay.portal.kernel.util.StringPool;
-import com.liferay.portal.kernel.util.Validator;
-import com.liferay.portal.kernel.util.WebKeys;
-import com.liferay.portal.model.User;
-import com.liferay.portal.service.ServiceContext;
-import com.liferay.portal.service.UserLocalServiceUtil;
-import com.liferay.portal.util.PortalUtil;
-
-public class SiciliaLoginFilter implements Filter {
- public static final Log _log = LogFactoryUtil.getLog(SiciliaLoginFilter.class);
-
- @Override
- public void destroy() {
- }
-
- @Override
- public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain)
- throws IOException, ServletException {
- HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
- String url = httpServletRequest.getRequestURL().toString();
- String qs = httpServletRequest.getQueryString();
- if (Validator.isNotNull(qs)) {
- url += "?" + qs;
- }
- _log.info("Filtro: " + url);
- HttpSession session = httpServletRequest.getSession();
- String token = (String) session.getAttribute(ApiConstants.SESSION_TOKEN);
- if (Validator.isNull(token)) {
- token = ApiUtil.getToken(url);
- _log.info("Ho creato il token " + token + ". Eseguo redirect");
- session.setAttribute(ApiConstants.SESSION_TOKEN, token);
- ((HttpServletResponse) servletResponse).sendRedirect(ApiConstants.LOGIN_SERVER + "?t=" + token);
- return;
- } else {
- Map userData = ApiUtil.getUserInfo(token);
- if (Validator.isNull(userData)) {
- _log.info("Il token potrebbe essere scaduto. Lo ricreo ed eseguo redirect.");
- token = ApiUtil.getToken(url);
- session.setAttribute(ApiConstants.SESSION_TOKEN, token);
- ((HttpServletResponse) servletResponse).sendRedirect(ApiConstants.LOGIN_SERVER + "?t="
- + token);
- return;
- } else {
- session.setAttribute(ApiConstants.SESSION_USER_DATA, userData);
- }
- }
- chain.doFilter(servletRequest, servletResponse);
- }
-
- @Override
- public void init(FilterConfig config) throws ServletException {
- }
-}
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/util/ApiUtil.java b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/util/ApiUtil.java
deleted file mode 100644
index 15f04d44..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/it/mwg/sicilia/util/ApiUtil.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package it.mwg.sicilia.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import it.mwg.sicilia.constants.ApiConstants;
-
-import com.liferay.portal.kernel.json.JSONException;
-import com.liferay.portal.kernel.json.JSONFactoryUtil;
-import com.liferay.portal.kernel.json.JSONObject;
-import com.liferay.portal.kernel.log.Log;
-import com.liferay.portal.kernel.log.LogFactoryUtil;
-import com.liferay.portal.kernel.util.Validator;
-
-public class ApiUtil {
- private static final Log _log = LogFactoryUtil.getLog(ApiUtil.class);
- private static String auth = null;
-
- public static String getToken(String callbackURL) {
- if (Validator.isNull(auth)) {
- login();
- }
- for (int i = 0; i < 10; i++) {
- if (Validator.isNotNull(auth)) {
- JSONObject map = JSONFactoryUtil.createJSONObject();
- map.put(ApiConstants.PARAMETER_AUTH, auth).put(ApiConstants.PARAMETER_CALLBACK_URL,
- callbackURL);
- map = post(ApiConstants.ENDPOINT_GET_TOKEN, map);
- if (Validator.isNotNull(map)) {
- switch (map.getInt(ApiConstants.LABEL_ERROR_CODE)) {
- case ApiConstants.ERROR_OK:
- return map.getString(ApiConstants.PARAMETER_TOKEN);
- case ApiConstants.ERROR_INVALID_AUTH:
- _log.info("Auth scaduto. Eseguo nuovo login");
- login();
- break;
- default:
- _log.error("Errore durante la creazione del token: " + map.toString());
- return null;
- }
- } else {
- _log.error("Errore inatteso durante la creazione del token");
- }
- }
- }
- return null;
- }
-
- public static Map getUserInfo(String token) {
- _log.info("Recupero informazioni sull'utente con il token " + token + ", auth " + auth);
- JSONObject map = JSONFactoryUtil.createJSONObject();
- map.put(ApiConstants.PARAMETER_AUTH, auth).put(ApiConstants.PARAMETER_TOKEN, token);
- map = post(ApiConstants.ENDPOINT_GET_USER, map);
- if (Validator.isNotNull(map)) {
- switch (map.getInt(ApiConstants.LABEL_ERROR_CODE)) {
- case ApiConstants.ERROR_OK:
- _log.info("Ho i dati dell'utente");
- Map ret = new HashMap();
- ret.put(ApiConstants.PARAMETER_FIRST_NAME, map.getString(ApiConstants.PARAMETER_FIRST_NAME));
- ret.put(ApiConstants.PARAMETER_LAST_NAME, map.getString(ApiConstants.PARAMETER_LAST_NAME));
- ret.put(ApiConstants.PARAMETER_CODICE_FISCALE,
- map.getString(ApiConstants.PARAMETER_CODICE_FISCALE));
- return ret;
- default:
- _log.error("Errore durante il recupero dei dati utente: " + map.toString());
- }
- }
- return null;
- }
-
- private static void login() {
- JSONObject map = JSONFactoryUtil.createJSONObject();
- map.put(ApiConstants.PARAMETER_USERNAME, ApiConstants.API_USERNAME).put(
- ApiConstants.PARAMETER_PASSWORD, ApiConstants.API_PASSWORD);
- map = post(ApiConstants.ENDPOINT_LOGIN, map);
- if (Validator.isNotNull(map)) {
- if (ApiConstants.ERROR_OK == map.getInt(ApiConstants.LABEL_ERROR_CODE)) {
- auth = map.getString(ApiConstants.PARAMETER_AUTH);
- } else {
- _log.error("Errore durante il login: " + map.toString());
- }
- }
- }
-
- private static JSONObject post(String endPoint, JSONObject json) {
- try {
- URL url = new URL(endPoint);
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setRequestMethod("POST");
- connection.setRequestProperty("User-Agent", ApiConstants.HTTP_USER_AGENT);
- connection.setDoOutput(true);
- OutputStream stream = connection.getOutputStream();
- _log.info("Invio: " + json.toString() + " (" + endPoint + ")");
- stream.write(json.toString().getBytes());
- stream.flush();
- stream.close();
- int code = connection.getResponseCode();
- if (code == HttpURLConnection.HTTP_OK) {
- String response = readResponse(connection);
- _log.info("Ricevo: " + response);
- JSONObject ret = JSONFactoryUtil.createJSONObject(response);
- return ret;
- }
- } catch (IOException | JSONException e) {
- _log.error(e);
- }
- return null;
- }
-
- private static String readResponse(HttpURLConnection connection) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- StringBuilder builder = new StringBuilder();
- String inputLine;
- while ((inputLine = reader.readLine()) != null) {
- builder.append(inputLine);
- }
- reader.close();
-
- return builder.toString();
- }
-}
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/portal.properties b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/portal.properties
deleted file mode 100644
index 37b77654..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/src/portal.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-#auth.pipeline.enable.liferay.check=false
-auto.login.hooks=it.mwg.sicilia.login.SiciliaAutoLogin
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/web.xml b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/web.xml
deleted file mode 100644
index ff1320bc..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/docroot/WEB-INF/web.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/ivy.xml b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/ivy.xml
deleted file mode 100644
index abdd7ea2..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/ivy.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/ivy.xml.MD5 b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/ivy.xml.MD5
deleted file mode 100644
index 29d34b16..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/ivy.xml.MD5
+++ /dev/null
@@ -1 +0,0 @@
-f1563bf5bac3cf93500d1510b72dd9da
diff --git a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/test/integration/arquillian.xml b/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/test/integration/arquillian.xml
deleted file mode 100644
index 9413609b..00000000
--- a/liferay-plugins-sdk-6.2/hooks/sicilia-login-hook/test/integration/arquillian.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
- 8099
- tomcat
- tomcat
-
-
-
\ No newline at end of file