<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/</id><updated>2021-03-05T22:31:45.960000Z</updated><subtitle>Recent posts to Custom User Login Dialog</subtitle><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#8d7f" rel="alternate"/><published>2021-03-05T22:31:45.960000Z</published><updated>2021-03-05T22:31:45.960000Z</updated><author><name>dgirard</name><uri>https://forge.codesys.com/u/dgirard/</uri></author><id>https://forge.codesys.comf6bfc445f289e17bc451ded58d8e081d7ba0620e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;@m.prestel thank you for the info. &lt;/p&gt;
&lt;p&gt;I have got it mostly working now. The only thing remaining is retrieving the FullUserName from the internal user database. Does anyone know a command or method for that? I can't seem to find anything for this, but I would expect there to be a method that could return this similar to VisuUserManagement.g_VisuUserMgmt2.CheckLogin().&lt;/p&gt;
&lt;p&gt;Here is what is working so far: (please note that so long as the username and fullusername are the same, this code works fine)&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;pclient2&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;VisuElems&lt;/span&gt;.&lt;span class="nv"&gt;VisuElemBase&lt;/span&gt;.&lt;span class="nv"&gt;g_ClientManager&lt;/span&gt;.&lt;span class="nv"&gt;GetClientData&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;pClient2ID&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;; //pClient2ID comes from button on Visualization&lt;/span&gt;
&lt;span class="nv"&gt;LoginButton_R_TRIG&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;clk&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;LoginButton&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;arr&lt;/span&gt;[&lt;span class="mi"&gt;0&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="nv"&gt;arr&lt;/span&gt;[&lt;span class="mi"&gt;1&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;LoginButton_R_TRIG&lt;/span&gt;.&lt;span class="nv"&gt;Q&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="nv"&gt;LoginOK&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;VisuUserManagement&lt;/span&gt;.&lt;span class="nv"&gt;g_VisuUserMgmt2&lt;/span&gt;.&lt;span class="nv"&gt;CheckLogin&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;STRING_TO_WSTRING&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;, &lt;span class="nv"&gt;STRING_TO_WSTRING&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;password&lt;/span&gt;&lt;span class="ss"&gt;))&lt;/span&gt;&lt;span class="c1"&gt;; //check for valid username and password&lt;/span&gt;
    &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;LoginOK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;VisuUserManagement&lt;/span&gt;.&lt;span class="nv"&gt;VUM_ReturnValues&lt;/span&gt;.&lt;span class="nv"&gt;ERR_OK&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; 
        &lt;span class="nv"&gt;VisuUserManagement&lt;/span&gt;.&lt;span class="nv"&gt;g_VisuUserMgmt2&lt;/span&gt;.&lt;span class="nv"&gt;LoginToUserGroups&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;pClient2&lt;/span&gt;, &lt;span class="nv"&gt;ADR&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;arr&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;, &lt;span class="mi"&gt;3&lt;/span&gt;, &lt;span class="nv"&gt;STRING_TO_WSTRING&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;, &lt;span class="nv"&gt;STRING_TO_WSTRING&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="ss"&gt;))&lt;/span&gt;&lt;span class="c1"&gt;; //login the user&lt;/span&gt;
        &lt;span class="nv"&gt;LoginMessage&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;LOGIN SUCCESFUL&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;ELSIF&lt;/span&gt; &lt;span class="nv"&gt;LoginOK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;VisuUserManagement&lt;/span&gt;.&lt;span class="nv"&gt;VUM_ReturnValues&lt;/span&gt;.&lt;span class="nv"&gt;ERR_VUM_USER_DOES_NOT_EXIST&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
        &lt;span class="nv"&gt;LoginMessage&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;INVALID USERNAME&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;ELSIF&lt;/span&gt; &lt;span class="nv"&gt;LoginOK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;VisuUserManagement&lt;/span&gt;.&lt;span class="nv"&gt;VUM_ReturnValues&lt;/span&gt;.&lt;span class="nv"&gt;ERR_VUM_WRONG_PASSWORD&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
        &lt;span class="nv"&gt;LoginMessage&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;INVALID PASSWORD&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;END_IF&lt;/span&gt;                  
&lt;span class="nv"&gt;END_IF&lt;/span&gt;  
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#1c19" rel="alternate"/><published>2021-03-05T06:26:44.597000Z</published><updated>2021-03-05T06:26:44.597000Z</updated><author><name>m.prestel</name><uri>https://forge.codesys.com/u/mprestel/</uri></author><id>https://forge.codesys.com255a23482b003f67a2946b600f5143ed196121fe</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The problem is that you are iterating over all clients with your ST Code and log in every client.&lt;/p&gt;
&lt;p&gt;First of all you should never iterate over all clients with this function outside of the visu task. If you have to iterate, use VisuUtils.&lt;/p&gt;
&lt;p&gt;Secondly, you can get the current client in the mouse click action.&lt;br/&gt;
Call a function in your input action and include the argument pClientData.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br/&gt;
Marcel&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#f5c6" rel="alternate"/><published>2021-03-04T19:15:14.103000Z</published><updated>2021-03-04T19:15:14.103000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com9927a9d5328a58742d2aafb116d4b00bba7d3056</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;maybe worth to check with current version.. if possible.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#8e5b" rel="alternate"/><published>2021-03-04T17:04:54.228000Z</published><updated>2021-03-04T17:04:54.228000Z</updated><author><name>dgirard</name><uri>https://forge.codesys.com/u/dgirard/</uri></author><id>https://forge.codesys.comfc2d7e5559a3d067f2e7b84ecafc628de28a5462</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;V3.5 SP15&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#a83a" rel="alternate"/><published>2021-03-04T17:03:34.386000Z</published><updated>2021-03-04T17:03:34.386000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com5cc4f3de40e7ff4f5f149b5494c8b783f1176332</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;which version are you using?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#3044" rel="alternate"/><published>2021-03-04T16:21:18.950000Z</published><updated>2021-03-04T16:21:18.950000Z</updated><author><name>dgirard</name><uri>https://forge.codesys.com/u/dgirard/</uri></author><id>https://forge.codesys.comd7a7f6d3f7506bb83c5a26bad4bbd5a1b50e1480</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for the resources!&lt;/p&gt;
&lt;p&gt;No, it only logs me into the TargetVisu, none of my Webvisu will get logged in even if I am pressing the login button on the Webvisu Visualization.&lt;/p&gt;
&lt;p&gt;I need a way to detect which client has pressed the button and log in that specific client. Any idea how to achieve this?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#8ea9" rel="alternate"/><published>2021-03-04T16:13:33.523000Z</published><updated>2021-03-04T16:13:33.523000Z</updated><author><name>Morberis</name><uri>https://forge.codesys.com/u/morberis/</uri></author><id>https://forge.codesys.com5af8de11f0b11d1e0c940ce59f4736d0a7605eb6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hmm so if you login in 1 client it logs in on all the visualization clients? Do you get the same behavior if you use the normal login dialogues? And are all the visualization clients locked into viewing the same pages or can they all look at a different page?&lt;/p&gt;
&lt;p&gt;I remember something about this but I'm sorry I can't seem to find any good info. &lt;/p&gt;
&lt;p&gt;I did find this page, &lt;a class="" href="https://faq.codesys.com/pages/viewpage.action?pageId=22118438" rel="nofollow"&gt;Using Events of the User Management (Login/Logout)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You might find an answer in the &lt;a class="" href="https://forge.codesys.com/prj/codesys-example/client-independ/home/Home/"&gt;Client Independent Visualization Switching&lt;/a&gt; example project.&lt;/p&gt;
&lt;p&gt;I also found &lt;a class="" href="https://forge.codesys.com/forge/talk/Visualization/thread/246970e8ea/"&gt;this post&lt;/a&gt; which is of dubious help here. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#b299" rel="alternate"/><published>2021-03-03T21:54:36.509000Z</published><updated>2021-03-03T21:54:36.509000Z</updated><author><name>dgirard</name><uri>https://forge.codesys.com/u/dgirard/</uri></author><id>https://forge.codesys.com4661a0203a5a558c673a4e72b6131fcfa2803219</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks @Morberis, the example on the pi page was very helpful and has me headed in the right direction.&lt;/p&gt;
&lt;p&gt;One question for yous: the code snip below will log me in automatically, but regardless of which visualization I log in from, it will always log me into the TargetVisu. Do you know what is missing so that it will log me into the visualization from which the login button was pressed? I'm assuming it has to do with detecting the press of the button and matching it to the proper pclient?&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;LoginButton_R_TRIG&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;clk&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;LoginButton&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;BooleanTest&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;TRUE&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;BooleanTest&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
        &lt;span class="nv"&gt;VisuElems&lt;/span&gt;.&lt;span class="nv"&gt;g_ClientManager&lt;/span&gt;.&lt;span class="nv"&gt;BeginIteration&lt;/span&gt;&lt;span class="ss"&gt;()&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
        &lt;span class="nv"&gt;pClient&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;VisuElems&lt;/span&gt;.&lt;span class="nv"&gt;g_ClientManager&lt;/span&gt;.&lt;span class="nv"&gt;GetNextClient&lt;/span&gt;&lt;span class="ss"&gt;()&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;

        &lt;span class="k"&gt;WHILE&lt;/span&gt; &lt;span class="nv"&gt;pClient&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;VisuElems&lt;/span&gt;.&lt;span class="nv"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DO&lt;/span&gt; 
            &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;pClient&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;.&lt;span class="nv"&gt;GlobalData&lt;/span&gt;.&lt;span class="nv"&gt;CurrentUserGroupId&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; 
                &lt;span class="nv"&gt;arr&lt;/span&gt;[&lt;span class="mi"&gt;0&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
                &lt;span class="nv"&gt;arr&lt;/span&gt;[&lt;span class="mi"&gt;1&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
                &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;LoginButton_R_TRIG&lt;/span&gt;.&lt;span class="nv"&gt;Q&lt;/span&gt; &lt;span class="nv"&gt;HEN&lt;/span&gt;
                    &lt;span class="nv"&gt;VisuUserManagement&lt;/span&gt;.&lt;span class="nv"&gt;g_VisuUserMgmt2&lt;/span&gt;.&lt;span class="nv"&gt;LoginToUserGroups&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;pClient&lt;/span&gt;, &lt;span class="nv"&gt;ADR&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;arr&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;, &lt;span class="mi"&gt;3&lt;/span&gt;, &lt;span class="nv"&gt;STRING_TO_WSTRING&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;, &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Operator&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
                &lt;span class="nv"&gt;END_IF&lt;/span&gt;  
            &lt;span class="nv"&gt;END_IF&lt;/span&gt; 

        &lt;span class="nv"&gt;pClient&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;VisuElems&lt;/span&gt;.&lt;span class="nv"&gt;g_ClientManager&lt;/span&gt;.&lt;span class="nv"&gt;GetNextClient&lt;/span&gt;&lt;span class="ss"&gt;()&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;

        &lt;span class="nv"&gt;END_WHILE&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Thanks in advance!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#9aea" rel="alternate"/><published>2021-03-03T16:29:58.556000Z</published><updated>2021-03-03T16:29:58.556000Z</updated><author><name>Morberis</name><uri>https://forge.codesys.com/u/morberis/</uri></author><id>https://forge.codesys.comff8c03ac02a7af6a682dc07a83598b4edd304cb4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I can say that the same behavior is observed on both Eaton's XV100 and XV300 machines. The XV100 is the worst of the 2 being much older taking several seconds per button press using the login dialogue's keyboard. It's a problem they've acknowledged before but one without a solution.It can even be a problem when using a webvisu provided by an XV100. All they recommend is using their suggested visualization style or switching to using 1 of their visualization software products like Visual Designer or Galileo. It is also a hardware issue. I don't experience the same problems when using either of their products.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Custom User Login Dialog</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/6795e037af/?limit=25#11dc" rel="alternate"/><published>2021-03-03T16:05:18.682000Z</published><updated>2021-03-03T16:05:18.682000Z</updated><author><name>dgirard</name><uri>https://forge.codesys.com/u/dgirard/</uri></author><id>https://forge.codesys.com76047c4ff223388cc8ddde164accea1e2c3b5c49</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for the feedback. &lt;/p&gt;
&lt;p&gt;To simplify things: What can I do to make the text boxes in the attached Capture take in the username and password? How can I make the Login button initiate the login code?&lt;/p&gt;
&lt;p&gt;For example: VisuUserManagement.g_VisuLoginProviderManager.m_arrLoginProvider&lt;span&gt;[iIndexLoginProvider]&lt;/span&gt;.stUserName&lt;/p&gt;
&lt;p&gt;^^This doesn't seem to work.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>