From 9e67fced3f17c3505b78dae30ea11f826752f0b3 Mon Sep 17 00:00:00 2001
From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Tue, 1 Mar 2011 18:09:57 +0000
Subject: [PATCH] when using the force-reload option to reset timeout,
 propagate the ws_ou and wsid values from the cached user object into the
 reloaded user object

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19551 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/src/c-apps/oils_auth.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Open-ILS/src/c-apps/oils_auth.c b/Open-ILS/src/c-apps/oils_auth.c
index 4e7b20b11e..962977abab 100644
--- a/Open-ILS/src/c-apps/oils_auth.c
+++ b/Open-ILS/src/c-apps/oils_auth.c
@@ -719,6 +719,12 @@ static int _oilsAuthReloadUser(jsonObject* cacheObj) {
     osrfAppSessionFree(session); // calls disconnect internally
 
     if(newUserObj) {
+
+        // ws_ou and wsid are ephemeral and need to be manually propagated
+        // oilsFMSetString dupe()'s internally, no need to clone the string
+        oilsFMSetString(newUserObj, "wsid", oilsFMGetStringConst(userObj, "wsid"));
+        oilsFMSetString(newUserObj, "ws_ou", oilsFMGetStringConst(userObj, "ws_ou"));
+
         jsonObjectRemoveKey(cacheObj, "userobj"); // this also frees the old user object
         jsonObjectSetKey(cacheObj, "userobj", newUserObj);
         return 1;
-- 
2.11.0