Добавлена установка метки для быстрого входа в сеанс

develop 3.3.1.1
Mike Khiretskiy 9 years ago
parent aca30643c0
commit f613295f7b

@ -29,7 +29,8 @@ from calculate.lib.cl_template import (Template, ProgressTemplate,
TemplatesError,templateFunction,iniParser) TemplatesError,templateFunction,iniParser)
from calculate.lib.utils.files import (runOsCommand, isMount,process, from calculate.lib.utils.files import (runOsCommand, isMount,process,
getRunCommands,STDOUT,childMounts,getLoopFromPath, getRunCommands,STDOUT,childMounts,getLoopFromPath,
getMdRaidDevices,listDirectory,removeDir) getMdRaidDevices,listDirectory,removeDir,
makeDirectory)
from calculate.lib.utils.common import (getpathenv,appendProgramToEnvFile, from calculate.lib.utils.common import (getpathenv,appendProgramToEnvFile,
removeProgramToEnvFile,mountEcryptfs, removeProgramToEnvFile,mountEcryptfs,
CommonError, isBootstrapDataOnly) CommonError, isBootstrapDataOnly)
@ -245,6 +246,23 @@ class Desktop:
return False return False
return True return True
def setFastlogin(self, urLogin):
"""
Отметить пользователя, что для него может быть
использовать "быстрой логин"
"""
fastlogin = self.clVars.Get('cl_desktop_fastlogin_path')
if not path.exists(fastlogin):
makeDirectory(fastlogin)
fastlogin_user = path.join(fastlogin, urLogin)
if not path.exists(fastlogin_user):
try:
open(fastlogin_user,'w').close()
return True
except:
self.printWARNING(_("Failed to create the fastlogin mark file"))
return False
def userLogout(self, urLogin): def userLogout(self, urLogin):
""" """
Выполнить logout пользователя через dbus Выполнить logout пользователя через dbus

@ -92,6 +92,11 @@ class ClDesktopAction(Action):
'condition':lambda Get: Get('cl_desktop_force_setup_set') == 'on' or \ 'condition':lambda Get: Get('cl_desktop_force_setup_set') == 'on' or \
Get('cl_desktop_update_profile_set') == 'on' Get('cl_desktop_update_profile_set') == 'on'
}, },
{'name':'fast_login',
'method':'Desktop.setFastlogin(ur_login)',
'essential':False,
'condition':lambda Get: Get('ur_domain_set') == 'off'
},
# отключить ресурсы подключенные в каталоге пользователя # отключить ресурсы подключенные в каталоге пользователя
{'name':'umount_userres', {'name':'umount_userres',
'message': _("Unmouning user resources"), 'message': _("Unmouning user resources"),

@ -406,3 +406,10 @@ class VariableClDesktopHashFace(Variable):
hashlib.md5(login).digest()))%len(icon_list)]) hashlib.md5(login).digest()))%len(icon_list)])
else: else:
return "" return ""
class VariableClDesktopFastloginPath(ReadonlyVariable):
"""
Путь до каталога в котором указаны пользователи быстрого входа в сеанс
"""
value = "/var/lib/calculate/calculate-desktop/fastlogin"

Loading…
Cancel
Save