Author: kcardineaud Date: 2011-07-29 11:16:22 +0200 (Fri, 29 Jul 2011) New Revision: 193 Url: http://nuiton.org/repositories/revision/scmwebeditor/193 Log: Change some authentification system Modified: trunk/src/main/java/org/nuiton/scmwebeditor/SvnSession.java trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp Modified: trunk/src/main/java/org/nuiton/scmwebeditor/SvnSession.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/SvnSession.java 2011-07-28 15:01:30 UTC (rev 192) +++ trunk/src/main/java/org/nuiton/scmwebeditor/SvnSession.java 2011-07-29 09:16:22 UTC (rev 193) @@ -103,8 +103,6 @@ String svnPath, String fileName, String projectUrl, - String login, - String password, String id, String format, StringBuffer scmEditorUrl) { @@ -114,33 +112,18 @@ this.svnPath = svnPath; this.fileName = fileName; this.projectUrl = projectUrl; - this.login = login; - this.password = password; -// try { -// this.checkoutdir = FileUtil.createTempDirectory("scm_", ""); -// } catch (IOException e) { -// e.printStackTrace(); -// } + log.info(login+" "+password); try { this.remoteUrl = SVNURL.parseURIEncoded(svnPath); } catch (SVNException e) { log.debug("SVNSESS NULL"); } - this.authManager = SVNWCUtil.createDefaultAuthenticationManager(this.checkoutdir, this.login, this.password, false); - this.svnOption = SVNWCUtil.createDefaultOptions(this.checkoutdir, false); + this.authManager = SVNWCUtil.createDefaultAuthenticationManager(); + this.svnOption = SVNWCUtil.createDefaultOptions(false); this.svnOption.setPropertyValue(SVNProperty.EOL_STYLE, SVNProperty.EOL_STYLE_LF); this.manager = SVNClientManager.newInstance(this.svnOption, this.authManager); } - /** - * Delete checkout directory. - * - * @throws IOException if any io pb - */ -// public void cleanCheckoutDir() throws IOException { -// FileUtils.deleteDirectory(getCheckoutdir()); -// } - public void updateAuthentication(String login, String password) { setLogin(login); setPassword(password); Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-07-28 15:01:30 UTC (rev 192) +++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-07-29 09:16:22 UTC (rev 193) @@ -142,35 +142,23 @@ - String tmp_log = null; - String tmp_pass = null; - svnSess = new SvnSession( relativePath, scmFileName, projectUrl, - tmp_log, - tmp_pass, httpSession.getId(), format, request.getRequestURL()); - svnSess.updateAuthentication( - svnSess.getLogin() != null && !svnSess.getLogin().equalsIgnoreCase("") ? svnSess.getLogin() : username, - svnSess.getPassword() != null && !svnSess.getPassword().equalsIgnoreCase("") ? svnSess.getPassword() : pw); - - + setSvnSession(httpSession, svnSess); - - - String originalText =""; - String login = svnSess.getLogin(); - String pw = svnSess.getPassword(); + String login = this.getUsername(); + String pw = this.getPw(); String url = svnSess.getSvnPath(); String file = svnSess.getFileName(); @@ -178,6 +166,10 @@ login = "anonymous"; pw = "anonymous"; } + else { + svnSess.setLogin(login); + svnSess.setPassword(pw); + } SVNRepository repository = null; Modified: trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-07-28 15:01:30 UTC (rev 192) +++ trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-07-29 09:16:22 UTC (rev 193) @@ -48,7 +48,7 @@ </head> -<body> +<body onload="geresession(<%=request.getAttribute("InvalidateMaxTime")%>, 5);"> <a title="ScmWebEditor Project Website" target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="ScmWebEditor logo"/></a> <center> @@ -121,7 +121,7 @@ <script type="text/javascript"> - function loadChange(){ + function loadChange() { document.getElementById('newTextId').value = editor.mirror.getValue(); } </script>
participants (1)
-
kcardineaud@users.nuiton.org