Update - still working

This commit is contained in:
Astatin3
2024-02-09 18:52:05 -07:00
parent 0ea56990de
commit ef75228361
22 changed files with 461 additions and 85 deletions
+34 -5
View File
@@ -1,14 +1,43 @@
from modules.main import test as test
mm = None
def test1(ac, data):
mm.sendPopupColor(ac.rawClient, 'test!', 'test!', '#600060', True)
def logout(ac, data):
ac.send('redir', {
"location": "/"
})
mm.authServer.unauth(ac)
def loadSessions(ac):
obj = []
for client in mm.authServer.clients:
if client.user != ac.user:
continue
obj.append({
'username': client.username,
'address': client.rawClient.address,
'currentPage': client.currentPage,
'clientid': client.rawClient.clientid,
'timeout': client.timeout
})
# obj.append(client.session)
ac.send('sessions', obj)
def unauth(ac, data):
removeClient = mm.getAuthClientByID(data['data'])
if removeClient == None:
return
if removeClient.user == ac.user:
removeClient.send('redir', {
"location": "/"
})
mm.unauth(removeClient)
loadSessions(ac)
def init(moduleMaster):
global mm
mm = moduleMaster
mm.addAuthEventListener('test1', test1)
mm.addAuthEventListener('logout', logout)
mm.addAuthEventListener('unauth', unauth)
mm.addPageEventListener('/main/User', loadSessions)
def main():
pass