[open-ils-commits] r19447 - trunk/Open-ILS/src/c-apps (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Feb 16 10:07:06 EST 2011
Author: erickson
Date: 2011-02-16 10:07:04 -0500 (Wed, 16 Feb 2011)
New Revision: 19447
Modified:
trunk/Open-ILS/src/c-apps/oils_auth.c
Log:
added option to open-ils.auth.session.retrieve to return the full cached object, which includes the auth time (cache timeout) of the cached user object
Modified: trunk/Open-ILS/src/c-apps/oils_auth.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_auth.c 2011-02-15 20:49:37 UTC (rev 19446)
+++ trunk/Open-ILS/src/c-apps/oils_auth.c 2011-02-16 15:07:04 UTC (rev 19447)
@@ -807,8 +807,17 @@
int oilsAuthSessionRetrieve( osrfMethodContext* ctx ) {
OSRF_METHOD_VERIFY_CONTEXT(ctx);
+ bool returnFull = false;
const char* authToken = jsonObjectGetString( jsonObjectGetIndex(ctx->params, 0));
+
+ if(ctx->params->size > 1) {
+ // caller wants full cached object, with authtime, etc.
+ const char* rt = jsonObjectGetString(jsonObjectGetIndex(ctx->params, 1));
+ if(rt && strcmp(rt, "0") != 0)
+ returnFull = true;
+ }
+
jsonObject* cacheObj = NULL;
oilsEvent* evt = NULL;
@@ -828,7 +837,10 @@
cacheObj = osrfCacheGetObject( key );
if(cacheObj) {
// Return a copy of the cached user object
- osrfAppRespondComplete( ctx, jsonObjectGetKeyConst( cacheObj, "userobj"));
+ if(returnFull)
+ osrfAppRespondComplete( ctx, cacheObj);
+ else
+ osrfAppRespondComplete( ctx, jsonObjectGetKeyConst( cacheObj, "userobj"));
jsonObjectFree(cacheObj);
} else {
// Auth token is invalid or expired
More information about the open-ils-commits
mailing list