[opencms-dev] change user last modified
bub habub
japorami at yahoo.com
Mon Jul 18 14:18:20 CEST 2005
hi,
i try to create a file and then i want to change the
user last modified at the end. but when i then lock a
the user last modified it shows admin even though i
got the id of another user.
i'm trying to solve this problem already for three
days and slowly cannot concentrate. any help would be
wonderful.
here is my code.
<%@ page import="org.opencms.file.*,
org.opencms.file.collectors.*, java.util.*,
org.opencms.jsp.*, org.opencms.flex.*,
org.opencms.util.CmsUUID" %>
<%@ taglib prefix="cms"
uri="http://www.opencms.org/taglib/cms" %>
<%
CmsJspActionElement cms = new
CmsJspActionElement(pageContext, request, response);
CmsObject cmsobject =
CmsFlexController.getCmsObject(request);
String uname = request.getParameter("uname");
out.println(uname);
CmsUser user = cmsobject.readUser(uname);
CmsUUID userid = user.getId();
//outprintln(userid);
String destination =
"/system/modules/com.authentication/elements/";
String title = request.getParameter("title");
out.println(title);
String vfs = "/default/vfs" ;
String internalfilename = destination + title;
out.println(internalfilename);
int filetype = 1 ; //request.getParameter("type");
boolean exists;
if(cmsobject.existsResource(internalfilename))
{
//????, redirect to page with error explanation
out.println("big error" +""+ title);
}
else
{
cmsobject.copyResource("/system/modules/com.authentication/elements/registration_form.html",internalfilename,
CmsResource.COPY_AS_NEW);
String resourcename =
CmsResource.getName(internalfilename);
out.println(resourcename + "" + "===" +
internalfilename);
cmsobject.lockResource(internalfilename);
CmsFile myfile =
cmsobject.readFile(internalfilename);
myfile.setUserLastModified(userid);
cmsobject.writeFile(myfile);
cmsobject.unlockResource(internalfilename);
cmsobject.publishResource(internalfilename);
// redirect to the same file
}
%>
thanks a lot for ur help
jap
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
More information about the opencms-dev
mailing list