Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class StartUpLogin extends RunBase
- {
- SMTPPassword SMTPPassword;
- SMTPUserName SMTPUserName;
- dialogfield dlgUserName,dlgPassword;
- DialogRunbase dialog;
- int i;
- #define.CurrentVersion(1)
- #define.Version1(1)
- #localmacro.CurrentList
- SMTPPassword,
- SMTPUserName
- #endmacro
- }
- Object dialog()
- {
- ;
- dialog = super();
- dlgUserName = dialog.addField(typeId(SMTPUserName),'User Name');
- dlgPassword = dialog.addField(typeId(SMTPPassword),'Password');//.passwordStyle(true);
- return dialog;
- }
- public boolean getFromDialog()
- {
- SysUserInfo SysUserInfo;
- ;
- SMTPUserName = dlgUserName.value();
- SMTPPassword = dlgPassword.value();
- select * from SysUserInfo where SysUserInfo.Password == SMTPPassword
- && SysUserInfo.Id == curuserid();
- i++;
- if(!SysUserInfo && i<3)
- throw error("User not find");
- if(i>=3)
- this.shutdownAxapta();
- return true;
- }
- public container pack()
- {
- return [#CurrentVersion,#CurrentList];
- }
- public void shutdownAxapta()
- {
- SysGlobalCache cache = appl.globalCache();
- info info;
- ;
- cache.set(classstr(info), identifierstr(Autologoff), true);
- info=new info();
- info.shutDown(true);
- }
- void StartUpLoginMethod()
- {
- StartUpLogin StartUpLogin;
- ;
- StartUpLogin = new StartUpLogin();
- if(StartUpLogin.prompt())
- {
- }
- else
- {
- this.shutdownAxapta();
- }
- }
- public boolean unpack(container packedClass)
- {
- Version version = RunBase::getVersion(packedClass);
- ;
- switch (version)
- {
- case #CurrentVersion:
- [version,#CurrentList] = packedClass;
- break;
- default:
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement