From 7ebedd3f850620e39a6bc5a8925efd4145e33798 Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Wed, 20 Mar 2013 10:28:06 +0100 Subject: [PATCH] Started work on using a local copy of the Login.html page, unfinished --- JavaScript/CGIscriptorSession.js | 37 +++++++++++++++++++++++++++++++++++++ JavaScript/LoginPage.js | 4 ++++ Private/Login.html | 6 +++++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/JavaScript/CGIscriptorSession.js b/JavaScript/CGIscriptorSession.js index 012be93..7678f00 100644 --- a/JavaScript/CGIscriptorSession.js +++ b/JavaScript/CGIscriptorSession.js @@ -328,3 +328,40 @@ function togglePasswords (hide, show, value) { return value.replace(show, hide); }; }; + +// Get a loginticket, salt, and random salt from a hidden loginFrame +// UNCOMMENT for use in a local version of the Private/Login.html web page. +// UNFINISHED WORK +// Put the following line in your local version to activate +// + +function getLoginData(){ + var frameID = document.getElementById("loginFrame"); + var iFrameHeader; + if ( frameID.contentDocument ) + { // FF + iFrameHeader = frameID.contentDocument.getElementsByTagName('head')[0]; + } + else if ( frameID.contentWindow ) + { // IE + iFrameHeader = frameID.contentWindow.document.getElementsByTagName('head')[0]; + } + + // Login ticket + var myLoginexp = /CGIscriptorLoginticket="([a-f0-9]{64})"/; + var myLogin = iFrameHeader.innerHTML.match(myLoginexp); + CGIscriptorLoginticket = myLogin[1]; + var formID = document.getElementById("LOGINTICKET"); + // Set correct LOGINTICKET value in Form + formID.value = CGIscriptorLoginticket; + + // Server Salt + var mySaltexp = /CGIscriptorServerSalt="([a-f0-9]{64})"/; + var mySalt = iFrameHeader.innerHTML.match(mySaltexp); + CGIscriptorServerSalt = mySalt[1]; + + // Random Salt + var myRandomexp = /CGIscriptorRandomSalt="([a-f0-9]{64})"/; + var myRandom = iFrameHeader.innerHTML.match(myRandomexp); + CGIscriptorRandomSalt = myRandom[1]; +}; diff --git a/JavaScript/LoginPage.js b/JavaScript/LoginPage.js index 9adf3bf..b42ab52 100644 --- a/JavaScript/LoginPage.js +++ b/JavaScript/LoginPage.js @@ -10,6 +10,10 @@ window.onload = function() { warning.innerHTML = ""; }; clear_persistent_data (); + + // UNCOMMENT for use in a local version of the Private/Login.html web page. + // UNFINISHED WORK + // getLoginData(); }; diff --git a/Private/Login.html b/Private/Login.html index 337792c..85e789f 100644 --- a/Private/Login.html +++ b/Private/Login.html @@ -41,7 +41,7 @@ - $LOGINTICKET" /> + $LOGINTICKET" />

@@ -80,5 +80,9 @@ The Salt and Ticket values are all created using SHA256 on 64 Byte of output fro

+ + + + -- 2.11.4.GIT