/************************************************** ** Global Variables ** **************************************************/ /************************************************** ** UserOptions Functions ** **************************************************/ /** * doViewUserOptions * * Load's the users current account. * */ function doViewUserOptions() { var request = createXMLHttpRequest(); changeById('helpContainer', '
' + '' ); showWindow('helpOverlay'); if (!loggedIn) { changeById('APRSMail:UserOptions:Error', 'You must be logged in to use this feature.'); return; } // if changeById('APRSMail:UserOptions:Error', "Loading account information..."); var queryString = "/ajax/aprsmail/useroptions/view.php?h=" + seed; request.open("GET", queryString, true); request.onreadystatechange = function() { if (request.readyState == 4) { var xmlDoc = request.responseXML; var retData = new Array(); xmlArray("/openaprs/reply", xmlDoc, retData); for (i=0; i < retData.length; i++) { if (retData[i]["done"] == "yes") { changeById('APRSMail:UserOptions:Data', retData[i]["response"]); changeById('APRSMail:UserOptions:Error', ''); } // if else { //changeById('helpContainer', "There was an error loading your inbox."); changeById(retData[i]["field"], retData[i]["response"]); } // else } // for } // if } // function() request.send(null); } // doViewUserOptions /** * doChangeUserOptions * * Load's the users current account. * */ function doChangeUserOptions() { var request = createXMLHttpRequest(); //changeById('helpContainer', '' // + '' // ); if (!loggedIn) { changeById('APRSMail:UserOptions:Error', 'You must be logged in to use this feature.'); return; } // if changeById('APRSMail:Error:Enable', ''); changeById('APRSMail:Error:Open', ''); changeById('APRSMail:Error:WhiteList', ''); changeById('APRSMail:Error:Pin', ''); changeById('APRSMail:Error:Preferred', ''); changeById('APRSMail:Error:Timezone', ''); changeById('APRSMail:UserOptions:Error', "Storing account information..."); /** * Default Variables * * Span through the possible field values * and set our variable list accordingly. * */ var ids = { "e": "APRSMail:Form:Enable", "w": "APRSMail:Form:WhiteList", "p": "APRSMail:Form:Pin", "pr": "APRSMail:Form:Preferred", "tz": "APRSMail:Form:Timezone" } var dfts = { "e": "1", "w": "0", "p": "", "pr": "", "tz": "America/Los_Angeles" } var var_list = createURI(document, false, ids, dfts); var queryString = "/ajax/aprsmail/useroptions/change.php?h=" + seed + var_list; request.open("GET", queryString, true); request.onreadystatechange = function() { if (request.readyState == 4) { var xmlDoc = request.responseXML; var retData = new Array(); xmlArray("/openaprs/reply", xmlDoc, retData); for (i=0; i < retData.length; i++) { if (retData[i]["done"] == "yes") { changeById('APRSMail:UserOptions:Data', retData[i]["response"]); changeById('APRSMail:UserOptions:Error', 'Account information stored.'); } // if else { changeById('APRSMail:UserOptions:Error', "There was an error storing your account information."); changeById(retData[i]["field"], retData[i]["response"]); } // else } // for } // if } // function() request.send(null); } // doChangeUserOptions