mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-25 19:22:17 +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 fcntl
|
||||||
import struct
|
import struct
|
||||||
from uuid import getnode as get_mac
|
from uuid import getnode as get_mac
|
||||||
|
from base.Scope import Scope
|
||||||
|
|
||||||
|
|
||||||
class System:
|
class System:
|
||||||
|
def __init__(self):
|
||||||
|
scope = Scope().getInstance()
|
||||||
|
self.db_service = scope.getDbService()
|
||||||
|
self.logger = scope.getLogger()
|
||||||
|
|
||||||
class Ahenk(object):
|
class Ahenk(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -187,12 +193,17 @@ class System:
|
||||||
def user_details():
|
def user_details():
|
||||||
return psutil.users()
|
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
|
@staticmethod
|
||||||
def last_login_username():
|
def desktop(username):
|
||||||
# TODO
|
system = System()
|
||||||
pass
|
desktop = system.db_service.select_one_result('session', 'desktop', " username='{0}'".format(username))
|
||||||
|
return desktop
|
||||||
|
|
||||||
class Os(object):
|
class Os(object):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue