This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

User Access
#1
Hi, trying to find a way of forcibly logging out all Users by using a script on a central controller when the central Admin runs a script.
We have 5 CBUS controllers and 1 Central Controller that uses Frames to look at individual Controllers.
But when we have an "Open Evening" event We want to stop any user from using the Local controllers until the "Open Evening" event has finished.

Any help and advice would be grateful.
Reply
#2
Hi,

With custom JS you can add a listener to a object and force a redirect to /logout.

BR,

Erwin
Reply
#3
(23.06.2018, 21:10)Erwin van der Zwart Wrote: Hi,

With custom JS you can add a listener to a object and force a redirect to /logout.

BR,

Erwin

Thank you for the info. Please could you point me in the right place to look at the coding to active what you have suggested.
Reply
#4
Hi,

Try something like this:
Code:
$(function(){
  grp.listen('1/1/1', function(object, state) {
     if (state == 'value' && object.value == true) {
        $(location).attr('href', 'http://' + location.hostname + '/logout')
     }
  }, false); // set to true to respond on same value
});
BR,

Erwin
Reply
#5
Another solution is to put a masking element above the whole visualization page when object value is true.
Custom JavaScript:
Code:
$(function() {
  if (typeof grp != 'object') {
    return;
  }

  var mask = $('<div>')
    .css({
      'position': 'absolute',
      'top': 0,
      'bottom': 0,
      'left': 0,
      'right': 0,
      'background-color': '#000',
      'z-index': 99999,
    })
    .addClass('hide')
    .appendTo('body');

  grp.listen('1/1/1', function(object) {
    mask.toggleClass('hide', object.value != true);
  });
});
Reply
#6
(25.06.2018, 09:41)admin Wrote: Another solution is to put a masking element above the whole visualization page when object value is true.
Custom JavaScript:
Code:
$(function() {
 if (typeof grp != 'object') {
   return;
 }

 var mask = $('<div>')
   .css({
     'position': 'absolute',
     'top': 0,
     'bottom': 0,
     'left': 0,
     'right': 0,
     'background-color': '#000',
     'z-index': 99999,
   })
   .addClass('hide')
   .appendTo('body');

 grp.listen('1/1/1', function(object) {
   mask.toggleClass('hide', object.value != true);
 });
});
Thanks you. I will give it a try when i get a chance to log onto site again.
Reply


Forum Jump: