updated to work with new login params. removed Cookie.js requirement in favor of...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Mar 2006 15:22:14 +0000 (15:22 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Mar 2006 15:22:14 +0000 (15:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3290 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/reporter/templates/header.ttk
Open-ILS/src/reporter/templates/login.ttk
Open-ILS/src/reporter/templates/logout.ttk

index 1ced2ce..93ca9c3 100644 (file)
@@ -2,7 +2,6 @@
 <head>
 
        <!-- Load our JS libs -->
-       <script language='javascript' src='/opac/common/js/Cookie.js'> </script>
        <script language='javascript' src='/opac/common/js/Cookies.js'> </script>
        <script language='javascript' src='/opac/common/js/md5.js'> </script>
        <script language='javascript' src='/opac/common/js/config.js'> </script>
index bd60494..9e453ab 100644 (file)
@@ -6,9 +6,6 @@
 
                <script language='javascript'>
 
-                       var COOKIE_SES = "ses";
-                       var cookie = new cookieObject("ses", 1, "/", COOKIE_SES);
-
                        function initPage() {
                        document.getElementById("reports_login_username").focus();
                        document.getElementById("reports_login_username").onkeypress = checkInputClicks;
                        
                        var auth_request = new RemoteRequest( 
                                        "open-ils.auth", "open-ils.auth.authenticate.complete",
-                                       uname, hex_md5(seed + hex_md5(passwd)), "staff");
+                                       {       
+                                               username : uname,
+                                               password : hex_md5(seed + hex_md5(passwd)),
+                                               type : "staff" 
+                                       });
                        
                        auth_request.send(true);
                        var auth_result = auth_request.getResultObject().payload.authtoken;
@@ -49,8 +50,7 @@
                                        return false; 
                                }
        
-                               cookie.put(COOKIE_SES, auth_result);
-                               cookie.write();
+                               cookieManager.write(COOKIE_SES, auth_result, '+1d');
                                location.href = location.href;
                
                        }
index 17d1a5a..731c51b 100644 (file)
@@ -1,11 +1,8 @@
 <script language='javascript'>
 
-       var COOKIE_SES = "ses";
-       var cookie = new cookieObject("ses", 1, "/", COOKIE_SES);
-
        function doLogout() {
 
-               var ses = cookie.get(COOKIE_SES);
+               var ses = cookieManager.read(COOKIE_SES);
 
                if(ses) {
        var req = new RemoteRequest(
@@ -14,8 +11,7 @@
        req.send(true);
                }
 
-   cookie.remove(COOKIE_SES);
-
+   cookieManager.remove(COOKIE_SES);
        location.href = location.href.replace( /(\?.*$)/, "" );
 
 }