changed logout to redirect to the front page
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 5 Jul 2005 21:53:46 +0000 (21:53 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 5 Jul 2005 21:53:46 +0000 (21:53 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1055 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/javascript/opac/GlobalInit.js
Open-ILS/src/javascript/opac/LogoutPage.js
Open-ILS/src/javascript/opac/Page.js
Open-ILS/src/javascript/util/ils_utils.js

index aca1dfd..af0d2d7 100644 (file)
@@ -161,7 +161,6 @@ function GlobalInitLoad() {
 
        debug("Global Init is doing its primary load");
        globalOrgTreeWidget = new LocationTree(globalOrgTree);
-       globalUser = UserSession.instance();
 
        var ses = null;
        var org = null;
@@ -171,14 +170,21 @@ function GlobalInitLoad() {
                org = G['user_ou']; /* the desired location of the user */
        }
 
-       if(globalUser.verifySession(ses)) {
-               globalUser.grabOrgUnit(org);
+       if(paramObj.__logout) {
+               doLogout();
 
-       } else  {
-               globalUser = null;
-               globalLocation = globalOrgTree;
-               if(globalSearchDepth == null)
-                       globalSearchDepth = findOrgDepth(globalOrgTree.ou_type());
+       } else {
+
+               globalUser = UserSession.instance();
+               if(globalUser.verifySession(ses)) {
+                       globalUser.grabOrgUnit(org);
+       
+               } else  {
+                       globalUser = null;
+                       globalLocation = globalOrgTree;
+                       if(globalSearchDepth == null)
+                               globalSearchDepth = findOrgDepth(globalOrgTree.ou_type());
+               }
        }
 
        grabCopyStatus();
index 97e9957..bfe9001 100644 (file)
@@ -38,6 +38,8 @@ LogoutPage.prototype.doLogout = function() {
        message.innerHTML = this.logout_success_msg;
        this.searchBar.reset();
 
+       return true;
+
 }
 
 
index d76b4a7..125749e 100644 (file)
@@ -214,7 +214,10 @@ Page.prototype.buildNavBox = function(full) {
        if(loc) arr.push(this.buildDeepLink());
 
        if(UserSession.instance().verifySession()) {
-               arr.push(elem("a", {href: prefix + "?target=logout"}, null, "Logout"));
+               //arr.push(elem("a", {href: prefix + "?target=logout"}, null, "Logout"));
+               var a = elem("a", {href:globalRootPath}, null, "Logout");
+               a.onclick = doLogout;
+               arr.push(a);
        } 
 
 
index ff4caef..98f54bf 100644 (file)
@@ -297,10 +297,10 @@ function mkResourceImage(resource) {
 
 function doLogout() {
 
-       /* remove cookie so browse know's we're logged out */
+       /* remove cookie so browser know's we're logged out */
        deleteCookie("ils_ses");
 
-       var user = UserSession.instanece();
+       var user = UserSession.instance();
        if( user.session_id ) {
                var request = new RemoteRequest( "open-ils.auth",
                        "open-ils.auth.session.delete", user.session_id );