Добавлена настройка пользовательской сессии (автовход, шифрование)

master3.3
Mike Khiretskiy 10 years ago
parent 32456cc0ff
commit f9a562ea34

@ -121,14 +121,14 @@ class ClSetupNetworkAction(ClSetupSystemAction):
successMessage = __("Network settings configured!")
failedMessage = __("Failed to configure the network settings!")
class ClSetupUsersAction(ClSetupSystemAction):
class ClSetupSessionAction(ClSetupSystemAction):
"""
Действие для настройки пользовательских параметров
"""
addon_tasks = []
templateTaskMessage = __("The user settings are being configured")
successMessage = __("User settings configured!")
failedMessage = __("Failed to configure the user settings!")
templateTaskMessage = __("The session settings are being configured")
successMessage = __("Session settings configured!")
failedMessage = __("Failed to configure the session settings!")
class ClSetupBootAction(ClSetupSystemAction):
"""

@ -20,7 +20,8 @@ import re
from os import path
from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable, \
TableVariable,PasswordError, \
ReadonlyTableVariable,FieldValue
ReadonlyTableVariable,FieldValue, \
DataVarsError
from calculate.install.fs_manager import FileSystemManager
from calculate.lib.utils.files import (readFile,getProgPath,process,
readLinesFile)
@ -338,6 +339,19 @@ class VariableClAutologin(UserHelper,Variable):
def humanReadable(self):
return self.Get() or _("Not used")
def uncompatible(self):
"""
Network setting up unavailable for flash installation
"""
try:
if (self.Get('cl_action') == 'merge' and
self.Get('client.cl_remote_host')):
return \
_("The autologin is not available with domain workstations")
except DataVarsError:
pass
return ""
class VariableClInstallAutoupdateSet(Variable):
"""
(on or off) autoupdate config from install program for install
@ -529,15 +543,17 @@ class VariableClSetup(Variable):
value = ""
def choice(self):
return ["audio","network","locale","video","boot","users",""]
return ["audio", "network", "locale", "video", "boot", "users",
"session", ""]
def humanReadable(self):
mapType = {'network':_("network settings"),
'locale':_("localization and time options"),
'video':_("video settings"),
'boot':_("boot parameters"),
'audio':_("audio parameters"),
'users':_("user settings") }
mapType = {'network': _("network settings"),
'locale': _("localization and time options"),
'video': _("video settings"),
'boot': _("boot parameters"),
'audio': _("audio parameters"),
'session': _("session settings"),
'users': _("user settings")}
return mapType.get(self.Get(),"")
def check(self,value):
@ -727,37 +743,48 @@ class VariableOsInstallX11ServerSet(PackageCheckHelper):
package = "x11-base/xorg-server"
class FlashUncompatible:
def uncompatible(self):
"""
Update setting up unavailable for flash installation
"""
if self.Get('os_install_root_type') == 'flash':
return \
_("Update configuration unavailable for Flash install")
return ""
try:
import calculate.update.variables.update as update
class VariableClInstallAutocheckSet(update.VariableClUpdateAutocheckSet):
class VariableClInstallAutocheckSet(update.VariableClUpdateAutocheckSet,
FlashUncompatible):
def get(self):
return self.Get('update.cl_update_autocheck_set')
def uncompatible(self):
"""
Update setting up unavailable for flash installation
"""
if self.Get('os_install_root_type') == 'flash':
return \
_("Update configuration unavailable for Flash install")
return ""
class VariableClInstallAutocheckInterval(update.VariableClUpdateAutocheckInterval):
class VariableClInstallAutocheckInterval(
update.VariableClUpdateAutocheckInterval, FlashUncompatible):
def get(self):
return self.Get('update.cl_update_autocheck_interval')
def uncompatible(self):
"""
Update setting up unavailable for flash installation
"""
if self.Get('os_install_root_type') == 'flash':
return \
_("Update configuration unavailable for Flash install")
return ""
class VariableClInstallCleanpkgSet(
update.VariableClUpdateCleanpkgSet, FlashUncompatible):
def get(self):
return self.Get('update.cl_update_cleanpkg_set')
class VariableClInstallOtherSet(
update.VariableClUpdateOtherSet, FlashUncompatible):
def get(self):
return self.Get('update.cl_update_other_set')
except ImportError:
class VariableClInstallAutocheckSet(Variable):
value = ""
class VariableClInstallAutocheckSet(Variable, FlashUncompatible):
value = "off"
class VariableClInstallAutocheckInterval(Variable):
class VariableClInstallAutocheckInterval(Variable, FlashUncompatible):
value = ""
class VariableClInstallCleanpkgSet(Variable, FlashUncompatible):
value = "off"
class VariableClInstallOtherSet(Variable, FlashUncompatible):
value = "off"

@ -29,7 +29,8 @@ from calculate.core.server.func import WsdlBase
from calculate.install.utils.cl_install import ClInstallAction
from calculate.install.utils.cl_setup import (ClSetupAudioAction,
ClSetupLocaleAction,ClSetupVideoAction,ClSetupSystemAction,
ClSetupBootAction,ClSetupNetworkAction)
ClSetupBootAction,ClSetupNetworkAction,
ClSetupSessionAction)
class Wsdl(WsdlBase):
methods = [{
@ -102,18 +103,20 @@ class Wsdl(WsdlBase):
'os_install_grub_terminal')),
lambda group: group(_("Update"),
normal=('cl_install_autocheck_set',
'cl_install_autocheck_interval'))],
'cl_install_autocheck_interval',
'cl_install_cleanpkg_set',
'cl_install_other_set'))],
# действие выводит информацию перед запуском
'brief':{'next':__("Perform"),
'image':'finish',
'name':__("Start installing")}},
'brief':{'next':__("Perform"),
'image':'finish',
'name':__("Start installing")}},
# установка на Flash
{
'method_name':"install_flash",
'category':__("Installation"),
'title':__("Flash Install"),
'image':'drive-removable-media-usb-pendrive,'\
'drive-removable-media-usb,media-flash',
'method_name': "install_flash",
'category': __("Installation"),
'title': __("Flash Install"),
'image': ('drive-removable-media-usb-pendrive,'
'drive-removable-media-usb,media-flash'),
'gui':True,
'rights':['install'],
'logic':{'Install':install.Install},
@ -269,4 +272,26 @@ class Wsdl(WsdlBase):
'os_install_clock_timezone'),
expert=('cl_templates_locate','cl_dispatch_conf',
'cl_verbose_set'),
next_label=_("Save"))]}]
next_label=_("Save"))]},
{
# настройка локали
'method_name':"setup_session",
'category':__("Configuration"),
'title':__("Session"),
'image':'session-properties',
'command':'cl-setup-session',
'gui':True,
'rights':['setupsession'],
'logic':{'Install':install.Install},
'action':ClSetupSessionAction,
'datavars':"install",
'native_error':(VariableError,DataVarsError,install.InstallError),
'setvars':{'cl_action!':'merge','cl_merge_pkg!':[None],
'cl_merge_set!':"on",'cl_setup':'session'},
'groups':[
lambda group:group(_("Session"),
normal=('cl_autologin', 'cl_install_home_crypt_set'),
expert=('cl_templates_locate','cl_dispatch_conf',
'cl_verbose_set'),
next_label=_("Save"))]}
]

Loading…
Cancel
Save