Page 1 of 1
Disable user access to UI configuration
Posted: Mon Oct 22, 2018 10:31 am
by NikolayLevchenko
What's the best way to disable user access the UI configuration via the Login panel?
In our project, all clients will have the same template, the same resolution and the same number of screens and I don't want operators to mess with their settings.
I can of course, edit the "login.pnl" but I generally try to avoid editing any ETM-standard scripts or panels to prevent problems in future upgrades. Any ideas?

Re: Disable user access to UI configuration
Posted: Mon Oct 22, 2018 12:27 pm
by kilianvp
you can use HOOK_ScreenConfiguration() this will ignore the checkbox and user can't override their config
for example:
Templates[1] is left Screen, Templates[2] is right Screen
Code: Select all
bool HOOK_ScreenConfiguration()
{
if(getScreenCount() == 2)
{
strptms_Basepanels[1] = "/TEMPLATE1/basePanel_$W_$H_TEMPLATE1";
strptms_Templates[1] = "TEMPLATE1";
strptms_Basepanels[2] = "/TEMPLATE2/basePanel_$W_$H_TEMPLATE2";
strptms_Templates[2] = "TEMPLATE2";
}
else
{
strptms_Basepanels[1] = "/TEMPLATE1/basePanel_$W_$H_TEMPLATE1";
strptms_Templates[1] = "TEMPLATE1";
}
return true;
}
Re: Disable user access to UI configuration
Posted: Mon Oct 22, 2018 1:34 pm
by NikolayLevchenko
Thanks Kilian,
That's a good start. At least I'll be able to force the correct settings. I'd still love to disable/hide the tickbox, I know the client will ask "why the hell is it there if it is not used?"
Re: Disable user access to UI configuration
Posted: Mon Oct 29, 2018 4:00 pm
by Gertjan van Schijndel
By creating a new login panel, adding the standard login panel as a reference and make the checkbox invisible by overriding the visible property, future upgrades should not be a problem.
3.16 introduces a config entry for the login panel, which is opened for re-login.
Re: Disable user access to UI configuration
Posted: Mon Nov 26, 2018 1:49 pm
by Dag-Are.Trydal@nov.com
Hi Gertjan
Can you please provide more information around this solution. I cannot see how you can change the visibility property of this check-box (or anything else for that matter) of the panel-reference.
I need a solution to auto-login and auto-select of screen. But at the same time I'd need the possibility of having a setting (in the config-file) that can allow the user to select what screen to use (if more than one is available)
To do this I have modified the initialize script of the login.pnl (and made everything in the panel invisible). After the original initialize this is added:
Code: Select all
int showScreenSelector;
paCfgReadValue(getPath(CONFIG_REL_PATH)+"config", "MySettings", "showScreenSelector", showScreenSelector);
if (showScreenSelector==1))
chkParaMm.state(0,true);
// Setting thes to -1 forces OA to choose default resolution
g_diXRes[myUiNumber()] = -1;
g_diYRes[myUiNumber()] = -1;
setMultiValue("name","text","root",
"password","text","");
logincheck(bAllowRemoteLogin);
This used to work, but with the latest patches of 3.15 (at least p14 & p15) it doesn't anymore. But if I remove my custom login.pnl, start up and select(enable) a screen on the remove running DesktopUi, reinserts my custon panel.pnl, and restart the remote running DesktopUi. Everything seems to work ok.
Why is this? And what is the good solution to this problem (as editing login.pnl isn't a good way) ?
Best regards, Dag-Are Trydal
Re: Disable user access to UI configuration
Posted: Tue Nov 27, 2018 3:36 pm
by Gertjan van Schijndel
Dag-Are Trydal wrote:
Can you please provide more information around this solution. I cannot see how you can change the visibility property of this check-box (or anything else for that matter) of the panel-reference.
1. Insert the panel reference
2. Use the 'Select object inside panelref' selector
3. Select the checkbox
4. Change the property
