def _addComponents(self): wns = WN.getWNLogin() self.nl() comp = NW.LabelTextbox('PROFID',wns.getAltId('PROFID'), True) self.add(comp) comp = NW.LabelTextbox('PASSWORD',wns.getAltId('PASSWORD'), True) comp.getComponent().setPasswordType() self.add(comp) rememberme = WW.Checkboxes('rememberme',['rememberme'],[UTIL.getText('REMEMBER_ME')]) self.add(rememberme) self.nl() bButton = NW.BusyTableButton(self.getId()+'Button',UTIL.getText('LOGIN')) bButton.setButtonClass('regularbutton') self.add(bButton) self.nl() forgotPwdLink = WW.Hyperlink('http://www.google.com',UTIL.getText('FORGETPASSWORD')) self.add(forgotPwdLink)
def _TryLogin(): form = cgi.FieldStorage() widId = WN.getWidgetIdLogin() wns = WN.getWNLogin() pid = form.getvalue(wns.getAltId('PROFID')) pwd = form.getvalue(wns.getAltId('PASSWORD')) if pid == None or pwd == None: return UTIL.getStatusInfoDiv([UTIL.getText('NOUSER_ERROR')], widId, NCONST.ERROR) ret = _LoginAndGetSession(pid, pwd) if ret == False: return UTIL.getStatusInfoDiv([UTIL.getText('NOUSER_ERROR')], widId, NCONST.ERROR) sessinfo = _getSessInfo() statusVal = '%s %s'%(sessinfo[0], sessinfo[1]) return UTIL.getStatusInfoDiv(['Success'], widId, NCONST.SUCCESS, statusVal)