[opencms-dev] Start with sites from user preferences
Nigel Kersten
nigel at cofa.unsw.edu.au
Fri Jul 14 10:16:28 CEST 2006
On 14/07/2006, at 5:59 PM, maria.freixes_graells at alcatel.es wrote:
> Thanks very much for your attention and your time.
> You're right, this is what I want to do.
> I've been trying it, but I don't know what to do for the actual
> login page: /system/login/index.html
> I want that instead open the Workplace, it redirects to the /sites/
> default/release/welcome.html
> Do you know what's the code?
> Thanks and have a nice day!!
Have a look in your installed documentation at:
/alkacon-documentation/javadoc/core/org/opencms/file/CmsObject.html
--------
public final class CmsObject
extends java.lang.Object
This pivotal class provides all authorized access to the OpenCms VFS
resources.
It encapsulates user identification and permissions. Think of it as
an initialized "shell" to access the OpenCms VFS. Every call to a
method here will be checked for user permissions according to the
CmsRequestContext this CmsObject instance was created with.
From a JSP page running in OpenCms, use CmsJspBean.getCmsObject() to
gain access to the current users CmsObject. Usually this is done with
a CmsJspActionElement.
To generate a new instance of this class in your application, use
OpenCms.initCmsObject(String). The argument String should be the name
of the guest user, usually "Guest" and more formally obtained by
CmsDefaultUsers.getUserGuest(). This will give you an initialized
context with guest user permissions. Then use loginUser(String,
String) to log in the user you want. Obviously you need the password
for the new user. You should never try to create an instance of this
class using the constructor, this is reserved for internal operation
only.
----------
I've used this before to do a login and then redirect to a non-
workplace page.
--
Nigel Kersten [Senior Technical Officer]
College of Fine Arts, University of NSW, Australia.
CRICOS Provider Code: 00098G
More information about the opencms-dev
mailing list