Changeset 3979
- Timestamp:
- 05/26/09 14:20:42 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Release01x00/core/pub/System/JavascriptFiles/strikeone.js
r3976 r3979 1 function foswikiStrikeOne( ) {1 function foswikiStrikeOne(form) { 2 2 // Read the cookie to get the secret 3 3 var secret = readCookie('FOSWIKISTRIKEONE'); 4 // Find all validation_key inputs 5 var inputs = document.getElementsByTagName('input'); 6 for (var i in inputs) { 7 if (inputs[i].name == 'validation_key') { 8 // combine the validation key with the secret in a way that 9 // can't easily be reverse-engineered, but can be duplicated 10 // on the server (which also knows the secret) 11 var key = inputs[i].value; 12 var newkey = b64_md5(key + secret); 13 inputs[i].value = newkey; 14 } 4 //console.debug("Submit "+form.name); 5 var input = form.validation_key; 6 if (input && input.value) { 7 // combine the validation key with the secret in a way 8 // that can't easily be reverse-engineered, but can be 9 // duplicated on the server (which also knows the secret) 10 var key = input.value.substring(1); 11 var newkey = hex_md5(key + secret); 12 input.value = newkey; 13 //console.debug("Revise "+key+" + "+secret+" -> "+newkey); 15 14 } 16 15 }
Note: See TracChangeset
for help on using the changeset viewer.
