From 4c557c7ae8544396b578853ca4831947779f8bfb Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Sun, 1 Jul 2012 10:56:58 +0200 Subject: [PATCH] Refactoring JavaScript files --- JavaScript/CGIscriptorSession.js | 29 +++++++++++++++++++++++++++++ Private/Login.html | 3 +-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/JavaScript/CGIscriptorSession.js b/JavaScript/CGIscriptorSession.js index 3b7ef65..0b22717 100644 --- a/JavaScript/CGIscriptorSession.js +++ b/JavaScript/CGIscriptorSession.js @@ -6,6 +6,35 @@ var CGIscriptorChallengeTicket = ""; + +// OnSubmit functions +function LoginSubmit () { + var success=check_username_password(); + SetSessionCookie(); + HashPassword(CGIscriptorRandomSalt); + hidePasswords(); + return success; +}; + +function ChangePasswordSubmit () { + if(! check_password_fields())return false; + + EncryptNewPassword("CGIUSERNAME"); + HashPassword(CGIscriptorRandomSalt); + hidePasswords(); + return true; +}; + +function CreateUserSubmit () { + if(! check_password_fields())return false; + + EncryptNewPassword("NEWUSERNAME"); + HashPassword(CGIscriptorRandomSalt); + hidePasswords(); + return true; +}; // Function definitions function hex_sha256 (plaintext) { diff --git a/Private/Login.html b/Private/Login.html index c894832..f40760d 100644 --- a/Private/Login.html +++ b/Private/Login.html @@ -49,8 +49,7 @@ window.onload = function() { application.

+ onSubmit='LoginSubmit ()'>
-- 2.11.4.GIT
Username: