[pubcookie-dev]
WEBISO CVS update: willey; webiso/pubcookie/src flavor_basic.c,1.37,1.38
Stephen Willey
willey at cac.washington.edu
Wed May 14 16:45:35 PDT 2003
Update of /usr/local/cvsroot/webiso/pubcookie/src
In directory webiso-cvs.cac.washington.edu:/var/tmp/cvs-serv6844
Modified Files:
flavor_basic.c
Log Message:
Made user field static on reauths
Index: webiso/pubcookie/src/flavor_basic.c
diff -c webiso/pubcookie/src/flavor_basic.c:1.37 webiso/pubcookie/src/flavor_basic.c:1.38
*** webiso/pubcookie/src/flavor_basic.c:1.37 Tue May 6 16:51:19 2003
--- webiso/pubcookie/src/flavor_basic.c Wed May 14 16:45:33 2003
***************
*** 14,20 ****
*/
/*
! $Id: flavor_basic.c,v 1.37 2003/05/06 23:51:19 willey Exp $
*/
#ifdef HAVE_CONFIG_H
--- 14,20 ----
*/
/*
! $Id: flavor_basic.c,v 1.38 2003/05/14 23:45:33 willey Exp $
*/
#ifdef HAVE_CONFIG_H
***************
*** 199,204 ****
--- 199,205 ----
char * reason_html = NULL;
char now[64];
+ char user_field[PBC_1K];
pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE, "print_login_page: hello");
***************
*** 347,359 ****
snprintf(now, sizeof(now), "%d", time(NULL));
/* Display the login form. */
ntmpl_print_html(p, TMPL_FNAME,
! libpbc_config_getstring(p, "tmpl_login",
! "login"),
"loginuri", PBC_LOGIN_URI,
"message", reason_html != NULL ? reason_html : "",
! "user", l->user ? l->user : "",
"curtime", now,
"hiddenfields", hidden_fields,
"getcredhidden", getcred_hidden != NULL ? getcred_hidden : "",
--- 348,378 ----
snprintf(now, sizeof(now), "%d", time(NULL));
+ /* if it's a reauth then the user field can't be changed */
+ if ( reason == FLB_REAUTH && l->user != NULL ) {
+ snprintf(user_field, sizeof(user_field), "%s%s%s%s%s%s%s%s",
+ "<span style=\"background: #eeeeee; color:black\"><tt>",
+ l->user,
+ "</tt></span>\n",
+ "<INPUT TYPE=\"hidden\" NAME=\"",
+ "user",
+ "\" VALUE=\"",
+ l->user,
+ "\">\n");
+ }
+ else {
+ char *u = l->user != NULL ? l->user : (c != NULL ? c->user: NULL);
+
+ snprintf(user_field, sizeof(user_field), "<INPUT TYPE=\"text\" NAME=\"user\" SIZE=\"20\" VALUE=\"%s\">", u != NULL ? u : "");
+ }
+
+
/* Display the login form. */
ntmpl_print_html(p, TMPL_FNAME,
! libpbc_config_getstring(p, "tmpl_login", "login"),
"loginuri", PBC_LOGIN_URI,
"message", reason_html != NULL ? reason_html : "",
! "user_field", user_field,
"curtime", now,
"hiddenfields", hidden_fields,
"getcredhidden", getcred_hidden != NULL ? getcred_hidden : "",
end of message
More information about the pubcookie-dev
mailing list