I've run into an odd problem...
I find that I want to be able to programmatically display a different
home page if the user is logged in (i.e., they're a known user), versus
if someone
is not logged in Seems simple enough. However the public pages (home,
about..., contact-us, etc in my site aren't protected by "AUTH_USER" or "
AUTH_ADMIN" rules. So, even after someone logs in, the home page seems
not be able to get the credentials/role of the logged in user. For
example,
trying to use block-value scripting, with OGNL for example, with a
pub.home like:
<r:i name="common.blueprint"/>
<r:i name="common.error_messages"/>
<r:bv name="window_title">Home</r:bv>
<!-- all registered users, incl. admins, are also in the "user" role, so
this should be ok -->
<!--V 'OGNL:ROLEUSER:userrole'/-->
<!--B 'OGNL:ROLEUSER:userrole:[[ isInRole("user") ]]'-->
<r:i name="registered.homepg_content" />
<!--/B-->
<!-- taking a wild guess at how to test if #roles is null ... RIFE
doesn't give me an error, but.. -->
<!--V 'OGNL:ROLEUSER:norole'/-->
<!--B 'OGNL:ROLEUSER:norole:[[ #roles == "" ]]'-->
<r:i name="pub.homepg_content" />
<!--/B-->
or even a custom element like:
public class Home extends Element {
public void processElement() {
Template template;
if (getRequestAttribute(Identified.IDENTITY_ATTRIBUTE_NAME) == null)
template = getHtmlTemplate("pub.home");
else
template = getHtmlTemplate("registered.home");
print(template);
}
}
I am always only getting the non-logged in home page content
What's the best way to make this happen?
David
--
--------------------------------------------------------------------
David HM Spector spector at zeitgeist dot com
New and stirring things are belittled because if they are not
belittled, the humiliating question arises:
'Why then are you not taking part in them?'
--H. G. Wells
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---