Disable user access to UI configuration

Find and share HowTos to various installations / configurations!
Search

Post Reply
6 posts • Page 1 of 1
NikolayLevchenko
Posts: 74
Joined: Wed May 10, 2017 3:34 pm

Disable user access to UI configuration

Post 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?

Image

User avatar
kilianvp
Posts: 443
Joined: Fri Jan 16, 2015 10:29 am

Re: Disable user access to UI configuration

Post 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;
}

NikolayLevchenko
Posts: 74
Joined: Wed May 10, 2017 3:34 pm

Re: Disable user access to UI configuration

Post 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?"

Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 10:37 am

Re: Disable user access to UI configuration

Post 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.

Dag-Are.Trydal@nov.com
Posts: 37
Joined: Fri Feb 26, 2016 11:52 am

Re: Disable user access to UI configuration

Post 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

Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 10:37 am

Re: Disable user access to UI configuration

Post 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

Image
Attachments
login.png

Post Reply
6 posts • Page 1 of 1