I wish to take some action when the btn_Action on the standard login panel.
This action requires the user name of the user logging in.
As this panel is built on the fly (from a class) there is no simple way that I can find to access the user name that has been entered into the text field (i.e. I cannot simply user textfield.text as I do not know that textfield object name).
After quite a bit of searching through the login classes, I could not find a public method to return the user name, or a public user name variable in the LoginFrameworkView or LoginFrameworkController classes.
There is a OaAuthUI ptr that is part of the LoginFrameworkController class, which has a getUsername() method, which would save the day. However, it is private to the LoginFrameworkController class, so I can't use that.
I tried to make my own OaAuthUI ptr in the login panel, using the setOaAuthUI() method, but I could not get it to work.
So how can I get the user name of the user logging it inside the btn_Action script of the standard login panel?
Acessing user name from standard login panel
Search
Re: Acessing user name from standard login panel
Aha! Done it!
shared_ptr<OaAuthUI> ui = m_loginFrameworkController.getUI();
DebugN(ui.getUsername());
shared_ptr<OaAuthUI> ui = m_loginFrameworkController.getUI();
DebugN(ui.getUsername());
Re: Acessing user name from standard login panel
Following on from this.
I would like to have the option of selecting a username for login from a list of known users.
I can easily do this by putting a combo box on the login panel and populating it from the _Users.UserName dp entry.
However the issue are:-
1) Getting the username for the rest of the login process from the combo box selection. I have found how to do this. I used the setUsername() method in the OaAuthUI class. I found this method by an educated guess, as if there is a getUsername() method, there is likely to be a setUsername() method. So issue 1 resolved.
2) How to get the selected user from the combo box list to show in the user name textfield? The setUsername() it seems only sets the internal user name in the OaAuthUI class. There is a setObjectText() method in the LoginFrameworkView class. This could possibly do the job if I knew what the Username text field object name on the login panel is. This is impossible to tell as it is part of the encrypted OsAuthUI class. So does anyone know how to change the value of the user name text field in the login panel or at the very least the name of the user name text field object?
I realise that I am messing with security stuff and that some of it will be off limits, but I do not see any real issues in just changing the user name text field in the login panel script.
I would like to have the option of selecting a username for login from a list of known users.
I can easily do this by putting a combo box on the login panel and populating it from the _Users.UserName dp entry.
However the issue are:-
1) Getting the username for the rest of the login process from the combo box selection. I have found how to do this. I used the setUsername() method in the OaAuthUI class. I found this method by an educated guess, as if there is a getUsername() method, there is likely to be a setUsername() method. So issue 1 resolved.
2) How to get the selected user from the combo box list to show in the user name textfield? The setUsername() it seems only sets the internal user name in the OaAuthUI class. There is a setObjectText() method in the LoginFrameworkView class. This could possibly do the job if I knew what the Username text field object name on the login panel is. This is impossible to tell as it is part of the encrypted OsAuthUI class. So does anyone know how to change the value of the user name text field in the login panel or at the very least the name of the user name text field object?
I realise that I am messing with security stuff and that some of it will be off limits, but I do not see any real issues in just changing the user name text field in the login panel script.
Re: Acessing user name from standard login panel
I just made a simple test and in the panel vision/loginFramework/login_Standard.pnl I added a object with a script which sets the attribute "text" for the object "txt_username".
The username was written to the text field.
If I then press enter in the text field for the username and the password the user defined in the text field is used.
Best Regards
Leopold Knipp
Senior Support Specialist
The username was written to the text field.
If I then press enter in the text field for the username and the password the user defined in the text field is used.
Best Regards
Leopold Knipp
Senior Support Specialist
Re: Acessing user name from standard login panel
Thank you, Leopold that works great. I am a happy programmer now. 
