Logic Machine Forum
Link protection with PIN? - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Link protection with PIN? (/showthread.php?tid=1018)



Link protection with PIN? - Habib - 29.09.2017

Hi,

I need for a project a PIN Protection on an internal link. Is this possible?

I mean the same dialog like the protection on an KNX Object in Visu.

I use a spaceLYnk with 2.0.1 Fw.

thx forwards


RE: Link protection with PIN? - admin - 29.09.2017

Set Additional classes of your element to mylink, add this code to custom JavaScript (change pin from 1234 and URL as needed):
Code:
$(function(){
  $('.mylink').off('vclick').on('vclick', function(e) {
    showPincode('1234', {
      callback: function() {
        window.location = 'https://forum.logicmachine.net/';
      }
    });
    
    return $.stopEvent(e);
  });
});



RE: Link protection with PIN? - Habib - 29.09.2017

Hi Admin,

thx for your help, but do you shure that the SL with Fw 2.0.1 has the possibility to add custom javascript? 

If yes, I can't find the correct position to set the code...

Here a screenshot from my menu bar:

   

Sorry... I found it....

Thank you, it works, but now I need the correct URL I've to use for the script.
The whole URL is like: http://192.168.110.117/scada-vis/#3 and the link is set on http://192.168.110.117/scada-vis/#2

If I use the URL http://192.168.110.117/scada-vis/#3 in the custom JS, then it opens the whole page and needs new password :-(
It should work like the build-in "link to" function.

Can you help me again, please?


RE: Link protection with PIN? - admin - 29.09.2017

If you want to protect a certain plan or level you can just set PIN in Vis. structure


RE: Link protection with PIN? - Habib - 29.09.2017

Thank you, that is exactly what I'm looking for :-)
It's just build-in  Big Grin Smile Smile


RE: Link protection with PIN? - savaskorkmaz - 06.07.2021

Hi there , i need this function for my link to certain page but i dont want tu use PIN in VisStructure. Can you update Javascript for a page ID instead of external link.

$(function(){
  $('.mylink').off('vclick').on('vclick', function(e) {
    showPincode('1234', {
      callback: function() {
        window.location = 'https://forum.logicmachine.net/';
      }
    });
    
    return $.stopEvent(e);
  });
});


RE: Link protection with PIN? - admin - 06.07.2021

This example will not work with the latest firmware. For security reasons PIN check is done on the server side so a custom check like this is not possible anymore.