[opencms-dev] opencms6 - logging in a webuser
Stephan Hartmann
hartmann at metamesh.de
Tue Apr 19 11:58:30 CEST 2005
Then,
cmso#loginUser(String, String)
should work.
CmsObject#loginWebUser requires that you set the USER_TYPE value of your
web users in the CMS_USERS table to 2 (There is no interface in the
administration to do this).
bart vandendriessche schrieb:
> Hi Stephan, thanks for the reply.
>
> Initially i did try to use the
> org.opencms.file.CmsObject#loginWebUser(String, String) however, as soon
> as i submit my form using the CmsObject, I get prompted for a username
> and login for access to /opencms/opencms.
> Code is as follows:
>
> //get the required OpenCms Object
> CmsJspActionElement cmsjsp = new CmsJspActionElement(pageContext,
> request, response);
> CmsObject cmso = cmsjsp.getCmsObject();
>
>
> //variables to catch the parameters from the request
> String username = "";
> String password = "";
> String action = request.getParameter("action");
>
> //catch the parameters if the user is trying to log in
> if ( "login".equals(action) ) {
> username = request.getParameter("login");
> action = request.getParameter("password");
>
> //log in the user
> cmso.loginWebUser(username, password);
> }
>
> This has got me well boggled :)
>
> Stephan Hartmann wrote:
>
>> Hi Bart,
>>
>> the CmsJspLoginBean only logs in system users. Instead, you should use
>>
>> org.opencms.file.CmsObject#loginWebUser(String, String)
>>
>> Regards,
>> Stephan
>>
>> bart vandendriessche schrieb:
>>
>>> Hi,
>>>
>>> I've been having some difficulties logging in users that are members
>>> of the Guests group. The requirement is to have several groups of
>>> users that can log in to the online project, but not to the offline
>>> project / workplace so that we can divide content according to
>>> several different guest groups. I've been trying to make a small
>>> login form in which a user can fill out his username / password, but
>>> I must be doing something wrong since I can't seem to log in a guest.
>>> Code is as follows:
>>>
>>> //get the required OpenCms Object
>>> CmsJspLoginBean cmsLogin = new CmsJspLoginBean(pageContext,
>>> request, response);
>>>
>>> //variables to catch the parameters from the request
>>> String username = "";
>>> String password = "";
>>> String action = request.getParameter("action");
>>>
>>> //catch the parameters if the user is trying to log in
>>> if ( "login".equals(action) ) {
>>> username = request.getParameter("login");
>>> action = request.getParameter("password");
>>>
>>> //log in the user
>>> cmsLogin.login(username, password);
>>> }
>>>
>>> If anyone could provide some pointers that would be great,
>>>
>>> -Bart
>>>
>>>
>>> _______________________________________________
>>> This mail is send to you from the opencms-dev mailing list
>>> To change your list options, or to unsubscribe from the list, please
>>> visit
>>> http://mail.opencms.org/mailman/listinfo/opencms-dev
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> This mail is send to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please
>> visit
>> http://mail.opencms.org/mailman/listinfo/opencms-dev
>>
>
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list