[pubcookie-dev] WEBISO CVS update: willey;
webiso/pubcookie/src flavor_basic.c,1.42.2.6,1.42.2.7
Stephen Willey
willey at cac.washington.edu
Tue Dec 9 17:25:00 PST 2003
Update of /usr/local/cvsroot/webiso/pubcookie/src
In directory webiso-cvs.cac.washington.edu:/var/tmp/cvs-serv8196
Modified Files:
Tag: UWash3
flavor_basic.c
Log Message:
new config directive for allowing for retaining the username on failed auths, shuffled around some login form generating code
Index: webiso/pubcookie/src/flavor_basic.c
diff -c webiso/pubcookie/src/flavor_basic.c:1.42.2.6 webiso/pubcookie/src/flavor_basic.c:1.42.2.7
*** webiso/pubcookie/src/flavor_basic.c:1.42.2.6 Thu Nov 20 11:03:26 2003
--- webiso/pubcookie/src/flavor_basic.c Tue Dec 9 17:24:57 2003
***************
*** 13,19 ****
* will pass l->realm to the verifier and append it to the username when
* 'append_realm' is set
*
! * $Id: flavor_basic.c,v 1.42.2.6 2003/11/20 19:03:26 willey Exp $
*/
--- 13,19 ----
* will pass l->realm to the verifier and append it to the username when
* 'append_realm' is set
*
! * $Id: flavor_basic.c,v 1.42.2.7 2003/12/10 01:24:57 willey Exp $
*/
***************
*** 281,320 ****
const char *static_config = libpbc_config_getstring(p, "static_user_field",
STATIC_USER_FIELD_KIND);
char *user_field_html;
- char *user_field_static = flb_get_field_html(p,
- libpbc_config_getstring(p,
- "tmpl_login_user_static",
- "login_user_static" ), loser);
- char *user_field_dynamic = flb_get_field_html(p,
- libpbc_config_getstring(p,
- "tmpl_login_user_form_field",
- "login_user_form_field" ), loser);
if ( strcmp(static_config, STATIC_USER_FIELD_KIND) == 0 ) {
if ( c != NULL && c->user != NULL & reason == FLB_REAUTH ||
c != NULL && c->user != NULL & reason == FLB_CACHE_CREDS_WRONG ||
l->user != NULL && l->ride_free_creds == PBC_BASIC_CRED_ID ) {
! user_field_html = user_field_static;
l->hide_user = PBC_TRUE;
}
else {
! user_field_html = user_field_dynamic;
l->hide_user = PBC_FALSE;
}
}
else if ( strcmp(static_config, STATIC_USER_FIELD_FASCIST) == 0 ) {
if ( c != NULL && c->user != NULL ||
l->user != NULL && l->ride_free_creds == PBC_BASIC_CRED_ID ) {
! user_field_html = user_field_static;
l->hide_user = PBC_TRUE;
}
else {
! user_field_html = user_field_dynamic;
l->hide_user = PBC_FALSE;
}
}
else { /* STATIC_USER_FIELD_NEVER */
! user_field_html = user_field_dynamic;
l->hide_user = PBC_FALSE;
}
--- 281,322 ----
const char *static_config = libpbc_config_getstring(p, "static_user_field",
STATIC_USER_FIELD_KIND);
char *user_field_html;
if ( strcmp(static_config, STATIC_USER_FIELD_KIND) == 0 ) {
if ( c != NULL && c->user != NULL & reason == FLB_REAUTH ||
c != NULL && c->user != NULL & reason == FLB_CACHE_CREDS_WRONG ||
l->user != NULL && l->ride_free_creds == PBC_BASIC_CRED_ID ) {
! user_field_html = flb_get_field_html(p, libpbc_config_getstring(p,
! "tmpl_login_user_static",
! "login_user_static" ), loser);
l->hide_user = PBC_TRUE;
}
else {
! user_field_html = flb_get_field_html(p, libpbc_config_getstring(p,
! "tmpl_login_user_form_field",
! "login_user_form_field" ), loser);
l->hide_user = PBC_FALSE;
}
}
else if ( strcmp(static_config, STATIC_USER_FIELD_FASCIST) == 0 ) {
if ( c != NULL && c->user != NULL ||
l->user != NULL && l->ride_free_creds == PBC_BASIC_CRED_ID ) {
! user_field_html = flb_get_field_html(p, libpbc_config_getstring(p,
! "tmpl_login_user_static",
! "login_user_static" ), loser);
l->hide_user = PBC_TRUE;
}
else {
! user_field_html = flb_get_field_html(p, libpbc_config_getstring(p,
! "tmpl_login_user_form_field",
! "login_user_form_field" ), loser);
l->hide_user = PBC_FALSE;
}
}
else { /* STATIC_USER_FIELD_NEVER */
! user_field_html = flb_get_field_html(p, libpbc_config_getstring(p,
! "tmpl_login_user_form_field",
! "login_user_form_field" ), loser);
l->hide_user = PBC_FALSE;
}
***************
*** 701,707 ****
*errstr);
/* make sure 'l' reflects that */
! l->user = NULL; /* in case wrong username */
print_login_page(p, l, c, FLB_BAD_AUTH);
pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE,
--- 703,712 ----
*errstr);
/* make sure 'l' reflects that */
!
! if ( ! libpbc_config_getswitch(p, "retain_username_on_failed_authn", 0)) {
! l->user = NULL; /* in case wrong username */
! }
print_login_page(p, l, c, FLB_BAD_AUTH);
pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE,
end of message
More information about the pubcookie-dev
mailing list