Commit b3da7e32 authored by Romain Loth's avatar Romain Loth

wip on doors new version

parent 45b4067f
...@@ -85,6 +85,7 @@ function registerDoorsAndSubmit(){ ...@@ -85,6 +85,7 @@ function registerDoorsAndSubmit(){
// REGISTERING ON THE DOORS ------------------------------------- // REGISTERING ON THE DOORS -------------------------------------
// /!\ async // /!\ async
console.warn ("TODO wait for return of '[DOORS] Email confirmation'")
cmxClt.uauth.callDoors( cmxClt.uauth.callDoors(
"register", "register",
[emailValue, passValue, wholenameValue], [emailValue, passValue, wholenameValue],
...@@ -166,16 +167,16 @@ function validateAndMsg() { ...@@ -166,16 +167,16 @@ function validateAndMsg() {
console.log("reg controllers load OK") console.log("reg controllers load OK")
// £DEBUG autofill ----------->8------ // £DEBUG autofill ----------->8------
// cmxClt.uform.fName.value = "Jean" cmxClt.uform.fName.value = "Jean"
// cmxClt.uform.lName.value = "Tartampion" cmxClt.uform.lName.value = "Tartampion"
// document.getElementById('initials').value="JPP" document.getElementById('initials').value="JPP"
// document.getElementById('country').value = "France" document.getElementById('country').value = "France"
// document.getElementById('position').value = "atitle" document.getElementById('position').value = "atitle"
// document.getElementById('keywords').value = "Blabla" document.getElementById('keywords').value = "Blabla"
// document.getElementById('org').value = "CNRS" document.getElementById('team_lab').value = "CNRS"
//
// cmxClt.uauth.email.value= cmxClt.makeRandomString(7)+"@om.fr" cmxClt.uauth.email.value= cmxClt.makeRandomString(7)+"@om.fr"
// cmxClt.uauth.pass1.value="123456+789" cmxClt.uauth.pass1.value="123456+789"
// cmxClt.uauth.pass2.value="123456+789" cmxClt.uauth.pass2.value="123456+789"
// cmxClt.uauth.testMailFormatAndExistence(email.value, false) cmxClt.uauth.testMailFormatAndExistence(email.value, false)
// --------------------------->8------ // --------------------------->8------
...@@ -22,6 +22,12 @@ cmxClt = (function(cC) { ...@@ -22,6 +22,12 @@ cmxClt = (function(cC) {
// common vars to authenticating/registering in user area // common vars to authenticating/registering in user area
cC.uauth = {} cC.uauth = {}
// temporary parameter (TODO remove after doors deployment)
// -------------------
// true if we are using first minidoors prototype (commit fca0f79)
// otherwise assume normal doors (commit >= a0ce580)
cC.uauth.protoDoors = true
cC.uauth.emailIdSupposedToExist = null cC.uauth.emailIdSupposedToExist = null
cC.uauth.uidInput = document.getElementById('doors_uid') cC.uauth.uidInput = document.getElementById('doors_uid')
...@@ -314,16 +320,19 @@ cmxClt = (function(cC) { ...@@ -314,16 +320,19 @@ cmxClt = (function(cC) {
console.warn('DEBUG callDoors() internal validation failed before ajax') console.warn('DEBUG callDoors() internal validation failed before ajax')
} }
else { else {
$.ajax({ var sendData = {
contentType: "application/json",
dataType: 'json',
url: "http://"+cC.uauth.doorsConnectParam+"/api/" + apiAction,
data: JSON.stringify({
"login": mailStr, "login": mailStr,
"password": passStr, "password": passStr,
"name": nameStr "name": nameStr
}), }
$.ajax({
contentType: cC.uauth.protoDoors ? "application/json" : "application/x-www-form-urlencoded; charset=UTF-8",
dataType: 'json',
url: "http://"+cC.uauth.doorsConnectParam+"/api/" + apiAction,
data: cC.uauth.protoDoors ? JSON.stringify(sendData) : sendData,
type: 'POST', type: 'POST',
// traditional: !cC.uauth.protoDoors,
success: function(data) { success: function(data) {
if (typeof data != 'undefined' if (typeof data != 'undefined'
&& apiAction == 'userExists') { && apiAction == 'userExists') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment