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

Public Member Functions

void webAdminister () throws IOException
 
void onSigIn ()
 
void onRemind (Event event) throws IOException
 
void onSigOut ()
 
void onLang (Event event)
 
void doFinally ()
 
String getAreYouNewStr ()
 
- 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.auth.SignInControl.doFinally ( )

Reimplemented from org.turro.elephant.TemplateControl.

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

158  {
159  IUser userIn = Application.getUser();
160  redir = Executions.getCurrent().getParameter("redir");
161  if(Strings.isBlank(redir)) {
162  redir = ElContext.extractPath(ZkossElephant.getCurrent().getHttpServletRequest().getServletPath());
163  }
164  if(SSO.hasSSO()) {
165  storepass.setLabel(I_.get("Keep me signed"));
166  } else {
167  storepass.setLabel(I_.get("Remember me"));
168  }
169  if(userIn == null) {
170  siginform.setVisible(true);
171  if("true".equals(Application.getCookieValue("xp_storepass"))) {
172  storepass.setChecked(true);
173  if(SSO.hasSSO()) {
174  // do not restore user/pass
175  Application.deleteCookie("xp_pass", "/");
176  } else {
177  String xppass = Application.decryptCookieValue("xp_pass");
178  if(!Strings.isBlank(xppass)) {
179  password.setValue(xppass);
180  }
181  }
182  KeyValueMap map = Actions.getRightNowAction(Application.getApplication().getConstructor());
183  if(map != null && map.containsKey("email")) {
184  user.setValue(map.get("email"));
185  } else {
186  user.setValue(Application.getCookieValue("xp_login"));
187  }
188  }
189  /* Procedence */
190  procedencefield.setVisible(Authentications.requiresProcedence());
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  signout.setVisible(false);
200  }
201  if(cons.canWebAdminister()) {
202  wadmin.setVisible(true);
203  wadmin.setChecked(cons.isWebAdministering());
204  } else {
205  wadmin.setVisible(false);
206  }
207  }
208  String[] langs = ElephantContext.getSiteLocales().split(" *, *");
209  String currentLang = Application.getCookieValue("lang");
210  lang.appendItem(I_.get("Browser's default"), null);
211  for(String l : langs) {
212  Listitem li = lang.appendItem(I_.byKey(l), l);
213  if(l.equals(currentLang)) {
214  li.setSelected(true);
215  }
216  }
217  signup.setVisible(ElephantContext.hasSignup());
218  signupform.setVisible(userIn == null && signup.isVisible());
219  }
Here is the call graph for this function:

◆ getAreYouNewStr()

String org.turro.auth.SignInControl.getAreYouNewStr ( )

Definition at line 221 of file elephant-www/src/main/java/org/turro/auth/SignInControl.java.

221  {
222  return I_.format("Are you new in %s?", ElephantContext.getSiteName());
223  }
Here is the call graph for this function:

◆ onLang()

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

Definition at line 147 of file elephant-www/src/main/java/org/turro/auth/SignInControl.java.

147  {
148  String sel = lang.getSelectedItem().getValue();
149  if(sel == null) {
150  ZkossElephant.deleteCookie("lang", "/");
151  } else {
152  ZkossElephant.setCookie("lang", sel, "/", 365*24*60*60);
153  }
154  Executions.getCurrent().sendRedirect("");
155  }
Here is the call graph for this function:

◆ onRemind()

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

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

133  {
134  Application.getApplication().sendRedirect("/user/reminder");
135  }
Here is the call graph for this function:

◆ onSigIn()

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

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

103  {
104  if(Authentication.canLogin(user.getText(), 30)) {
105  if(storepass.isChecked()) {
106  ZkossElephant.setCookie("xp_storepass", "true", "/", 365*24*60*60);
107  ZkossElephant.setCookie("xp_login", user.getText(), "/", 365*24*60*60);
108  if(SSO.hasSSO()) {
109  // do not use user/pass
110  ZkossElephant.deleteCookie("xp_pass", "/");
111  } else {
112  ZkossElephant.encryptCookie("xp_pass", password.getText(), "/", 365*24*60*60);
113  ZkossElephant.setCookie("xp_remember", "true", "/", 365*24*60*60);
114  }
115  } else {
116  ZkossElephant.deleteCookie("xp_pass", "/");
117  ZkossElephant.deleteCookie("xp_storepass", "/");
118  ZkossElephant.deleteCookie("xp_login", "/");
119  ZkossElephant.deleteCookie("xp_remember", "/");
120  }
121  try {
122  Authentication.doLogin(user.getText(), password.getText(), redir,
123  procedence == null ? null : procedence.getObjectValue());
124  } catch (IOException ex) {
125  Logger.getLogger(SignInControl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
126  }
127  } else {
128  Clients.showNotification(I_.format("To many attempts, wait %d minutes before trying again.", 30));
129  }
130  }
Here is the call graph for this function:

◆ onSigOut()

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

Definition at line 138 of file elephant-www/src/main/java/org/turro/auth/SignInControl.java.

138  {
139  try {
140  Authentication.doLogout(redir);
141  } catch (IOException ex) {
142  Logger.getLogger(SignInControl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
143  }
144  }
Here is the call graph for this function:

◆ webAdminister()

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

Definition at line 98 of file elephant-www/src/main/java/org/turro/auth/SignInControl.java.

98  {
99  org.turro.elephant.zkoss.ZkossElephant.doWebAdmin(wadmin.isChecked(), redir);
100  }

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