Author: kcardineaud Date: 2011-08-25 11:42:26 +0200 (Thu, 25 Aug 2011) New Revision: 242 Url: http://nuiton.org/repositories/revision/scmwebeditor/242 Log: Add cookies for authentifications Added: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java trunk/src/main/webapp/WEB-INF/content/logout.jsp Modified: trunk/pom.xml trunk/src/main/java/org/nuiton/scmwebeditor/SvnConnection.java trunk/src/main/java/org/nuiton/scmwebeditor/actions/SaveAction.java trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorCommitAction.java trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java trunk/src/main/resources/scmwebeditor.properties trunk/src/main/resources/struts.xml trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp trunk/src/main/webapp/WEB-INF/content/search.jsp trunk/src/main/webapp/css/main.css Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/pom.xml 2011-08-25 09:42:26 UTC (rev 242) @@ -90,6 +90,13 @@ <artifactId>tika-core</artifactId> <version>0.9</version> </dependency> + + <dependency> + <groupId>org.apache.shiro</groupId> + <artifactId>shiro-core</artifactId> + <version>1.1.0</version> + </dependency> + <dependency> Added: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java (rev 0) +++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java 2011-08-25 09:42:26 UTC (rev 242) @@ -0,0 +1,71 @@ +/* + * #%L + * ScmWebEditor + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program 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 3 of the + * License, or (at your option) any later version. + * + * This program 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 General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package org.nuiton.scmwebeditor; + +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.util.ApplicationConfig; +import org.nuiton.util.ArgumentsParserException; + +public class ScmWebEditorConfig extends ScmWebEditorConfigOption { + + private static final Log log = LogFactory.getLog(ScmWebEditorConfig.class); + + + protected static ApplicationConfig config; + + + public static ApplicationConfig getConfig() { + if(config==null) { + synchronized (ScmWebEditorConfig.class) { + if(config==null) { + config = new ApplicationConfig(PROPERTIESFILES); + try { + config.parse(); + } catch (ArgumentsParserException e) { + if(log.isErrorEnabled()) { + log.error("Error when parsing ApplicationConfig",e); + } + } + } + } + } + return config; + } + + public static List<String> getEditableFiles() { + getConfig(); + return config.getOptionAsList(EDITABLESFILES).getOption(); + } + + public static String getKey() { + getConfig(); + return config.getOption(KEY); + } + + +} Added: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java (rev 0) +++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java 2011-08-25 09:42:26 UTC (rev 242) @@ -0,0 +1,47 @@ +/* + * #%L + * ScmWebEditor + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program 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 3 of the + * License, or (at your option) any later version. + * + * This program 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 General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package org.nuiton.scmwebeditor; + +public class ScmWebEditorConfigOption { + + /** + * Nom du fichier de configuration + */ + protected static final String PROPERTIESFILES = "scmwebeditor.properties"; + + /** + * propriété contenant la liste des fichiers éditables + */ + protected static final String EDITABLESFILES = "editableFiles"; + + /** + * Propriété contenant la clé + */ + protected static final String KEY = "key"; + + + + +} Modified: trunk/src/main/java/org/nuiton/scmwebeditor/SvnConnection.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/SvnConnection.java 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/java/org/nuiton/scmwebeditor/SvnConnection.java 2011-08-25 09:42:26 UTC (rev 242) @@ -24,7 +24,6 @@ */ package org.nuiton.scmwebeditor; -import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.util.FileUtil; @@ -178,7 +177,7 @@ SVNDiffClient diffClient = new SVNDiffClient(getManager(), getSvnOption()); - FileUtils.writeStringToFile(pathToFile, text); + FileUtil.writeString(pathToFile, text, "UTF-8"); ByteArrayOutputStream diff = new ByteArrayOutputStream(); @@ -204,7 +203,7 @@ SVNDiffClient diffClient = new SVNDiffClient(getManager(), getSvnOption()); - FileUtils.writeStringToFile(pathToFile, text); + FileUtil.writeString(pathToFile, text, "UTF-8"); ByteArrayOutputStream diff = new ByteArrayOutputStream(); Added: trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java (rev 0) +++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java 2011-08-25 09:42:26 UTC (rev 242) @@ -0,0 +1,100 @@ +/* + * #%L + * ScmWebEditor + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2011 CodeLutin + * %% + * This program 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 3 of the + * License, or (at your option) any later version. + * + * This program 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 General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +package org.nuiton.scmwebeditor.actions; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.struts2.interceptor.ServletRequestAware; +import org.apache.struts2.interceptor.ServletResponseAware; +import org.nuiton.scmwebeditor.ScmWebEditorBaseAction; +import org.nuiton.scmwebeditor.SvnConnection; + +import com.opensymphony.xwork2.Action; + +public class LogoutAction extends ScmWebEditorBaseAction implements ServletRequestAware, ServletResponseAware { + + private static final long serialVersionUID = 6937086747942656369L; + + private static final Log log = LogFactory.getLog(LogoutAction.class); + + protected String address; + + protected HttpServletRequest request; + protected HttpServletResponse response; + + + public void setAddress(String address) { + this.address = address; + } + + public String getAddress() { + return address; + } + + + public String execute() { + + SvnConnection svnConn = new SvnConnection(address); + + //Si le repo n'est pas protege en ecriture on recupere sont UUID + String repositoryUUID = svnConn.getUUID(); + if (repositoryUUID==null) { + repositoryUUID=address; + } + + //suppression des cookies pour ce dépot + for (Cookie c : request.getCookies()) { + if(c.getName().equals(repositoryUUID)) { + c.setMaxAge(0);//On supprime le cookie + response.addCookie(c); + if(log.isDebugEnabled()) { + log.debug("Cookie supprimé"); + } + } + } + + //Suppression des identifiants stockés en session + getScmSession().delScmUser(repositoryUUID); + + + return Action.SUCCESS; + } + + + @Override + public void setServletRequest(HttpServletRequest request) { + this.request=request; + } + + @Override + public void setServletResponse(HttpServletResponse response) { + this.response=response; + } + +} Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/SaveAction.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/actions/SaveAction.java 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/SaveAction.java 2011-08-25 09:42:26 UTC (rev 242) @@ -57,9 +57,6 @@ } - /** - * - */ private static final long serialVersionUID = -115627369699637253L; Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorCommitAction.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorCommitAction.java 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorCommitAction.java 2011-08-25 09:42:26 UTC (rev 242) @@ -29,28 +29,33 @@ import java.io.FileNotFoundException; import java.io.IOException; +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.shiro.codec.Base64; +import org.apache.shiro.crypto.BlowfishCipherService; import org.apache.struts2.interceptor.ServletRequestAware; +import org.apache.struts2.interceptor.ServletResponseAware; import org.nuiton.jrst.JRST; import org.nuiton.scmwebeditor.ScmWebEditorBaseAction; +import org.nuiton.scmwebeditor.ScmWebEditorConfig; import org.nuiton.scmwebeditor.SvnConnection; +import org.nuiton.util.FileUtil; import org.tmatesoft.svn.core.SVNAuthenticationException; import org.tmatesoft.svn.core.SVNDepth; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.wc.SVNCommitClient; - - import com.opensymphony.xwork2.Action; -public class ScmWebEditorCommitAction extends ScmWebEditorBaseAction implements ServletRequestAware { +public class ScmWebEditorCommitAction extends ScmWebEditorBaseAction implements ServletRequestAware, ServletResponseAware { /** * */ @@ -71,15 +76,12 @@ protected String headCommiter; protected boolean force; + protected boolean saveCookie; protected String numRevision; - - - - - protected HttpServletRequest request; + protected HttpServletResponse response; public String getCommitMessage() { return commitMessage; @@ -174,7 +176,15 @@ public String getHeadCommiter() { return headCommiter; } + + public boolean isSaveCookie() { + return saveCookie; + } + public void setSaveCookie(boolean saveCookie) { + this.saveCookie = saveCookie; + } + protected boolean isRstValid(String newText) { try { JRST.generate(JRST.TYPE_HTML, newText); @@ -196,6 +206,8 @@ public String execute() { + System.setProperty("file.encoding", "UTF-8"); + if(!force) { if(format.equals("rst")) { if(!isRstValid(newText)) { @@ -227,6 +239,47 @@ repositoryUUID=address; } + + /* + * Lecture du cookie + */ + String usernamepwCookie = null; + // lire cookies + + BlowfishCipherService bf = new BlowfishCipherService(); + + byte[] privateKey = Base64.decode(ScmWebEditorConfig.getKey()); + + for(Cookie c : request.getCookies()) { + if (c.getName().equals(repositoryUUID)) + usernamepwCookie= c.getValue(); + } + + + + if(usernamepwCookie!=null) { + + String usernameDecode = new String( bf.decrypt(Base64.decode(usernamepwCookie), privateKey).getBytes() ); + String[] resCookie = usernameDecode.split(","); + if (resCookie.length==2) { + username=resCookie[0]; + pw=resCookie[1]; + } + } + + if(saveCookie) { + if(username!=null && pw!=null) { + Cookie authCookie = new Cookie( repositoryUUID , bf.encrypt( (username+","+pw).getBytes() , privateKey ).toBase64() ); + authCookie.setMaxAge(60*60*24*365); + response.addCookie(authCookie); + } + + } + + + /* + * Recuperation des informations d'authentification dans la session + */ if( ( login==null || login.equals("") ) && ( password==null || password.equals("") ) ) { if(getScmSession().getUsername(repositoryUUID)!=null && getScmSession().getPassword(repositoryUUID)!=null) { //On recupère les identifiants en session @@ -353,30 +406,31 @@ File pathToFile = new File(checkoutdir, svnConn.getFileName()); + try { - FileUtils.writeStringToFile(pathToFile, newText); + FileUtil.writeString(pathToFile, newText, "UTF-8"); } catch (IOException e1) { delTempDirectory(checkoutdir); return "error"; } + File[] tabFile = new File[1]; tabFile[0] = pathToFile; - - + try { if(log.isDebugEnabled()) { log.debug("Try to commit"); } - commitClient.doCommit(tabFile, false, "From scmwebeditor -- "+commitMessage, null, null, false, true, SVNDepth.FILES); + commitClient.doCommit(tabFile, false, "From scmwebeditor -- "+commitMessage, null, null, false, false, SVNDepth.FILES); } catch (SVNAuthenticationException authexep) { if(log.isErrorEnabled()) { log.error("AUTH FAIL"); } // if authentication failed edition page is reload form user's relogin - request.setAttribute("address", address); + request.setAttribute(PARAMETER_ADDRESS, address); request.setAttribute(ATTRIBUTE_ORIG_TEXT, StringEscapeUtils.escapeHtml(newText)); @@ -430,4 +484,9 @@ this.request = request; } + @Override + public void setServletResponse(HttpServletResponse response) { + this.response = response; + } + } Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-08-25 09:42:26 UTC (rev 242) @@ -32,25 +32,28 @@ import java.util.Map; import java.util.Map.Entry; +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.shiro.codec.Base64; +import org.apache.shiro.crypto.BlowfishCipherService; import org.apache.struts2.interceptor.ServletRequestAware; +import org.apache.struts2.interceptor.ServletResponseAware; import org.nuiton.scmwebeditor.ScmWebEditorBaseAction; +import org.nuiton.scmwebeditor.ScmWebEditorConfig; import org.nuiton.scmwebeditor.SvnConnection; import org.nuiton.scmwebeditor.urlResolver.ScmUrlResolverEngine; -import org.nuiton.util.ApplicationConfig; -import org.nuiton.util.ArgumentsParserException; import org.tmatesoft.svn.core.SVNAuthenticationException; import org.tmatesoft.svn.core.SVNException; import com.opensymphony.xwork2.Action; -public class ScmWebEditorMainAction extends ScmWebEditorBaseAction implements ServletRequestAware { +public class ScmWebEditorMainAction extends ScmWebEditorBaseAction implements ServletRequestAware, ServletResponseAware { private static final long serialVersionUID = 8361035067228171624L; @@ -189,8 +192,7 @@ * @return */ public String execute() { - - + if(log.isDebugEnabled()) { log.debug("Connection to SCMWebEditor\n"); } @@ -285,7 +287,45 @@ } + /* + * Lecture du cookie + */ + + + String usernamepwCookie = null; + // lire cookies + + BlowfishCipherService bf = new BlowfishCipherService(); + + byte[] privateKey = Base64.decode(ScmWebEditorConfig.getKey()); + + for(Cookie c : request.getCookies()) { + if (c.getName().equals(repositoryUUID)) + usernamepwCookie= c.getValue(); + } + if(usernamepwCookie!=null) { + + String usernameDecode = new String( bf.decrypt(Base64.decode(usernamepwCookie), privateKey).getBytes() ); + + String[] resCookie = usernameDecode.split(","); + if (resCookie.length==2) { + username=resCookie[0]; + pw=resCookie[1]; + } + } + + if(saveCookie) { + if(username!=null && pw!=null) { + + Cookie authCookie = new Cookie( repositoryUUID , bf.encrypt( (username+","+pw).getBytes() , privateKey ).toBase64() ); + authCookie.setMaxAge(60*60*24*365); + response.addCookie(authCookie); + } + + } + + /* * Récuperation des informations en session */ @@ -325,6 +365,17 @@ log.debug("Auth Fail " ,authexep); } + //suppression des cookies pour ce dépot + for (Cookie c : request.getCookies()) { + if(c.getName().equals(repositoryUUID)) { + c.setMaxAge(0);//On supprime le cookie + response.addCookie(c); + if(log.isDebugEnabled()) { + log.debug("Cookie supprimé"); + } + } + } + getScmSession().delScmUser(repositoryUUID); //redirect to a login page return Action.LOGIN; @@ -361,22 +412,14 @@ - ApplicationConfig config = new ApplicationConfig(PROPERTIESFILES); - LinkedList<String> editableFiles = new LinkedList<String>(); editableFiles.add("text"); editableFiles.add("xml"); editableFiles.add("x-java"); - try { - config.parse(); - editableFiles.addAll(config.getOptionAsList(EDITABLESFILES).getOption()); - } catch (ArgumentsParserException eee) { - if(log.isErrorEnabled()) { - log.error("Can't read properties file", eee ); - } - } + editableFiles.addAll(ScmWebEditorConfig.getEditableFiles()); + boolean editable =false; @@ -427,8 +470,11 @@ } + @Override + public void setServletResponse(HttpServletResponse response) { + this.response = response; + } - } Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java 2011-08-25 09:42:26 UTC (rev 242) @@ -268,10 +268,7 @@ -// //On test si le chemin commence par un / si non, on l'ajoute -// if(!svnPath.startsWith("/")) { -// svnPath="/"+svnPath; -// } + //On test si le chemin se termine par un / si non, on l'ajoute if(!svnPath.endsWith("/")) { svnPath+=("/"); Modified: trunk/src/main/resources/scmwebeditor.properties =================================================================== --- trunk/src/main/resources/scmwebeditor.properties 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/resources/scmwebeditor.properties 2011-08-25 09:42:26 UTC (rev 242) @@ -22,4 +22,5 @@ # <http://www.gnu.org/licenses/lgpl-3.0.html>. # #L% ### -editableFiles=text,xml,javascript,sh,x-tex,x-java \ No newline at end of file +editableFiles=text,xml,javascript,sh,x-tex,x-java +key=ZvcCyhfRTVZoQz3B/IpYdw== \ No newline at end of file Modified: trunk/src/main/resources/struts.xml =================================================================== --- trunk/src/main/resources/struts.xml 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/resources/struts.xml 2011-08-25 09:42:26 UTC (rev 242) @@ -66,6 +66,10 @@ <result name="errorPath">/WEB-INF/content/reset.jsp</result> </action> + <action name="logout" class="org.nuiton.scmwebeditor.actions.LogoutAction" > + <result>/WEB-INF/content/logout.jsp</result> + </action> + <action name="doUpload" class="org.nuiton.scmwebeditor.actions.UploadAction" > <result>/WEB-INF/content/uploadSuccess.jsp</result> <result name="redirect" >/WEB-INF/content/uploadForm.jsp</result> Added: trunk/src/main/webapp/WEB-INF/content/logout.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/logout.jsp (rev 0) +++ trunk/src/main/webapp/WEB-INF/content/logout.jsp 2011-08-25 09:42:26 UTC (rev 242) @@ -0,0 +1,46 @@ +<%-- + #%L + ScmWebEditor + + $Id$ + $HeadURL$ + %% + Copyright (C) 2009 - 2011 CodeLutin + %% + This program 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 3 of the + License, or (at your option) any later version. + + This program 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 General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + <%@ taglib prefix="s" uri="/struts-tags"%> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> + +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>Logout...</title> +<link rel="icon" href="img/ScmWebEditor_little.png" type="image/png"> +<link rel="stylesheet" type="text/css" href="css/main.css"> + +<meta http-equiv="Refresh" content="0;URL=checkout.action?address=<%=request.getAttribute("address")%>"> + +</head> +<body> +<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a> + +<p>Logout... <a href="checkout.action?address=<%=request.getAttribute("address")%>"> <s:text name="scm.clickHere" /> </a>.</p> +<p>©2004-2009 CodeLutin</p> +</body> +</html> \ No newline at end of file Modified: trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-25 09:42:26 UTC (rev 242) @@ -108,10 +108,26 @@ <s:textfield accesskey="U" size="12" label="%{scm.username}" name="username" title="%{scm.usernameTitle}" /> <s:password accesskey="P" size="12" label="%{scm.password}" name="pw" title="%{scm.passwordTitle}" /> - + <input type="checkbox" name="saveCookie" value="true" >Rester connecté </s:if> <s:else > - <s:text name="scm.logAs" /> <s:property value="username" /> <br/> + + <s:set id="addressDeco"> + <s:property value="address"/> + </s:set> + <s:a + id="logout" + href="logout.action?address=%{addressDeco}" + title="Logout" + > + <div id="logoutButton" ></div> + </s:a> + + <s:text name="scm.logAs" /> <s:property value="username" /> + + + + <br/> </s:else> <div id="htmlcontentCommit"> @@ -134,7 +150,7 @@ </s:set> <s:submit value="commit" - title="%{scm.saveAndQuitTitle}" + title="Deconnexion" name="Save" /> </noscript> @@ -274,7 +290,7 @@ <s:text name="scm.FileInEditor"/><a href="<%=request.getAttribute("address")%>" ><%=request.getAttribute("address")%></a> <s:text name="scm.atRevision"/> <span id="numrevisionDiv"><s:property value="numRevision" /></span> </p> - <textarea id="newTextId" rows="50" cols="80" name="newText"><%=valueTextarea%></textarea> + <textarea id="newTextId" rows="50" cols="80" name="newText" ><%=valueTextarea%></textarea> Modified: trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp 2011-08-25 09:42:26 UTC (rev 242) @@ -53,9 +53,12 @@ <p><label ACCESSKEY=U><s:text name="scm.username" /> : <input TYPE=text NAME=username SIZE=12></label> <label ACCESSKEY=P><s:text name="scm.password" /> : <input - TYPE=password NAME=pw SIZE=12></label></p> + TYPE=password NAME=pw SIZE=12></label> + <input type="checkbox" name="saveCookie" value="true" >Rester connecté + </p> + <input type="submit" name="Save" /> Modified: trunk/src/main/webapp/WEB-INF/content/search.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/search.jsp 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/webapp/WEB-INF/content/search.jsp 2011-08-25 09:42:26 UTC (rev 242) @@ -61,7 +61,7 @@ jstreetheme="classic" href="%{searchTreeUrl}" onClickTopics="treeClicked" - /> + /> </div> Modified: trunk/src/main/webapp/css/main.css =================================================================== --- trunk/src/main/webapp/css/main.css 2011-08-24 15:27:19 UTC (rev 241) +++ trunk/src/main/webapp/css/main.css 2011-08-25 09:42:26 UTC (rev 242) @@ -136,7 +136,7 @@ margin:0; background-image:url("../img/editor/post-it.png"); background-repeat:no-repeat; - width:460px; + width:468px; height:190px; } @@ -145,7 +145,7 @@ float:right; margin-right:30px; text-align:center; - width:261px; + width:270px; } #htmlcontentCommit { @@ -219,6 +219,16 @@ background-image:url("../img/editor/shut-down-hover.png"); } +#logoutButton { + float:right; + background-image:url("../img/editor/shut-down-hover.png"); + background-repeat:no-repeat; + height:33px; + width:33px; + background-position: 0px -4px; +} + + /* END Button */ #editorTitle {