Commit b3da7e32 authored by Romain Loth's avatar Romain Loth

wip on doors new version

parent 45b4067f
......@@ -85,6 +85,7 @@ function registerDoorsAndSubmit(){
// REGISTERING ON THE DOORS -------------------------------------
// /!\ async
console.warn ("TODO wait for return of '[DOORS] Email confirmation'")
cmxClt.uauth.callDoors(
"register",
[emailValue, passValue, wholenameValue],
......@@ -166,16 +167,16 @@ function validateAndMsg() {
console.log("reg controllers load OK")
// £DEBUG autofill ----------->8------
// cmxClt.uform.fName.value = "Jean"
// cmxClt.uform.lName.value = "Tartampion"
// document.getElementById('initials').value="JPP"
// document.getElementById('country').value = "France"
// document.getElementById('position').value = "atitle"
// document.getElementById('keywords').value = "Blabla"
// document.getElementById('org').value = "CNRS"
//
// cmxClt.uauth.email.value= cmxClt.makeRandomString(7)+"@om.fr"
// cmxClt.uauth.pass1.value="123456+789"
// cmxClt.uauth.pass2.value="123456+789"
// cmxClt.uauth.testMailFormatAndExistence(email.value, false)
cmxClt.uform.fName.value = "Jean"
cmxClt.uform.lName.value = "Tartampion"
document.getElementById('initials').value="JPP"
document.getElementById('country').value = "France"
document.getElementById('position').value = "atitle"
document.getElementById('keywords').value = "Blabla"
document.getElementById('team_lab').value = "CNRS"
cmxClt.uauth.email.value= cmxClt.makeRandomString(7)+"@om.fr"
cmxClt.uauth.pass1.value="123456+789"
cmxClt.uauth.pass2.value="123456+789"
cmxClt.uauth.testMailFormatAndExistence(email.value, false)
// --------------------------->8------
......@@ -22,6 +22,12 @@ cmxClt = (function(cC) {
// common vars to authenticating/registering in user area
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.uidInput = document.getElementById('doors_uid')
......@@ -314,16 +320,19 @@ cmxClt = (function(cC) {
console.warn('DEBUG callDoors() internal validation failed before ajax')
}
else {
$.ajax({
contentType: "application/json",
dataType: 'json',
url: "http://"+cC.uauth.doorsConnectParam+"/api/" + apiAction,
data: JSON.stringify({
var sendData = {
"login": mailStr,
"password": passStr,
"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',
// traditional: !cC.uauth.protoDoors,
success: function(data) {
if (typeof data != 'undefined'
&& 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