develop
asamoukin 16 years ago
parent d36228063c
commit 53cae42f5c

@ -165,6 +165,12 @@ class cl_client(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
'help':_("control whether color is used to distinguish file types. \
WHEN may be 'never', 'always', or 'auto'")
},
{'progAccess':(1,),
'shortOption':"f",
'longOption':"force",
'helpChapter':_("Common options"),
'help':_("always join the user profiles and preferences")
},
{'progAccess':(0,),
'longOption':"mount",
'helpChapter':_("Common options"),
@ -447,7 +453,7 @@ conjunction with the 'login' or 'logout'")
alwProfilePath.append(prPath)
return alwProfilePath
def createHome(self, userName):
def createHome(self, userName, applyAlways=False):
"""Создание пользовательской директории с настройками для kde4"""
# Создаем объект переменных
self.createClVars()
@ -480,14 +486,15 @@ conjunction with the 'login' or 'logout'")
if homeExists:
self.printWARNING(_("Home dir %s exists")%homeDir)
if set(os.listdir(homeDir))-set(["Home","Disks"]):
# Получаем пути к профилям постоянного наложения
alwProfilePath = self.getAlwaysProfilePath()
if not alwProfilePath:
return True
# Записываем пути к профилям постоянного наложения
#в переменную
self.printSUCCESS(_("Apply always profiles") + " ...")
self.clVars.Set('cl_profile_path',alwProfilePath, True)
if not applyAlways:
# Получаем пути к профилям постоянного наложения
alwProfilePath = self.getAlwaysProfilePath()
if not alwProfilePath:
return True
# Записываем пути к профилям постоянного наложения
#в переменную
self.printSUCCESS(_("Apply always profiles") + " ...")
self.clVars.Set('cl_profile_path',alwProfilePath, True)
if not os.path.exists(homeDir):
self.createUserDir(uid, gid, homeDir)

@ -51,8 +51,12 @@ if __name__ == "__main__":
{})
ldapObj = newClass("cl-createhome")
userName = optObj.params['user'].strip()
if not ldapObj.createHome(userName):
flagError = True
if optObj.opt.has_key('f'):
if not ldapObj.createHome(userName,True):
flagError = True
else:
if not ldapObj.createHome(userName):
flagError = True
if flagError:
sys.exit(1)
else:

Loading…
Cancel
Save