[pubcookie-dev] Re: Custom App Messages
Jon Miner
miner at doit.wisc.edu
Thu May 19 14:46:08 PDT 2005
* Nathan Dors (dors at cac.washington.edu) [050519 12:47]:
> There's no requesting app in the pinit case, so isn't inserting
> the login_pinit template as the reason-you-were-sent-here text
> sufficient?
Yeah, that's probably true. Didn't think of that for some reason.
> >In any case, the situations where the app messages are displayed and not
> >displayed is something that we will never all agree on.. How about
> >making it configurable? Just create a config option (say,
> >"display_no_app_message") that takes a list of "reasons" (the C
> >constants? something else?) for which the app message shouldn't be
> >displayed.
>
> The cheap route is to try to come to an acceptable consensus on
> the display of messages; it can't be that hard, right?
>
> But I think the configureable approach you describe is optimal and
> I'd be willing to try to find someone to implement it that way.
>
> Any volunteers in the Wisconsin camp?
Here's a patch, which creates new options for the config file of
"custom_login_CONSTANT" and "show_reason_CONSTANT" to turn on and off
the custom login pages for the various "reasons" and to show the
%reason% on the page for various "reasons" (I know, confusing.)
The CONSTANTs for the resons are:
FLB_BAD_AUTH
FLB_REAUTH
FLB_LCOOKIE_ERROR
FLB_CACHE_CREDS_WRONG
FLB_PINIT
FLB_LCOOKIE_EXPIRED
FLB_FORM_EXPIRED
The defaults in the patch that made sense to us (which is up for
debate, of course):
|custom login | show reason|
-------------------------------------------------|
FLB_BAD_AUTH | true | true |
FLB_REAUTH | true | true |
FLB_LCOOKIE_ERROR | true | false |
FLB_CACHE_CREDS_WRONG | true | true |
FLB_PINIT | true | true |
FLB_LCOOKIE_EXPIRED | true | true |
FLB_FORM_EXPIRED | true | true |
--------------------------------------------------
The only case where we didn't like %reason% displaying on the page was
FLB_LCOOKIE_ERROR, which is generally the case where they just haven't
logged in yet..
We also specifically liked having the custom app login components
display for every visit, as it helps our users (and applications) keep
things straight..
Thoughts? Comments?
jon
--
.Jonathan J. Miner------------------Division of Information Technology.
|miner at doit.wisc.edu University Of Wisconsin - Madison|
|608/262.9655 Room 3146 Computer Science|
`---------------------------------------------------------------------'
"What difference does it make to the dead, the orphans and the homeless,
whether the mad destruction is wrought under the name of
totalitarianism or the holy name of liberty or democracy?"
- Mahatma Gandhi in _Non-Violence_in_Peace_and_War_
(311/708)
-------------- next part --------------
--- pubcookie-3.2.0/src/flavor_basic.c 2005-01-21 16:43:46.000000000 -0600
+++ pubcookie-3.2.0-mst/src/flavor_basic.c 2005-05-19 16:42:16.000000000 -0500
@@ -410,8 +411,22 @@
else
use the traditional reason text
*/
- if (reason == FLB_REAUTH || reason == FLB_CACHE_CREDS_WRONG ||
- reason == FLB_LCOOKIE_EXPIRED || reason == FLB_LCOOKIE_ERROR)
+
+#define checkreason_true(a,b) ( libpbc_config_getswitch(p, a, 1) && reason == b )
+#define checkreason_false(a,b) ( libpbc_config_getswitch(p, a, 0) && reason == b )
+
+ if (checkreason_true ("custom_login_FLB_BAD_AUTH", FLB_BAD_AUTH)
+ || checkreason_true ("custom_login_FLB_REAUTH", FLB_REAUTH)
+ || checkreason_true ("custom_login_FLB_LCOOKIE_ERROR",
+ FLB_LCOOKIE_ERROR)
+ || checkreason_true ("custom_login_FLB_CACHE_CREDS_WRONG",
+ FLB_CACHE_CREDS_WRONG)
+ || checkreason_true ("custom_login_FLB_PINIT", FLB_PINIT)
+ || checkreason_true ("custom_login_FLB_LCOOKIE_EXPIRED",
+ FLB_LCOOKIE_EXPIRED)
+ || checkreason_true ("custom_login_FLB_FORM_EXPIRED",
+ FLB_FORM_EXPIRED)
+ )
if ((ret = get_custom_login_msg (p, l->appid,
l->appsrvid,
&login_msg)) == PBC_FAIL)
@@ -421,7 +436,19 @@
in the case of expired login messages we use both the
the custom message (itis) and the lcookie expired message
*/
- if (login_msg == NULL || reason == FLB_LCOOKIE_EXPIRED)
+ if (login_msg == NULL
+ || checkreason_true ("show_reason_FLB_BAD_AUTH", FLB_BAD_AUTH)
+ || checkreason_true ("show_reason_FLB_REAUTH", FLB_REAUTH)
+ || checkreason_false ("show_reason_FLB_LCOOKIE_ERROR",
+ FLB_LCOOKIE_ERROR)
+ || checkreason_true ("show_reason_FLB_CACHE_CREDS_WRONG",
+ FLB_CACHE_CREDS_WRONG)
+ || checkreason_true ("show_reason_FLB_PINIT", FLB_PINIT)
+ || checkreason_true ("show_reason_FLB_LCOOKIE_EXPIRED",
+ FLB_LCOOKIE_EXPIRED)
+ || checkreason_true ("show_reason_FLB_FORM_EXPIRED",
+ FLB_FORM_EXPIRED)
+ )
if ((ret =
get_reason_html (p, reason, l, c, &reason_msg)) == PBC_FAIL)
goto done;
More information about the pubcookie-dev
mailing list