[opencms-dev] login on published pages of non-editors

bub habub japorami at yahoo.com
Mon Jun 13 07:52:28 CEST 2005


hi alex,

thank you very much for ur answer.
one more question. where do i find all these packages.
somehow i feel that my installation is lacking of some
important modules. 
i'm searching for functionalities that are supposed to
be included but don't find them.
where do i find e.g     
org.opencms.jsp.CmsJspLoginBean?

if i knew what is predefined and what i can use it
would make my life easier. 

thanks 

jap


--- Alexander Wallace <aw at avatartechnology.com> wrote:

> there are multiple ways of doing it... What the book
> sugests is correct, but 
> the package names have changed...  
> 
> Something like this can be used to create the users:
> 
> <%@ page import="" %>
> <%@ page import="org.opencms.file.CmsUser" %>
> <%@ page import="java.util.Hashtable" %>
> (may need to add more here)
> <%
> CmsJspLoginBean cmsLogin = new
> CmsJspLoginBean(pageContext, request, 
> response);
> 
> Hashtable params = new Hashtable();
> params.put("whatever", "someValueOrObject");
> try {
>  user = cmsLogin.getCmsObject().addWebUser(username,
> password, "Guests",     
> "some description", params);
> user.setFirstname("name1");
> user.setLastname("name2");
> cmsLogin.getCmsObject().writeWebUser(user);
> } catch (Exception e) {
>  //FIXME: do something appropiate...
> }
> %>
> Something like this can log you in:
> 
> cmsLogin.login(username, password);
> 
> And you can use cmsLogin.isLoggedIn() combined with
> any other checking you may 
> want to do to decide if you let someone see a page
> by putting this in a 
> template... There are other ways to do this too...
> 
> Hope this helps
> 
> 
> On Friday 10 June 2005 01:38 am, bub habub wrote:
> > hi,
> > 
> > i want to implement a login for some restricted
> aread
> > of my homepage. how can i do that?
> > i read in the open cms book that there are two
> ways to
> > do it?
> > i would like to do it with the built in webuser
> flag
> > concept. but i couldn't find as this concept
> works.
> > 
> > the other method would be an authentication an
> > webserver level but for that i understood that i
> have
> > to configure tomcat. this would be very unhandy
> not
> > having the user configuration in the workplace.
> > 
> > also i would like to have two groups of users one
> with
> > download permission, one just with view
> permission.
> > how can i do that?
> > 
> > thanks a lot
> > 
> > jap 
> > 
> > 
> > 		
> > __________________________________ 
> > Discover Yahoo! 
> > Get on-the-go sports scores, stock quotes, news
> and more. Check it out! 
> > http://discover.yahoo.com/mobile.html
> > 
> > 
> > _______________________________________________
> > 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
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the opencms-dev mailing list