now using workstation as the org for auth session timeouts if available
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 3 Mar 2006 21:28:27 +0000 (21:28 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 3 Mar 2006 21:28:27 +0000 (21:28 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3256 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/c-apps/oils_auth.c

index 168e68c..15986e2 100644 (file)
@@ -251,7 +251,18 @@ oilsEvent* oilsAuthHandleLoginOK(
        oilsEvent* response;
        osrfLogActivity(OSRF_LOG_MARK,  "User %s successfully logged in", uname );
 
-       double timeout = oilsAuthGetTimeout( userObj, type, orgloc );
+       double timeout;
+       char* wsorg = jsonObjectToSimpleString(oilsFMGetObject(userObj, "ws_ou"));
+       if(wsorg) { /* if there is a workstation, use it for the timeout */
+               osrfLogDebug( OSRF_LOG_MARK, 
+                               "Auth session trying workstation id %d for auth timeout", atoi(wsorg));
+               timeout = oilsAuthGetTimeout( userObj, type, atoi(wsorg) );
+               free(wsorg);
+       } else {
+               osrfLogDebug( OSRF_LOG_MARK, 
+                               "Auth session trying org from param [%d] for auth timeout", orgloc );
+               timeout = oilsAuthGetTimeout( userObj, type, orgloc );
+       }
        osrfLogDebug(OSRF_LOG_MARK, "Auth session timeout for %s: %lf", uname, timeout );
 
        char* string = va_list_to_string(