/[drupal]/contributions/modules/cram/cram.js
ViewVC logotype

Contents of /contributions/modules/cram/cram.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Tue Feb 19 05:51:47 2008 UTC (21 months, 1 week ago) by selmanj
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
Changes since 1.4: +3 -1 lines
File MIME type: text/javascript
#223527 by freso - added check to make sure that the passfield is filled out before the javascript does its hashing
1 if (Drupal.jsEnabled) {
2 $(document).ready(function() {
3 $("#user-login-form").submit(cramHashPass);
4 $("#user-login").submit(cramHashPass);
5 });
6
7 function cramHashPass() {
8 var $form;
9 if ( $("#user-login-form").length) {
10 $form = $("#user-login-form");
11 } else {
12 $form = $("#user-login");
13 }
14 var passField = $("#edit-pass").get(0);
15 var nonce = $("#edit-cram-nonce").get(0);
16 if (passField.value != '') {
17 passField.value = hex_hmac_md5(hex_md5(passField.value), nonce.value);
18 }
19
20 $form.unbind();
21 $form.get(0).submit();
22 $("#edit-submit").attr("disabled", "disabled");
23 return false;
24 }
25 }

  ViewVC Help
Powered by ViewVC 1.1.2