Browse Source

moved to new server

master
Mikhail Grebenkin 4 years ago
parent
commit
41c16cf02c
1 changed files with 11 additions and 4 deletions
  1. +11
    -4
      zayavka_reader.py

+ 11
- 4
zayavka_reader.py View File

@ -3,16 +3,18 @@
import MySQLdb
dbconn = {'host': '10.1.11.26',
'user': 'LDAP2018',
'pass': 'Pr4t7UEZITwW1AYG',
'base': 'sitemanager0'}
dbconn = {'host': '10.3.11.177',
'user': 'readonlyuser',
'pass': 'Readonly@2006',
'base': 'techgrow'}
sql = 'select * from LDAP'
ad_groups_users = ['vpn-users', 'gogs']
ad_groups_bitrix = ['vpn-web-vpn', 'gogs']
ad_groups_1c = ['vpn-1c-vpn', 'Domain Users']
ad_group_xserv = 'ics'
ad_group_rdp = 'Пользователи удаленного рабочего стола'
def mysql_reader(dbconn, sql):
@ -50,12 +52,17 @@ def users_make_zayavka(users):
if i['Delete'] == 'Y':
toremove = True
# размечаем группы, в которых должен быть пользователь
memberof = []
if str(i['Otdel']) == 'Users':
memberof = ad_groups_users
elif str(i['Otdel']) == '1C':
memberof = ad_groups_1c
elif str(i['Otdel']) == 'Bitrix':
memberof = ad_groups_bitrix
if str(i['XServ']) == '1':
memberof.append(ad_group_xserv)
if str(i['RDP']) == '1':
memberof.append(ad_group_rdp)
# собственно добавляем в мапу
res[usrname] = {'id': str(i['ID']),
'samAccountName': usrname,


Loading…
Cancel
Save

Powered by TurnKey Linux.