19 package org.turro.signin;
21 import java.io.IOException;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import org.turro.action.Contacts;
25 import org.turro.auth.Authentication;
26 import org.turro.command.Command;
27 import org.turro.elephant.context.ElephantContext;
28 import org.turro.elephant.zkoss.Modal;
29 import org.turro.log.SystemLogType;
30 import org.turro.log.SystemLogger;
31 import org.turro.plugin.contacts.IContact;
32 import org.zkoss.lang.Strings;
33 import org.zkoss.zk.ui.Component;
34 import org.zkoss.zk.ui.Executions;
35 import org.zkoss.zk.ui.event.Event;
36 import org.zkoss.zk.ui.event.InputEvent;
37 import org.zkoss.zk.ui.select.SelectorComposer;
38 import org.zkoss.zk.ui.select.annotation.Listen;
39 import org.zkoss.zk.ui.select.annotation.Wire;
40 import org.zkoss.zul.A;
41 import org.zkoss.zul.Listbox;
42 import org.zkoss.zul.Panel;
43 import org.zkoss.zul.Textbox;
52 private String onSignin, onSignout;
55 private Panel siginform;
58 private Listbox contacts;
61 private Textbox password;
64 private Panel signoutform;
69 @Listen(
"onChanging = #user")
73 @Listen(
"onOK = #signinform; onClick = #signin")
75 if(Strings.isBlank(password.getText())) {
76 password.setFocus(
true);
81 }
catch (IOException ex) {
87 @Listen(
"onClick = #signout")
91 }
catch (IOException ex) {
96 @Listen(
"onClick = #profile")
97 public
void onProfile(Event event) throws IOException, InterruptedException {
99 Modal.
doModal(
"/WEB-INF/_zul/www/profile.zul", (Command)
null);
106 onSignin = Executions.getCurrent().getParameter(
"onSignin");
107 onSignout = Executions.getCurrent().getParameter(
"onSignout");
108 if(contact ==
null || !contact.
isValid()) {
109 siginform.setVisible(
true);
110 contacts.setFocus(
true);
112 signoutform.setVisible(
true);
static IContact getIContact()
static void doLogout(String redir)
static void doLogin(String login, String pass, String redir, Object extra)
static String logMsg(String msg)
static int doModal(String file)
static ISystemLogger getInstance()
void onChangingUser(InputEvent evt)
void onProfile(Event event)
void doLog(SystemLogType type, Object entity, String comment, Serializable data)