|
|
|
@ -9998,13 +9998,19 @@ example: --range 192.168.0.2,192.168.0.50')
|
|
|
|
|
'optVal':"LOGIN",
|
|
|
|
|
'longOption':"login",
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("user name the logged on in server")
|
|
|
|
|
'help':_("user name for login to the server")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(11,),
|
|
|
|
|
'optVal':"LOGOUT",
|
|
|
|
|
'longOption':"logout",
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("user name the logged off in server")
|
|
|
|
|
'help':_("user name to logout from the server")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(11,),
|
|
|
|
|
'optVal':"MAKEDIR",
|
|
|
|
|
'longOption':"makedir",
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("user name to create user directories on the server")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(11,),
|
|
|
|
|
'shortOption':"s",
|
|
|
|
@ -12628,7 +12634,7 @@ if %%errorlevel%%==0 NET USE T: \\\\%s\\ftp' %(netbios,netbios,netbios)
|
|
|
|
|
else:
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def execLoginUser(self, userName, flagRepl):
|
|
|
|
|
def execLoginUser(self, userName, flagRepl, flagMakeDir):
|
|
|
|
|
"""Действия на сервере при входе пользователя в сеанс"""
|
|
|
|
|
# Поиск пользователя в Samba сервисе
|
|
|
|
|
if not self.servSambaObj.searchSambaUser(userName):
|
|
|
|
@ -12640,7 +12646,7 @@ if %%errorlevel%%==0 NET USE T: \\\\%s\\ftp' %(netbios,netbios,netbios)
|
|
|
|
|
%str(userName))
|
|
|
|
|
return False
|
|
|
|
|
# В случае репликации
|
|
|
|
|
if flagRepl:
|
|
|
|
|
if not flagMakeDir and flagRepl:
|
|
|
|
|
# Устанавливаем время модификации профиля в конф. файл
|
|
|
|
|
# desktop.env для всех профилей пользователя
|
|
|
|
|
# а также получаем список файлов
|
|
|
|
@ -12854,21 +12860,32 @@ remove user %s in the LDAP branch 'Worked'")%str(userName))
|
|
|
|
|
verboseMode = False
|
|
|
|
|
login = ""
|
|
|
|
|
logout = ""
|
|
|
|
|
makeDir = ""
|
|
|
|
|
isLogin = options.has_key('login')
|
|
|
|
|
isLogout = options.has_key('logout')
|
|
|
|
|
if isLogin and not isLogout:
|
|
|
|
|
# Вход пользователя
|
|
|
|
|
login = options['login']
|
|
|
|
|
elif isLogout and not isLogin:
|
|
|
|
|
# Вход пользователя
|
|
|
|
|
logout = options['logout']
|
|
|
|
|
elif isLogout and isLogin:
|
|
|
|
|
isMakeDir = options.has_key('makedir')
|
|
|
|
|
dictOpt = {"login":isLogin, "logout":isLogout, "makedir":isMakeDir}
|
|
|
|
|
firstOpt = filter(lambda x: x[1] ,dictOpt.items())
|
|
|
|
|
lenOpt = len(firstOpt)
|
|
|
|
|
if lenOpt == 1:
|
|
|
|
|
if isLogin:
|
|
|
|
|
# Вход пользователя
|
|
|
|
|
login = options['login']
|
|
|
|
|
elif isLogout:
|
|
|
|
|
# Выход пользователя
|
|
|
|
|
logout = options['logout']
|
|
|
|
|
elif isMakeDir:
|
|
|
|
|
# Создание директорий для пользователя
|
|
|
|
|
makeDir = options['makedir']
|
|
|
|
|
elif lenOpt == 0:
|
|
|
|
|
errMessages.append(\
|
|
|
|
|
_("command line option '--login' and '--logout' is incompatible"))
|
|
|
|
|
_("command line option '--login' or '--logout' or '--makedir' is \
|
|
|
|
|
not set"))
|
|
|
|
|
return printErrMessages(errMessages, verboseMode, logObj)
|
|
|
|
|
else:
|
|
|
|
|
errMessages.append(\
|
|
|
|
|
_("command line option '--login' or '--logout' is not set"))
|
|
|
|
|
_("command line option '--login' and '--logout' and '--makedir' is \
|
|
|
|
|
incompatible"))
|
|
|
|
|
return printErrMessages(errMessages, verboseMode, logObj)
|
|
|
|
|
# Создаем переменные шаблонов
|
|
|
|
|
self.createClVars()
|
|
|
|
@ -12885,19 +12902,24 @@ remove user %s in the LDAP branch 'Worked'")%str(userName))
|
|
|
|
|
if self.clVars.Get("ld_repl_set") == "on":
|
|
|
|
|
flagRepl = True
|
|
|
|
|
|
|
|
|
|
if login:
|
|
|
|
|
if login or makeDir:
|
|
|
|
|
# Переопределение печати успешных сообщений и ошибок
|
|
|
|
|
prnSucces, prnErr = redefinePrintMethods(messages, errMessages)
|
|
|
|
|
# Вход пользователя в сеанс
|
|
|
|
|
userName = login
|
|
|
|
|
if self.execLoginUser(userName, flagRepl):
|
|
|
|
|
flagMakeDir = False
|
|
|
|
|
if login:
|
|
|
|
|
userName = login
|
|
|
|
|
elif makeDir:
|
|
|
|
|
userName = makeDir
|
|
|
|
|
flagMakeDir = True
|
|
|
|
|
if self.execLoginUser(userName, flagRepl, flagMakeDir):
|
|
|
|
|
# Восстановление печати успешных сообщений и ошибок
|
|
|
|
|
restorePrintMethods(prnSucces, prnErr)
|
|
|
|
|
return printSuccessMessages(messages, verboseMode, logObj)
|
|
|
|
|
# Восстановление печати успешных сообщений и ошибок
|
|
|
|
|
restorePrintMethods(prnSucces, prnErr)
|
|
|
|
|
return printErrMessages(errMessages, verboseMode, logObj)
|
|
|
|
|
if logout:
|
|
|
|
|
elif logout:
|
|
|
|
|
# Переопределение печати успешных сообщений и ошибок
|
|
|
|
|
prnSucces, prnErr = redefinePrintMethods(messages, errMessages)
|
|
|
|
|
userName = logout
|
|
|
|
|