mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-12-23 14:32:18 +03:00
user display and desktop manager is storing in db
This commit is contained in:
parent
4cd85c8bce
commit
178ca598fe
1 changed files with 15 additions and 4 deletions
|
@ -12,9 +12,15 @@ import socket
|
|||
import fcntl
|
||||
import struct
|
||||
from uuid import getnode as get_mac
|
||||
from base.Scope import Scope
|
||||
|
||||
|
||||
class System:
|
||||
def __init__(self):
|
||||
scope = Scope().getInstance()
|
||||
self.db_service = scope.getDbService()
|
||||
self.logger = scope.getLogger()
|
||||
|
||||
class Ahenk(object):
|
||||
|
||||
@staticmethod
|
||||
|
@ -187,12 +193,17 @@ class System:
|
|||
def user_details():
|
||||
return psutil.users()
|
||||
|
||||
|
||||
@staticmethod
|
||||
def display(username):
|
||||
system = System()
|
||||
display = system.db_service.select_one_result('session', 'display', " username='{0}'".format(username))
|
||||
return display
|
||||
|
||||
@staticmethod
|
||||
def last_login_username():
|
||||
# TODO
|
||||
pass
|
||||
def desktop(username):
|
||||
system = System()
|
||||
desktop = system.db_service.select_one_result('session', 'desktop', " username='{0}'".format(username))
|
||||
return desktop
|
||||
|
||||
class Os(object):
|
||||
|
||||
|
|
Loading…
Reference in a new issue