[Nmrshiftdb-devel] CVS: nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets ResultPortlet.java
Brought to you by:
steinbeck
|
From: Stefan K. <sh...@us...> - 2006-11-09 14:43:54
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19751/src/java/org/openscience/nmrshiftdb/portlets Modified Files: ResultPortlet.java Log Message: submits of h spectra also possible with h shifts assigned to heavy atoms Index: ResultPortlet.java =================================================================== RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/ResultPortlet.java,v retrieving revision 1.285 retrieving revision 1.286 diff -C2 -r1.285 -r1.286 *** ResultPortlet.java 18 Oct 2006 13:07:27 -0000 1.285 --- ResultPortlet.java 9 Nov 2006 14:43:42 -0000 1.286 *************** *** 21,24 **** --- 21,26 ---- import org.apache.jetspeed.portal.portlets.AbstractPortlet; import org.apache.turbine.om.NumberKey; + import org.apache.turbine.om.security.User; + import org.apache.turbine.services.security.TurbineSecurity; import org.apache.turbine.util.Log; import org.apache.turbine.util.RunData; *************** *** 114,117 **** --- 116,151 ---- } } + if(action.equals("submitfromlabjournal")){ + try{ + String username = runData.getParameters().get("username"); + String password = runData.getParameters().get("password"); + User user = null; + // Authenticate the user and get the object. + user = TurbineSecurity.getAuthenticatedUser(username, password); + + + // Store the user object. + runData.setUser(user); + + // Mark the user as being logged in. + user.setHasLoggedIn(new Boolean(true)); + + // Set the last_login date in the database. + user.updateLastLogin(); + + // This only happens if the user is valid; otherwise, we + // will get a valueBound in the User object when we don't + // want to because the username is not set yet. Save the + // User object into the session. + runData.save(); + //this.doSubmitorder(data, context); + + runData.getResponse().sendError(302,"www.web.de"); + }catch(Exception ex){ + ex.printStackTrace(); + } + + return(new StringElement("<head><meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=http://www.yourdomain.com/index.html/"+runData.getSession().getId()+"\"></head><a href=\"\">If you are not redirected, please click here</a>")); + } //The molecule displaying starts with 0 if new search int startMolecule = 0; |