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

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 () throws Exception
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 57 of file SignInComposer.java.

Member Function Documentation

◆ doFinally()

void org.turro.signin.SignInComposer.doFinally ( ) throws Exception

Definition at line 163 of file SignInComposer.java.

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

◆ onChangingUser()

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

Definition at line 98 of file SignInComposer.java.

98  {
99  personain.setVisible(Strings.isBlank(evt.getValue()));
100  }

◆ onLang()

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

Definition at line 152 of file SignInComposer.java.

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

◆ onProfile()

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

Definition at line 146 of file SignInComposer.java.

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

◆ onRemind()

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

Definition at line 129 of file SignInComposer.java.

129  {
130  if(org.turro.elephant.zkoss.ZkossElephant.doSendReminder(user.getText())) {
131  Clients.showNotification(I_.get("A reminder has been sent"));
132  }
133  }
Here is the call graph for this function:

◆ onSigIn()

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

Definition at line 108 of file SignInComposer.java.

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

◆ onSigOut()

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

Definition at line 136 of file SignInComposer.java.

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

◆ webAdminister()

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

Definition at line 103 of file SignInComposer.java.

103  {
104  org.turro.elephant.zkoss.ZkossElephant.doWebAdmin(wadmin.isChecked(), redir);
105  }

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