Login/Logout pop-ups

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
mwilk
Posts: 15
Joined: Fri Apr 05, 2013 1:48 pm

Login/Logout pop-ups

Post by mwilk »

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.

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Login/Logout pop-ups

Post by mark.monroe »

There is no way to turn off that message.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

mwilk
Posts: 15
Joined: Fri Apr 05, 2013 1:48 pm

Re: Login/Logout pop-ups

Post by mwilk »

mark.monroe wrote:There is no way to turn off that message.
OK, thanks for the info.

User avatar
Edmund
Posts: 92
Joined: Thu Nov 29, 2012 2:27 pm

Re: Login/Logout pop-ups

Post by Edmund »

I believe that you can get rid of the "Login Success" by creating your own custom login.

Code: Select all

void Button1_Click(System.Object sender, System.EventArgs e)
{
    Globals.Security.Login("Administrator", "1234");
}
The code above will login the administraor without any message.

But calling the Globals.Security.Logout(); will show the logout message :?

BR.
Edmund Andersson

AITECH AB

Part of Beijer Integrator Group

mwilk
Posts: 15
Joined: Fri Apr 05, 2013 1:48 pm

Re: Login/Logout pop-ups

Post by mwilk »

Hmm.

I'll have to think about that, but I doubt I'll go through the trouble of creating a custom login.

User avatar
Edmund
Posts: 92
Joined: Thu Nov 29, 2012 2:27 pm

Re: Login/Logout pop-ups

Post by Edmund »

well, here is a super light login function anyway

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.
Edmund Andersson

AITECH AB

Part of Beijer Integrator Group

Post Reply