<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Force Logout When New User Logs In</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/e5f250c53e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Visualization/thread/e5f250c53e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Visualization/thread/e5f250c53e/</id><updated>2020-06-15T10:34:39.021000Z</updated><subtitle>Recent posts to Force Logout When New User Logs In</subtitle><entry><title>Force Logout When New User Logs In</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/e5f250c53e/?limit=25#f28c" rel="alternate"/><published>2020-06-15T10:34:39.021000Z</published><updated>2020-06-15T10:34:39.021000Z</updated><author><name>marci4</name><uri>https://forge.codesys.com/u/marci4/</uri></author><id>https://forge.codesys.comff5f921d1443ba73430885fbc4358e5be6738739</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello &lt;a class="user-mention" href="/u/jackcaissey/"&gt;@jackcaissey&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;attached you can find an example using the recommended way to look through all clients.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br/&gt;
Marcel&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Force Logout When New User Logs In</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/e5f250c53e/?limit=25#d91b" rel="alternate"/><published>2020-06-09T12:34:49.848000Z</published><updated>2020-06-09T12:34:49.848000Z</updated><author><name>jackcaissey</name><uri>https://forge.codesys.com/u/jackcaissey/</uri></author><id>https://forge.codesys.com9167fbbc1bd7247cb3c4c35d536fc97361223c4a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&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;BeginIteration&lt;/span&gt;&lt;span class="ss"&gt;()&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;isLoggedIn&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
        &lt;span class="k"&gt;WHILE&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;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;GetNextClient&lt;/span&gt;&lt;span class="ss"&gt;())&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;DO&lt;/span&gt;
            &lt;span class="k"&gt;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;GlobalData&lt;/span&gt;.&lt;span class="nv"&gt;CurrentUserName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;loggedInUser&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
                &lt;span class="k"&gt;EXIT&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_WHILE&lt;/span&gt;
        &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;NOT&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="mi"&gt;0&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;VisuElems&lt;/span&gt;.&lt;span class="nv"&gt;Visu_FctLogoutUser&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;pClient&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
            &lt;span class="nv"&gt;loggedInUser&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;VisuNativeControl&lt;/span&gt;.&lt;span class="nv"&gt;CurrentFullUserName&lt;/span&gt;&lt;span class="c1"&gt;;      //record new logged in user&lt;/span&gt;
        &lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;span class="k"&gt;ELSE&lt;/span&gt;                                                                    &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nv"&gt;there&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s no logged in user on record&lt;/span&gt;
    &lt;span class="nv"&gt;LoggedInUser&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;VisuNativeControl&lt;/span&gt;.&lt;span class="nv"&gt;CurrentFullUserName&lt;/span&gt;&lt;span class="c1"&gt;;              //logged in user on record is set to the name newly entered&lt;/span&gt;
    &lt;span class="nv"&gt;isLoggedIn&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;;                                                 //logged in state is changed to true&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;What this should do (or at least what I hope it should do) is iterate through the list of active users until it finds a user with a username which matches the recorded logged in user's username. Once this is found it should logout the user then record the new user's username. If no user is logged in then it skips this and simply logs in whichever user decides to log in.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Force Logout When New User Logs In</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/e5f250c53e/?limit=25#3545" rel="alternate"/><published>2020-06-09T05:39:28.970000Z</published><updated>2020-06-09T05:39:28.970000Z</updated><author><name>m.prestel</name><uri>https://forge.codesys.com/u/mprestel/</uri></author><id>https://forge.codesys.com7f4b722fd6a6875c0983b9cbf57b71de94bd281e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello &lt;a class="user-mention" href="/u/jackcaissey/"&gt;@jackcaissey&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;you should be able to logout a user with this internal function.&lt;br/&gt;
Could you provide a example project?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br/&gt;
Marcel&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Force Logout When New User Logs In</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/e5f250c53e/?limit=25#d168" rel="alternate"/><published>2020-06-08T19:45:18.080000Z</published><updated>2020-06-08T19:45:18.080000Z</updated><author><name>jackcaissey</name><uri>https://forge.codesys.com/u/jackcaissey/</uri></author><id>https://forge.codesys.comedcd5bfaecac84374ceea56ff61686fd92e8d654</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello all,&lt;/p&gt;
&lt;p&gt;What I have been trying to do is create a program which checks to see if a new user has logged in, and if a new user has logged in, force logout existing users. I am trying to do this by checking to see if VisuNativeControl.CurrentFullUserName does not equal the logged in user on record. When this condition is met, the program will call VisuElems.Visu_FctLogoutUser(pClient) where pClient is a pointer to  VisuElems.VisuElemBase.VisuStructClientData. This method does not seem to actually log out the existing user. Is there some other method which can be used to log out the user? Please let me know&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>