3c23a9154525bbba8f1c429c03328131a6cde688 tdreszer Thu May 9 12:41:49 2013 -0700 Removing cartBooleanTimeout as disappearing cart variables are not really a good idea at this time. diff --git src/hg/lib/cart.c src/hg/lib/cart.c index 2039bb8..f5a79e4 100644 --- src/hg/lib/cart.c +++ src/hg/lib/cart.c @@ -1135,61 +1135,30 @@ { if (cgiBooleanDefined(var)) return cgiBoolean(var); if (cart != NULL) return cgiBoolean(var) || cartUsualBoolean(cart, var, usual); return(usual); } void cartSetBoolean(struct cart *cart, char *var, boolean val) /* Set boolean value. */ { // Be explicit because some cartBools overloaded with negative "disabled" values cartSetInt(cart,var,(val?1:0)); } -boolean cartTimeoutBoolean(struct cart *cart, char *var, int hours) -// Returns true if a cart var was set to non-zero less than hours ago -// If the var has expired or val=0, it will be deleted. -// If val is non-zero and not a time_t, (e.g. 'set') then the timer is started. -{ -char *s = cartOptionalString(cart, var); -if (s == NULL) - return FALSE; -if (sameString(s,"0")) - { - cartRemove(cart, var); - return FALSE; - } - -time_t seconds = clock1(); -time_t val = (time_t)atoll(s); -if (val < 1000) - { - char buf[64]; - safef(buf, sizeof(buf), "%ld", seconds); - cartSetString(cart, var, buf); - return TRUE; - } -if (val + (hours * 3600) < seconds) - { - cartRemove(cart, var); - return FALSE; - } -return TRUE; -} - void cartMakeTextVar(struct cart *cart, char *var, char *defaultVal, int charSize) /* Make a text control filled with value from cart if it exists or * default value otherwise. If charSize is zero it's calculated to fit * current value. Default value may be NULL. */ { cgiMakeTextVar(var, cartUsualString(cart, var, defaultVal), charSize); } void cartMakeIntVar(struct cart *cart, char *var, int defaultVal, int maxDigits) /* Make a text control filled with integer value - from cart if available * otherwise default. */ { cgiMakeIntVar(var, cartUsualInt(cart, var, defaultVal), maxDigits); }