Normal Topic Locked Record Possible Solution (Read 2136 times)
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Locked Record Possible Solution
Jan 23rd, 2016 at 11:37pm
Print Post Print Post  
Hey folks,

I have my administrator (who is not an IT person and does not have server admin access) running into issues occasionally with a locked record -- if it's someone in the local office, it's not an issue, but if it's a remote user, getting them out of the record in a timely basis, it's a little more problematic.

I'm looking for a potential solution -- are any of these options?

1) An 'override' button that will give our administrator access?

2) A Sesame or windows-based function that can remotely eject the user from sesame, without needing access to the server admin panel?

3) An idle counter that will exit a sesame client if it is unused for a specific period of time.

Are any of these viable options under 2.6.X?

Thanks!
Blair
  
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Locked Record Possible Solution
Reply #1 - Feb 4th, 2016 at 1:22am
Print Post Print Post  
Hey folks ... anyone?
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Locked Record Possible Solution
Reply #2 - Feb 4th, 2016 at 2:09pm
Print Post Print Post  
Any sort of override or disconnect option would need some sort of administrative access. If you trust this person enough to allow them to disconnect other users, can you trust them enough to use the administration panel?

I can investigate an idle timeout for Sesame 3.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Locked Record Possible Solution
Reply #3 - Feb 5th, 2016 at 1:51am
Print Post Print Post  
Hi Mark ... I do want to limit who can eject someone from a record ... but I'm doing that with checkbox limiters on a staff profile form. 

I trust the person to responsibly eject people, but not necessarily be technically savvy enough to use the administrative panel.

How about this -- if I use @Asynchshell and the 'taskkill' command function, I could potentially force other clients to close their sesame clients.  However, is there a way to retrieve the locking IP address of a given record, or send a pop-up message to a remote client to warn them their sesame executable might suddenly vanish if they don't get off the record?

Thanks!
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Locked Record Possible Solution
Reply #4 - Feb 5th, 2016 at 2:35pm
Print Post Print Post  
To kill a remote client, you would need to run taskkill on the remote client's computer. That would be a very serious security flaw - basically opening a "backdoor" onto that computer.

If Sesame gave you the IP of the locking computer, you could potentially contact that computer using any number of instant messaging or chat-like clients, or use the messaging system built into Sesame's administrative panel, which can also disconnect a client.

I haven't tried doing this, but it might be possible to put a global variable into your application for almost every event that gets set to the current time. Then use RunEntryOnInterval on a hidden element with a long interval, that checks the last time any other event has run against the current time. If the client has been idle too long, close the form/application.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Locked Record Possible Solution
Reply #5 - Feb 6th, 2016 at 3:54am
Print Post Print Post  
OK!  That gives me a great idea, if I can do the following:

1) Have the GlobalValue 'gKillIP' that can be altered by a 'Kill Button'.  The Kill Button would ask the Admin for a client IP (which they can see in the message bar at the bottom of the locked record), and then set the global value in the application.

2) Have every computer look up it's IP on logging in as a client and set the local global value 'gClientIP'.

3) Have RunEntryOnInterval check every 5 minutes to see if gKillIP = gClientIP, and if so, wipe the gKillIP global value to "", force the record to advance by F10, or exit the form.  If I'm feeling fancy have @MsgBox pop up to tell them they've been ejected.

Would this work?

If it would in theory, I need to figure out the following, because these areas of Sesame are unfamiliar to me.

- how to look up a local client ip when someone logs in?

- how to activate RunEntryOnEvent when entering a form, and looping in the background every 5 minutes or so (can that be done?  Will it tie up network resources?)

Am I on to something here?

Thanks!
  
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Locked Record Possible Solution
Reply #6 - Feb 6th, 2016 at 5:18am
Print Post Print Post  
OK ... part way there.  Simplified way to determine internal or external IP, because the server might identify a remote user by their external IP ... this is hacky code as heck, but it gets the job done for the moment ...

Code
Select All
var vLOCALIP as string
var vLOCALIP2 as string

vLOCALIP = @redirectprocess("ipconfig","")

vLocalIP = @replace(vLocalIP,";","-")
vLocalIP = @replace(vLocalIP,@newline(),";")
vLocalIP = @containsstringarray(vLocalIP,"IPv4",0)
vLocalIP = @replace(vLocalIP,":",";")
vLocalIP2 = @accessstringarray(vLocalIP,2)
vLocalIP2 = @appendstringarray(vLocalIP2,@accessstringarray(vLocalIP,4))
vLocalIP2 = @replace(vLocalIP2, " ","")

Writeln(vLOCALIP2)
 

  
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Locked Record Possible Solution
Reply #7 - Feb 8th, 2016 at 5:06pm
Print Post Print Post  
Success!

I've successfully launched a 'heartbeat' run on interval and kill button.  Happy to share my code.

Here's my Global Code that grabs the local IP and kicks in the heartbeat code:

Code
Select All
// ======================
// Grab Local IP of User
// ======================

gLOCALIP = @redirectprocess("ipconfig","")
gLocalIP = @replace(gLocalIP,";","-")
gLocalIP = @replace(gLocalIP,@newline(),";")
gLocalIP = @containsstringarray(gLocalIP,"IPv4",0)
gLocalIP = @replace(gLocalIP,":",";")

RunEntryOnInterval(DBColNot,120000)
 



Here's the heartbeat code that kicks in on form entry:

Code
Select All
var gKillIP as string

gKillIP = @GlobalValue("gKill")

if @instr(gLocalIP,gKillip) >0
{
	GlobalValue("gKill","")
	FormCommit("")
	@Save
	ExitSesame()
}
 



And here's the 'Kill User' button I've created:

Code
Select All
var gKill as string
var vKillUser as string

vKillUser = @PromptForUserInput("Which IP Would You Like To Kill?","")

if vKillUser<>""
{
	GlobalValue("gKill", vKillUser)
}
 



Ultimately, I'd love to leave a pop up screen independent of Sesame (I think I saw something I can co-opt out of InsideSesame) saying 'you've been kicked out', but otherwise I'm pretty happy with the way this works ...
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Locked Record Possible Solution
Reply #8 - Feb 22nd, 2016 at 4:03pm
Print Post Print Post  
Blair,

Did this actually work? In my experience, RunEntryOnInterval() does not work when placed in the Global Code event.

Are you sure you're not calling RunEntryOnInterval() from somewhere else too?
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged