Show login, logout and sign on

23 Sep '11, 03:57 AM
16,342 Views
No Forum Badges

Hi folks, I want show a link (landmark) logout just when I am alright logged, OK maybe be easy just checking Protected. The problem is when should it show links (landmark) login or sign on, somebody help me ?

 
x 0
Follow
Answer Answer at this question and get points!
Forum Expert - Level 8

We found that there can be an issue related to the cache of protected modules in the generated Web application. We are currently investigating on it. In the meanwhile you can use a workaround to make things work properly.

In your model, you have to place a Script Unit just before the Login Unit that clears the protected module cache. The Script Unit must include the following code:

import com.webratio.rtx.RTXConstants

sessionContext.remove(RTXConstants.USER_ACCESSIBLE_MODULES_KEY);

sessionContext.remove(RTXConstants.GROUP_ACCESSIBLE_MODULES_KEY);

   
x 1
Forum Expert - Level 8

Hi,

in order to show the Logout item only when the user is logged in, you should use, as you said, the Protected property. Then you have to connect this item (which is a record inside the Module table) to the group representing the registered users (which will be stored in the Group table). The connection can be stored in the "Group_Module" table.

You can use a similar approach for the Sign on item. In fact, WebRatio automatically assigns to guest users the 0 groupoid. This means that you can set the Sign on item as Protected and then connect this module to the group of the "not registered users", which must have the oid set to 0.

 
x 0
No Forum Badges

Unfortunately that didn't work =/, my problem now is just with Sign On link, it's always visible. I don't know how/when the method webratio:isTargetAccessible('page18.link', pageContext) is processed. Ok.. my scene is this:

DATABASE
group   |    group_module    |   module                 |      user
0 UNR   |    0    5          |   5   signon_page        |     0 guest        0
1 UR    |    1    6          |   6   logout_page        |     1 rafaeldobau  null

PAGES
home (landmark, home)
logout (link, landmark, protected, logout_page)
sign on (page, landmark, protected, signon_page)

When I change group_module from (0,5) to (1,5) the sign on visibility works how should, has been visible just when the user is logged. I don't know more what to do =, and really NEED HELP. I tried debug it, but how I said I can't debug the method web ratio:isTargetAccessible to know where is my problem.

Follow the image with my model, it have a lot of debugs stuffs so ignore what isn't important. OBS: Cadastrar == Sign on in portuguese

alt text

 
x 0
Answer at this question and get points!