new auth api
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Mar 2006 15:33:13 +0000 (15:33 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Mar 2006 15:33:13 +0000 (15:33 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3291 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/auth/session.js

index 2ec6590..4e8a84f 100644 (file)
@@ -24,28 +24,26 @@ auth.session.prototype = {
                        if (init) {
                                JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
 
-                               var login_type = data.tmp_login_type || 'staff';
-
-                               var params = [ 
-                                       this.view.name_prompt.value,
-                                       hex_md5(
+                               var params = { 
+                                       'username' : this.view.name_prompt.value,
+                                       'password' : hex_md5(
                                                init +
                                                hex_md5(
                                                        this.view.password_prompt.value
                                                )
                                        ),
-                                       login_type,
-                               ];
+                                       'type' : 'opac',
+                               };
 
-                               if (data.ws_id) {
-                                       params[3] = null; // org_id
-                                       params[4] = data.ws_id;
+                               if (data.ws_info[ this.view.server_prompt.value ]) {
+                                       params.type = 'staff';
+                                       params.workstation = data.ws_info[ this.view.server_prompt.value ].name;
                                }
 
                                var robj = this.network.request(
                                        api.AUTH_COMPLETE.app,
                                        api.AUTH_COMPLETE.method,
-                                       params
+                                       [ params ]
                                );
 
                                if (robj.ilsevent == 0) {