BrightSide Workbench Full Report + Source Code
org.turro.signin.SignInControl Class Reference
Inheritance diagram for org.turro.signin.SignInControl:
Collaboration diagram for org.turro.signin.SignInControl:

Public Member Functions

void onChangingUser (InputEvent evt) throws IOException
 
void webAdminister () throws IOException
 
void onSigIn ()
 
void onRemind (Event event) throws IOException
 
void onSigOut ()
 
void onProfile (Event event) throws IOException, InterruptedException
 
void onLang (Event event)
 
void doFinally ()
 
- Public Member Functions inherited from org.turro.elephant.TemplateControl
void setRootTmpl (String rootTmpl)
 
void setTmpl (String tmpl)
 
void afterCompose ()
 

Additional Inherited Members

Detailed Description

Member Function Documentation

◆ doFinally()

void org.turro.signin.SignInControl.doFinally ( )

Reimplemented from org.turro.elephant.TemplateControl.

Definition at line 169 of file elephant-zkoss/src/main/java/org/turro/signin/SignInControl.java.

169  {
170  IUser userIn = ZkossElephant.getUser();
171  redir = Executions.getCurrent().getParameter("redir");
172  if(Strings.isBlank(redir)) {
173  redir = ElContext.extractPath(ZkossElephant.getCurrent().getHttpServletRequest().getServletPath());
174  }
175  if(userIn == null) {
176  siginform.setVisible(true);
177  if("true".equals(ZkossElephant.getCookieValue("xp_storepass"))) {
178  storepass.setChecked(true);
179  String xppass = ZkossElephant.decryptCookieValue("xp_pass");
180  if(!Strings.isBlank(xppass)) {
181  password.setValue(xppass);
182  }
183  KeyValueMap map = Actions.getRightNowAction(Application.getApplication().getConstructor());
184  if(map != null && map.containsKey("email")) {
185  user.setValue(map.get("email"));
186  } else {
187  user.setValue(ZkossElephant.getCookieValue("xp_login"));
188  }
189  //personain.setVisible(Strings.isBlank(user.getValue()));
190  }
191  } else {
192  sigoutform.setVisible(true);
193  langs.setVisible(false);
194  IConstructor cons = Application.getApplication().getConstructor();
195  Boolean isInternalSignIn = (Boolean) cons.getSessionAttribute(IUser.INTERNAL_SIGNIN);
196  if(isInternalSignIn != null && isInternalSignIn) {
197  //personaout.setVisible(false);
198  } else {
199  profile.setVisible(false);
200  signout.setVisible(false);
201  }
202  if(cons.canWebAdminister()) {
203  wadmin.setVisible(true);
204  wadmin.setChecked(cons.isWebAdministering());
205  } else {
206  wadmin.setVisible(false);
207  }
208  }
209  String[] langs = ElephantContext.getSiteLocales().split(" *, *");
210  String currentLang = org.turro.elephant.zkoss.ZkossElephant.getCookieValue("lang");
211  lang.appendItem(I_.get("Browser's default"), null);
212  for(String l : langs) {
213  Listitem li = lang.appendItem(I_.byKey(l), l);
214  if(l.equals(currentLang)) {
215  li.setSelected(true);
216  }
217  }
218  signup.setVisible(new File(ElephantContext.getRealPath("/user/signup")).isDirectory());
219  }
Here is the call graph for this function:

◆ onChangingUser()

void org.turro.signin.SignInControl.onChangingUser ( InputEvent  evt) throws IOException

Definition at line 103 of file elephant-zkoss/src/main/java/org/turro/signin/SignInControl.java.

103  {
104  //personain.setVisible(Strings.isBlank(evt.getValue()));
105  }

◆ onLang()

void org.turro.signin.SignInControl.onLang ( Event  event)

Definition at line 158 of file elephant-zkoss/src/main/java/org/turro/signin/SignInControl.java.

158  {
159  String sel = lang.getSelectedItem().getValue();
160  if(sel == null) {
161  ZkossElephant.deleteCookie("lang", "/");
162  } else {
163  ZkossElephant.setCookie("lang", sel, "/", 365*24*60*60);
164  }
165  Executions.getCurrent().sendRedirect("");
166  }
Here is the call graph for this function:

◆ onProfile()

void org.turro.signin.SignInControl.onProfile ( Event  event) throws IOException, InterruptedException

Definition at line 152 of file elephant-zkoss/src/main/java/org/turro/signin/SignInControl.java.

152  {
153  SystemLogger.getInstance().doLog(SystemLogType.LOG_INFO, "/log/profile", null, null);
154  Modal.doModal("/WEB-INF/_zul/www/profile.zul", (Command) null);
155  }
Here is the call graph for this function:

◆ onRemind()

void org.turro.signin.SignInControl.onRemind ( Event  event) throws IOException

Definition at line 133 of file elephant-zkoss/src/main/java/org/turro/signin/SignInControl.java.

133  {
134  Clients.clearWrongValue(user);
135  if(org.turro.elephant.zkoss.ZkossElephant.doSendReminder(user.getText())) {
136  Clients.showNotification(I_.get("A reminder has been sent"));
137  } else {
138  Clients.wrongValue(user, I_.get("Missing") + ": " + I_.get("User/Email"));
139  }
140  }
Here is the call graph for this function:

◆ onSigIn()

void org.turro.signin.SignInControl.onSigIn ( )

Definition at line 113 of file elephant-zkoss/src/main/java/org/turro/signin/SignInControl.java.

113  {
114  if(storepass.isChecked()) {
115  ZkossElephant.encryptCookie("xp_pass", password.getText(), "/", 365*24*60*60);
116  ZkossElephant.setCookie("xp_storepass", "true", "/", 365*24*60*60);
117  ZkossElephant.setCookie("xp_login", user.getText(), "/", 365*24*60*60);
118  ZkossElephant.setCookie("xp_remember", "true", "/", 365*24*60*60);
119  } else {
120  ZkossElephant.deleteCookie("xp_pass", "/");
121  ZkossElephant.deleteCookie("xp_storepass", "/");
122  ZkossElephant.deleteCookie("xp_login", "/");
123  ZkossElephant.deleteCookie("xp_remember", "/");
124  }
125  try {
126  Authentication.doLogin(user.getText(), password.getText(), redir, null);
127  } catch (IOException ex) {
128  Logger.getLogger(SignInComposer.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
129  }
130  }
Here is the call graph for this function:

◆ onSigOut()

void org.turro.signin.SignInControl.onSigOut ( )

Definition at line 143 of file elephant-zkoss/src/main/java/org/turro/signin/SignInControl.java.

143  {
144  try {
145  Authentication.doLogout(redir);
146  } catch (IOException ex) {
147  Logger.getLogger(SignInComposer.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
148  }
149  }
Here is the call graph for this function:

◆ webAdminister()

void org.turro.signin.SignInControl.webAdminister ( ) throws IOException

Definition at line 108 of file elephant-zkoss/src/main/java/org/turro/signin/SignInControl.java.

108  {
109  org.turro.elephant.zkoss.ZkossElephant.doWebAdmin(wadmin.isChecked(), redir);
110  }

The documentation for this class was generated from the following file: