[opencms-dev] Users info

Robert Petermeier robert2.0 at gmx.de
Mon Feb 21 20:57:19 CET 2005


Moro Álvarez schrieb:
> Hello, I want to know the name of the user that locked a resources, and I´ve this:
>  
> int userId = res.isLockedBy();
> String username=??
>  
> How I get the username, by userid?

Let's see, you have a CmsResource res and a CmsObject cmso so this line 
should do it:

String userName =
     cmso.readUser(cmso.getLock(res).getUserId()).getName();

See
<http://www.codedroids.com/javadocs/opencms/build_5_5_4/docs/api/index.html>


Bye,
Robert



More information about the opencms-dev mailing list