webpage/connector.js
//Signs up for a new account

Signs up for a new account
Signs up for a new account
static signup(username,pw,onSuccessCallback,onFailCallback){
        console.log("SENDING REQUEST FOR NEW ACCOUNT");
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function () {
            if (this.readyState == 4 && this.status == 200) {
                console.log(this.responseText);
                let result = JSON.parse(this.responseText);
                console.log(result);
                if(result['account_creation'] == 'success'){
                    Session.action = 'success';
                    onSuccessCallback();
                }
                else{
                    Session.actionr = result.reason;
                    onFailCallback();
                }
            }
        };
        let p1 = 'https://lamp.cse.fau.edu/~dbenne11/whendiagram/add_user.php?username='
        let p2 = username;
        let p3 = '&pw=';
        let p4 = pw;
        let url = p1 + p2 + p3 + p4;
        xmlhttp.open("POST", url, true);
        xmlhttp.send();
    }
static signup ( username , pw , onSuccessCallback , onFailCallback ) { console . log ( "SENDING REQUEST FOR NEW ACCOUNT" ) ; var xmlhttp = new XMLHttpRequest ( ) ; xmlhttp . onreadystatechange = function ( ) { if ( this . readyState == 4 && this . status == 200 ) { console . log ( this . responseText ) ; let result = JSON . parse ( this . responseText ) ; console . log ( result ) ; if ( result [ 'account_creation' ] == 'success' ) { Session . action = 'success' ; onSuccessCallback ( ) ; } else { Session . actionr = result . reason ; onFailCallback ( ) ; } } } ; let p1 = 'https://lamp.cse.fau.edu/~dbenne11/whendiagram/add_user.php?username=' let p2 = username ; let p3 = '&pw=' ; let p4 = pw ; let url = p1 + p2 + p3 + p4 ; xmlhttp . open ( "POST" , url , true ) ; xmlhttp . send ( ) ; }
Signs up for a new account
Signs up for a new account