Hi all,
I apologise if this question has been posted before, but I cannot find
any documentation about "globalvar" on the website or wiki.
>From what I've gathered here and there, it seems that "globalvar"
declares what would be the equivalent of a session variable. So, I'm
thinking of using it as follows for authentication.
Say, I have a "member" page that requires authentication and have
declared "account" as a globalvar.
public class MemberElement extends Element {
public void processElement() {
Template t = getHtmlTemplate("member");
if (getInput("account") == null) {
call("login");
}
print(t);
}
}
public class LoginElement extends Element {
public void processElement() {
Template t = getHtmlTemplate("login");
if (hasSubmission("loginSubmission")) {
// perform authentication logic
if (authenticated) {
setOutput("account", authenticatedAccount);
answer();
}
}
}
}
Is this a good way of handling authentication? Or should I be using
inheritance? If the latter, how do I proceed? I have some difficulty
understanding the examples for authentication as those seem memory- or
database-centric and not applicable for a customised authentication
mechanism.
Thank you.
Eddy
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users