From f860c8d6dd72f8fda3b8308d9fb7949b9bba90cd Mon Sep 17 00:00:00 2001 From: dmcoles Date: Mon, 27 Nov 2023 11:25:55 +0000 Subject: [PATCH] extra checking to prevent users from logging onto mode than 1 node at the same time --- express.e | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/express.e b/express.e index 00cbefb..0c0c7e8 100644 --- a/express.e +++ b/express.e @@ -2960,19 +2960,30 @@ PROC checkUserOnLine(check) IF(check) loop:=0 error:=1 + + IF sopt.toggles[TOGGLES_MULTICOM] + ObtainSemaphore(masterNode) + ENDIF + REPEAT IF(loop=node) THEN loop++ IF sopt.toggles[TOGGLES_MULTICOM] status:=-1 - ObtainSemaphore(masterNode) sp:=(masterNode.myNode[loop].s) - ReleaseSemaphore(masterNode) IF sp ObtainSemaphore(sp) status:=sp.status ReleaseSemaphore(sp) + lock:=-1 + IF (status>=0) AND (status<>ENV_NOTACTIVE) AND (status<>ENV_SHUTDOWN) + IF(stringCompare(sp.handle,loggedOnUser.name)=RESULT_SUCCESS) + lock:=0 + error:=0 + ENDIF + ENDIF + status:=-1 ENDIF ELSE status:=0 @@ -2996,6 +3007,10 @@ PROC checkUserOnLine(check) ENDIF loop++ UNTIL (lock=NIL) OR (loop=MAX_NODES) + + IF sopt.toggles[TOGGLES_MULTICOM] + ReleaseSemaphore(masterNode) + ENDIF ELSE error:=1 ENDIF