!7 !include once #1026287 // Multi-Comm Concepts cmodule MultiCommClient { switchable S password; transient S botID = #1026281; start { dm_reloadOnFieldChange('password); } enhanceFrame { minFrameSize(f, 300, 300); } visualize { if (empty(password) || !testPassword()) { JPasswordField pw = centerTextField(jpassword(password)); ret jfullcenter(withCenteredTitle("Please enter password:", onEnter(pw, r { setField(password := gtt(pw)); }))); } ret jcenteredlabel("Logged in"); } bool testPassword() { S result = print(loadPage(appendQueryToURL(rawBotLink(botID, "testAuth"), _pass := password))); bool ok = startsWith(result, "OK"); if (!ok) infoBox("Password check failed: " + result); ret ok; } S queryBackend(S uri, O... params) { ret postPage(rawBotLink(botID, "testAuth"), paramsPlus(params, _pass := password)); } }