General Discussions
How do I add VTScada's native account fields to my supervisor?

How do I add VTScada's native account fields to my supervisor? I need to create a login screen, as it will be for teachers and students, and each user has their respective permissions.

65c14dc93b0e3

65c14e1ec2ee6

How do I add VTScada's native account fields to my supervisor? I need to create a login screen, as it will be for teachers and students, and each user has their respective permissions. ![65c14dc93b0e3](serve/attachment&path=65c14dc93b0e3) ![65c14e1ec2ee6](serve/attachment&path=65c14e1ec2ee6)
edited Sep 30 at 1:28 pm

This is posted in another thread also, but you can copy the following into page code of a new page to get started. You will also want to set page privileges to prevent logged off users from accessing areas of your application:

[
  Title = "/PMfLJ/DR";
  Color = "<FF409FFF>";
  Result = "";
  Username = "";
  Password = "";
  PageX;
  PageY;
  PageHeight = 768;
  PageWidth = 1024;
  PageMinWidth;
  PageMinHeight;
  PageVWidth;
  PageVHeight;
  InputWidth = 150;
  InputHeight = 20;
  ButtonWidth = 150;
  ButtonHeight = 25;
  SecBit = 17;
]

Main [
  Return(Self);

  \System.Edit(PageWidth/2-InputWidth/2, PageHeight/4 { Top left corner - fixed },
              PageWidth/2+InputWidth/2, PageHeight/4+InputHeight { Bottom right corner  }, 
              "Username" { Title }, 
              Username { Var to update } 
              { Remainder of parameters not used, so omitted });

  \System.Edit(PageWidth/2-InputWidth/2, PageHeight/4+InputHeight+50 { Top left corner - fixed },
              PageWidth/2+InputWidth/2, PageHeight/4+2*50+2*InputHeight { Bottom right corner  }, 
              "Password" { Title }, 
              Password { Var to update },
              invalid, invalid, invalid, invalid, invalid, invalid, invalid, invalid, invalid {Optional arguments not set},
              0b000000010000 {Style set to mask input}
              { Remainder of parameters not used, so omitted }); 

  If Winbutton(PageWidth/2-ButtonWidth/2, PageHeight/4+3*50+2*InputHeight, PageWidth/2+ButtonWidth/2, PageHeight/4+2*50+2*InputHeight+ButtonHeight, 0, "Login", 1, \_DialogFont);
  [
    Result = \SecurityManager.QuietLogon(Concat(Username,":",Password));
    Username = "";
    Password = "";
    IfThen(Result == 1,
     Execute(Result=0, 
     \DisplayManager\ShowPage("Overview", 0))
    );
  ]

  {Background Fade}
  GUITransform(0, 768, 1024, 41,
               1, 1, 1, 1, 1 { Scaling              },
               0, 0          { Movement             },
               1, 0          { Visibility, Reserved },
               0, 0, 0       { Selectability        },
               Scope(\Code, "Library", TRUE)\Bitmap(\ImageParmSet("Bitmaps\Lighting Overlays\Transparent\LowerRightToUpperLeftFade.png", "<FFFF40FF>", 0, 0, Invalid, 0.5, 1.4, 1, 0, 1, 0, 0), Invalid, 0, 1, 1, 0.5, 1, 0, 0, 0, 0, 0, "<FFFFFFFF>", 0, 0));
]
This is posted in another thread also, but you can copy the following into page code of a new page to get started. You will also want to set page privileges to prevent logged off users from accessing areas of your application: ```` [ Title = &quot;/PMfLJ/DR&quot;; Color = &quot;&lt;FF409FFF&gt;&quot;; Result = &quot;&quot;; Username = &quot;&quot;; Password = &quot;&quot;; PageX; PageY; PageHeight = 768; PageWidth = 1024; PageMinWidth; PageMinHeight; PageVWidth; PageVHeight; InputWidth = 150; InputHeight = 20; ButtonWidth = 150; ButtonHeight = 25; SecBit = 17; ] Main [ Return(Self); \System.Edit(PageWidth/2-InputWidth/2, PageHeight/4 { Top left corner - fixed }, PageWidth/2+InputWidth/2, PageHeight/4+InputHeight { Bottom right corner }, &quot;Username&quot; { Title }, Username { Var to update } { Remainder of parameters not used, so omitted }); \System.Edit(PageWidth/2-InputWidth/2, PageHeight/4+InputHeight+50 { Top left corner - fixed }, PageWidth/2+InputWidth/2, PageHeight/4+2*50+2*InputHeight { Bottom right corner }, &quot;Password&quot; { Title }, Password { Var to update }, invalid, invalid, invalid, invalid, invalid, invalid, invalid, invalid, invalid {Optional arguments not set}, 0b000000010000 {Style set to mask input} { Remainder of parameters not used, so omitted }); If Winbutton(PageWidth/2-ButtonWidth/2, PageHeight/4+3*50+2*InputHeight, PageWidth/2+ButtonWidth/2, PageHeight/4+2*50+2*InputHeight+ButtonHeight, 0, &quot;Login&quot;, 1, \_DialogFont); [ Result = \SecurityManager.QuietLogon(Concat(Username,&quot;:&quot;,Password)); Username = &quot;&quot;; Password = &quot;&quot;; IfThen(Result == 1, Execute(Result=0, \DisplayManager\ShowPage(&quot;Overview&quot;, 0)) ); ] {Background Fade} GUITransform(0, 768, 1024, 41, 1, 1, 1, 1, 1 { Scaling }, 0, 0 { Movement }, 1, 0 { Visibility, Reserved }, 0, 0, 0 { Selectability }, Scope(\Code, &quot;Library&quot;, TRUE)\Bitmap(\ImageParmSet(&quot;Bitmaps\Lighting Overlays\Transparent\LowerRightToUpperLeftFade.png&quot;, &quot;&lt;FFFF40FF&gt;&quot;, 0, 0, Invalid, 0.5, 1.4, 1, 0, 1, 0, 0), Invalid, 0, 1, 1, 0.5, 1, 0, 0, 0, 0, 0, &quot;&lt;FFFFFFFF&gt;&quot;, 0, 0)); ] ````

Trihedral Engineering Ltd.

I copied the code and placed it in the Source Code tab, but the page does not update. The fields do not appear. How do I do that? I'm new to using VTScada, forgive the silly questions.

I copied the code and placed it in the Source Code tab, but the page does not update. The fields do not appear. How do I do that? I&#039;m new to using VTScada, forgive the silly questions.

After you put your custom code in, you need to click the import button in the VAM to bring the code into the application.

This allows you to update multiple files and prep code changes in a running application.

65ca26fedf301

After you put your custom code in, you need to click the import button in the VAM to bring the code into the application. This allows you to update multiple files and prep code changes in a running application. ![65ca26fedf301](serve/attachment&amp;path=65ca26fedf301)

Trihedral Engineering Ltd.

edited Feb 12 at 2:15 pm

I did it here, but it seems to disappear the page. I can't access it.

I did it here, but it seems to disappear the page. I can&#039;t access it.

Id suggest you should have a look at the help files and learn a bit about VTScada page code. Get familiar with the layout of page code and go from there. The idea of the template is to give you something to work from.

My guess is that you may want to keep the title definition from an existing page when you put the above code in. The example has a reference to text which may not exist on your current application and that may cause issues.

Id suggest you should have a look at the help files and learn a bit about VTScada page code. Get familiar with the layout of page code and go from there. The idea of the template is to give you something to work from. My guess is that you may want to keep the title definition from an existing page when you put the above code in. The example has a reference to text which may not exist on your current application and that may cause issues.

Trihedral Engineering Ltd.

edited Feb 12 at 5:46 pm

Well, I changed the page title. I also assume you have an image "LowerRightToUpperLeftFade.png" which I don't have here

Well, I changed the page title. I also assume you have an image &quot;LowerRightToUpperLeftFade.png&quot; which I don&#039;t have here

I made a video demonstrating the problem and will post it here for viewing.

video demonstrating the problem: https://youtu.be/r1youfDWFt0

I made a video demonstrating the problem and will post it here for viewing. video demonstrating the problem: [https://youtu.be/r1youfDWFt0](https://youtu.be/r1youfDWFt0 &quot;https://youtu.be/r1youfDWFt0&quot;)
edited Feb 13 at 10:56 am

I'm feeling a need to comment on this discussion.

The code that Dave posted will certainly work. But I can't recommend using it. Here's why:
The engineers at Trihedral seldom write custom code when developing applications. They can. They're very, very good at it. And most of them are within meters of developers who are expert at it. But they always make an effort to avoid doing so unless they absolutely have to.

Why?
Because custom code means extra risk in a project. It means future compatibility problems when some key thing changes in 10 or 20 years. It means that only someone who's good at writing VTScada code can maintain the project. In short, it means trouble.

By all means, write code when there's no other solution. That's why it's documented. But when there's a perfectly serviceable way to do something using built-in features (like the Sign In button in this case) then don't write custom code.

I&#039;m feeling a need to comment on this discussion. The code that Dave posted will certainly work. But I can&#039;t recommend using it. Here&#039;s why: The engineers at Trihedral seldom write custom code when developing applications. They can. They&#039;re very, very good at it. And most of them are within meters of developers who are expert at it. But they _always_ make an effort to avoid doing so unless they absolutely have to. Why? Because custom code means extra risk in a project. It means future compatibility problems when some key thing changes in 10 or 20 years. It means that only someone who&#039;s good at writing VTScada code can maintain the project. In short, it means trouble. By all means, write code when there&#039;s no other solution. That&#039;s why it&#039;s documented. But when there&#039;s a perfectly serviceable way to do something using built-in features (like the Sign In button in this case) then don&#039;t write custom code.
185
8
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft