Warning: session_start(): open(/var/lib/php/sessions/sess_dp77r1t3m22ej180fbhe70aijs, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
cmodule MultiCommClient > DynMultiComm {
switchable S password;
transient S botID = #1026281;
start {
considerAllActive = true;
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 awtEveryAndNow(super.visualize(), 10.0, r loadCustomersAndMessages);
}
bool testPassword() {
S result = print(queryBackend("testAuth"));
bool ok = startsWith(result, "OK");
if (!ok)
infoBox("Password check failed: " + result);
ret ok;
}
S queryBackend(S uri, O... params) {
ret postPage(rawBotLink(botID, uri), paramsPlus(params, _pass := password));
}
void loadCustomers q {
importAllConceptsOfType(Customer,
print("customers", unstructureList(queryBackend("activeCustomers"))), debug := true);
}
void loadCustomersAndMessages q {
L l = unstructureList(queryBackend("activeCustomersAndMsgs"));
importAllConceptsOfType(Customer, instancesOf Customer(l));
importAllConceptsOfType(Message,
map(instancesOf Message(l),
msg -> { msg.customer = getConcept(Customer, msg.customer.id); ret msg; }));
}
}