Warning: session_start(): open(/var/lib/php/sessions/sess_e6sl8f62po9je5c92jvqhv4sfg, 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
concept PasswordEntry {
S purpose;
SecretValue password;
}
cmodule VNCViewerTrayIcon > DynCRUD {
transient TrayIcon trayIcon;
transient ReliableSingleThread rstMakeTrayIcon = dm_rst(this, r makeTrayIcon);
start {
db(); // TODO: move DB to JavaX-Secret
onConceptsChangeAndNow(r { doLater(2.0, rstMakeTrayIcon) });
}
void makeTrayIcon enter {
disposeTrayIcon(trayIcon);
new L menuItems; // no left-click action
for (PasswordEntry e : conceptsSortedByFieldAlphanumIC(PasswordEntry, "purpose"))
if (nemptyAfterTrim(getVar(e.password)))
addAll(menuItems, "Copy password for " + e.purpose, rThread { copyPassword(e) });
add(menuItems, "---");
addAll(menuItems, "Edit Passwords...", rThread dm_activateOSAndModule);
trayIcon = installTrayIcon(#1101468, "Password Manager", menuItems);
}
afterVisualize {
// TODO: disable when at beginning/end of list
// TODO also: move to standard function
addSelectionDependentButton("Move Up", r {
copyPassword a = selected(), b = itemBefore(list(), a);
if (a != null && b != null)
swapConceptIDs(a, b);
});
addSelectionDependentButton("Move Down", r {
PasswordEntry a = selected(), b = itemAfter(list(), a);
if (a != null && b != null)
swapConceptIDs(a, b);
});
addSelectionDependentButton("Copy password", rThread {
copyPassword(selected());
});
}
void cleanMeUp {
disposeTrayIcon(trayIcon);
}
void copyPassword(PasswordEntry p) {
if (p == null) ret;
copyTextToClipboard(p.password);
infoBox("Password for " + p.purpose + " copied to clipboard");
}
}