We have our own login screen.
When a user logs in, or out, there is a "Login/Logout Success" dialog that pops up.
Because we have controls on the HMI that become visible/invisible depending on the user level, the user already gets feedback that indicates success.
How can I turn on/off those "Login/Logout Success" messages?
Thanks.
Login/Logout pop-ups
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Login/Logout pop-ups
There is no way to turn off that message.
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Re: Login/Logout pop-ups
OK, thanks for the info.mark.monroe wrote:There is no way to turn off that message.
Re: Login/Logout pop-ups
I believe that you can get rid of the "Login Success" by creating your own custom login.
The code above will login the administraor without any message.
But calling the Globals.Security.Logout(); will show the logout message
BR.
Code: Select all
void Button1_Click(System.Object sender, System.EventArgs e)
{
Globals.Security.Login("Administrator", "1234");
}
But calling the Globals.Security.Logout(); will show the logout message
BR.
Re: Login/Logout pop-ups
Hmm.
I'll have to think about that, but I doubt I'll go through the trouble of creating a custom login.
I'll have to think about that, but I doubt I'll go through the trouble of creating a custom login.
Re: Login/Logout pop-ups
well, here is a super light login function anyway
The screen contains two buttons (login/logout), one ComboBox for users (cboUsers) and one text field for password (txtPassword).
BR.
Code: Select all
namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;
using Neo.ApplicationFramework.Common.Service;
using Neo.ApplicationFramework.Common.Utilities;
public partial class Screen1
{
void Screen1_Opened(System.Object sender, System.EventArgs e)
{
// Get all users
ISecurityManager securityManager = Globals.Security as ISecurityManager;
foreach (ISecurityUser user in securityManager.Users)
cboUsers.Items.Add(user.Username);
}
void Button1_Click(System.Object sender, System.EventArgs e)
{
// Get current username
var currentUser = Globals.Security.CurrentUser;
// Try to login
Globals.Security.Login(cboUsers.Text, txtPassword.Text);
// Check if the username was changed
if(currentUser != Globals.Security.CurrentUser)
MessageBox.Show("Login OK");
else
MessageBox.Show("Login Failed");
}
void Button2_Click(System.Object sender, System.EventArgs e)
{
// Logout
Globals.Security.Logout();
}
}
}
The screen contains two buttons (login/logout), one ComboBox for users (cboUsers) and one text field for password (txtPassword).
BR.