--- /dev/null
+/**\r
+ * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.\r
+ *\r
+ * This library is free software; you can redistribute it and/or modify it under\r
+ * the terms of the GNU Lesser General Public License as published by the Free\r
+ * Software Foundation; either version 2.1 of the License, or (at your option)\r
+ * any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful, but WITHOUT\r
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\r
+ * details.\r
+ */\r
+\r
+package com.liferay.portal.action;\r
+\r
+import java.util.Date;\r
+\r
+import com.liferay.portal.service.UserServiceUtil;\r
+import com.liferay.portal.struts.ActionConstants;\r
+import com.liferay.portal.util.PortalUtil;\r
+import com.pentila.entSavoie.userProperties.model.UserProperties;\r
+import com.pentila.entSavoie.userProperties.service.UserPropertiesLocalServiceUtil;\r
+\r
+import javax.servlet.http.HttpServletRequest;\r
+import javax.servlet.http.HttpServletResponse;\r
+\r
+import org.apache.struts.action.Action;\r
+import org.apache.struts.action.ActionForm;\r
+import org.apache.struts.action.ActionForward;\r
+import org.apache.struts.action.ActionMapping;\r
+\r
+/**\r
+ * @author Brian Wing Shun Chan\r
+ */\r
+public class UpdateTermsOfUseAction extends Action {\r
+\r
+ @Override\r
+ public ActionForward execute(\r
+ ActionMapping mapping, ActionForm form, HttpServletRequest request,\r
+ HttpServletResponse response)\r
+ throws Exception {\r
+\r
+ long userId = PortalUtil.getUserId(request);\r
+\r
+ UserServiceUtil.updateAgreedToTermsOfUse(userId, true);\r
+ \r
+ UserProperties userProperties = UserPropertiesLocalServiceUtil.getUserPropertiesByUserId(userId);\r
+ userProperties.setTermsOfUseAgreedDate(new Date());\r
+ UserPropertiesLocalServiceUtil.updateUserProperties(userProperties);\r
+\r
+ return mapping.findForward(ActionConstants.COMMON_REFERER_JSP);\r
+ }\r
+\r
+}
\ No newline at end of file