Drupal investigation

users.py 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import random
  2. import string
  3. lorem =("Lorem ipsum dolor sit amet consectetur adipiscing elit Vestibulum neque augue cursus id fermentum quis porttitor at lacus Cras quis rutrum mi at varius justo Nulla eros odio egestas sit amet risus nec faucibus elementum erat Fusce finibus mattis ante in consequat lectus tincidunt id Interdum et malesuada fames ac ante ipsum primis in faucibus Sed pretium vestibulum leo ac volutpat nunc viverra at Integer erat leo imperdiet et erat ut aliquam tempor erat Vivamus consequat ligula consectetur mi varius in efficitur odio molestie Cras mollis est at porta ultrices Quisque at purus sed velit tincidunt varius Nulla facilisi Nam venenatis tellus ante nec gravida elit scelerisque eget Aenean feugiat quis nunc pulvinar vestibulum Vestibulum ullamcorper at dolor vitae egesta Ut id dignissim lectus non vestibulum metus Ut egestas imperdiet nibh consectetur feugiat urna blandit at Sed suscipit sem elit eu pretium risus varius non Nam gravida justo id consequat congue Morbi eleifend sapien leo et dictum libero mollis nec Duis sed magna suscipit pretium ligula eget ullamcorper lacus Ut rhoncus libero nisi quis pulvinar metus consequat id Fusce eu tincidunt ante Vivamus vel diam rutrum aliquet nunc eget scelerisque lacus Orci varius natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Quisque euismod nulla sit amet libero lacinia faucibus Cras tortor neque molestie non nisi vel auctor placerat eros Vivamus diam dui ultricies sit amet mattis tempor pretium eu felis Pellentesque a varius tortor ut auctor lorem Vestibulum nec vehicula lorem bibendum imperdiet nunc Donec lectus nunc pretium et faucibus sit amet bibendum nec leo Vestibulum luctus justo aliquam erat sollicitudin ut ultrices mauris cursus Interdum et malesuada fames ac ante ipsum primis in faucibus Etiam cursus metus non scelerisque finibus Maecenas ut mattis purus a volutpat sem Sed eget ullamcorper magna Sed est ante volutpat eu consectetur at fermentum quis odio Mauris a mauris ex Aenean velit ex vehicula at auctor non luctus et justo Cras ut sapien aliquet finibus ipsum vel volutpat nisi Curabitur tincidunt est non lacus maximus eu venenatis velit accumsan Vivamus vestibulum ac ligula at luctus Donec ipsum ipsum mattis sed ullamcorper sit amet pretium id leo Duis eu dolor vitae ipsum auctor consequa Duis mattis metus nec venenatis porttitor Duis vehicula nunc eget maximus condimentum nisl dolor dapibus ante in interdum orci felis a lorem Suspendisse suscipit at ligula eget iaculis Sed ornare tincidunt enim id iaculis diam rutrum ut Proin euismod sollicitudin consequat Curabitur accumsan mollis diam ac tincidun Aliquam molestie vitae nunc in hendrerit In hac habitasse platea dictumst Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae Donec at tincidunt purus Aliquam nec ligula nec ligula tempor hendrerit eget at odio Nullam gravida eu ligula eget finibus Nam eget sem ut nisl consectetur auctor eget ac lectus Aliquam viverra eget tellus in maximus Cras dignissim massa justo vitae elementum metus hendrerit condimentum Orci varius natoque penatibus et magnis dis parturient montes nascetur ridiculus mus Morbi ligula ligula tempor vitae felis eu aliquet mattis lectus Donec").split(' ')
  4. sids="S-1-5-21-1026401985-3175303605-4127516147-"
  5. titles = ('','Dr.','Dr. rer. nat.','Prof. Dr.','Dr.-Ing.', 'Dipl.-Math.', 'Dipl. Phys.')
  6. emails = '@fraunhofer.de'
  7. institutes = ('CSP','IMWS')
  8. departments = ('Institutsleitung','Polymerbasiertes Materialdesign','Modultechnologie','Anwendungszentrum fur Anorganische Leuchtstoffe','Center fur Materialokonomie','Buro Institutsleitung','Technologien fur biofunktionale Oberflachen','Diagnostik Halbleitertechnologien','Siliziumwafer', 'Naturstoffkomposite', 'Center fur Materialokonomie', 'Naturstoffkomposite')
  9. groupsArr = ('Transponder','halle','linux','Firmenlauf','Professoren','kam','ChipInject','XRayUser','Onboarding','Walter-Huelse-Strasse','Heideallee')
  10. phoneCode = '+49'
  11. positions = ('','Gruppenleiter','Marketingassistent','Geschaftsfeldleiter','Assistent','')
  12. dates = ('2018-01-01 23:59:59','2017-04-06 07:28:46','2017-09-01 23:59:59','2002-03-18 12:16:50','2017-04-05 10:24:05','2006-11-28 09:55:21','2008-05-15 09:44:05','2018-01-01 23:59:59','2015-08-28 10:41:09','2015-06-25 00:31:16')
  13. def GUID():
  14. x = ''
  15. for j in range(0,10):
  16. x = x + random.choice(string.letters)
  17. return x
  18. path = 'dummyusers.csv'
  19. file = open(path, 'wx')
  20. columnNames = ('sid', 'username', 'fhgusername', 'email', 'displayname', 'description', 'title', 'forename', 'surname', 'room', 'institute', 'department', 'businessunit', 'telephone', 'mobilephone','fax', 'manager', 'employeeid', 'employeetype', 'transponder', 'position_de', 'position_en', 'proxy', 'proxy1', 'secretary', 'access', 'groupsids', 'groups', 'present', 'accountexpires', 'lastlogin', 'whencreated', 'objectGUID')
  21. file.write((','.join(columnNames) + '\n'))
  22. for i in range(0, 100):
  23. sid = sids + str(i)
  24. forename = lorem[random.randint(0,len(lorem)-1)].capitalize()
  25. surname = lorem[random.randint(0,len(lorem)-1)].capitalize()
  26. username = (surname[:4]).lower()
  27. fhgusername = username + str(i)
  28. displayname = surname + ', ' + forename
  29. email = username + emails
  30. description = 'description'
  31. title = titles[random.randint(0, len(titles)-1)]
  32. room = random.choice(string.letters) + str(i)
  33. institute = institutes[random.randint(0, len(institutes)-1)]
  34. department = departments[random.randint(0,len(departments)-1)]
  35. businessunit = ''
  36. departmentnumber = str(departments.index(department))
  37. employeetype = 'intern'
  38. transponder = 'transponder'
  39. present = 'Y'
  40. access = 'MITARBEITER'
  41. telephone = phoneCode + str(random.randint(10000,99999))
  42. mobilephone = telephone
  43. fax = telephone
  44. position_de = positions[random.randint(0,len(positions)-1)]
  45. position_en = position_de
  46. proxy = 'proxy'
  47. proxy2 = 'proxy2'
  48. secretary = 'secretary'
  49. employeeid = sid
  50. manager = (lorem[random.randint(0,len(lorem)-1)]).capitalize() + ' ' + (lorem[random.randint(0, len(lorem)-1)]).capitalize()
  51. accountexpires = 'never'
  52. lastlogin = dates[random.randint(0,len(dates)-1)]
  53. whencreated = dates[random.randint(0,len(dates)-1)]
  54. objectGUID = GUID()
  55. group1 = groupsArr[random.randint(0, len(groupsArr)-1)]
  56. group2 = groupsArr[random.randint(0, len(groupsArr)-1)]
  57. group3 = groupsArr[random.randint(0, len(groupsArr)-1)]
  58. groupsids = str(groupsArr.index(group1)) + ', ' + str(groupsArr.index(group2)) + ', ' + str(groupsArr.index(group3))
  59. groups = group1 + ', ' + group2 + ', ' + group3
  60. row ='"' + sid+'","'+username+'","'+fhgusername+'","'+email+'","'+displayname+'","'+description+'","'+title+'","'+forename+'","'+surname+'","'+room+'","'+institute+'","'+department+'","'+businessunit+'","'+departmentnumber+'","'+telephone+'","'+mobilephone+'","'+fax+'","'+manager+'","'+employeeid+'","'+employeetype+'","'+transponder+'","'+position_de+'","'+position_en+'","'+proxy+'","'+proxy2+'","'+secretary+'","'+access+'","'+groupsids+'","'+groups+'","'+present+'","'+accountexpires+'","'+lastlogin+'","'+whencreated+'","'+objectGUID + '"\n'
  61. file.write(row)
  62. file.close()
  63. #sid
  64. #username
  65. #fhgusername
  66. #email
  67. #displayname
  68. #description
  69. #title
  70. #surname
  71. #forename
  72. #room
  73. #institute
  74. #department
  75. #businessunit
  76. #departmentnumber
  77. #telephone
  78. #mobilephone
  79. #fax
  80. #manager
  81. #employeeid
  82. #employeetype
  83. #transponder
  84. #position_de
  85. #position_en
  86. #proxy
  87. #proxy2
  88. #secretary
  89. #access
  90. #groupsids
  91. #groups
  92. #present
  93. #accountexpires
  94. #lastlogin
  95. #whencreated
  96. #objectGUID