View | Details | Raw Unified | Return to bug 50573
Collapse All | Expand All

(-)a/office365-group.py (-1 / +1 lines)
Lines 124-130 def create_groups(ol, dn, new, old): Link Here
124
			udm_group["UniventionOffice365ObjectID"] = new_group["objectId"]
124
			udm_group["UniventionOffice365ObjectID"] = new_group["objectId"]
125
		else:
125
		else:
126
			new_azure_data = {ol.adconnection_alias: new_group}
126
			new_azure_data = {ol.adconnection_alias: new_group}
127
			old_azure_data_encoded = old.get('univentionOffice365Data', [''])[0]
127
			old_azure_data_encoded = udm_user["UniventionOffice365Data"]
128
			if old_azure_data_encoded:
128
			if old_azure_data_encoded:
129
				# The account already has an Azure AD connection
129
				# The account already has an Azure AD connection
130
				old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
130
				old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
(-)a/office365-user.py (-4 / +4 lines)
Lines 264-270 def new_or_reactivate_user(ol, dn, new, old): Link Here
264
				'userPrincipalName': new_user['userPrincipalName'],
264
				'userPrincipalName': new_user['userPrincipalName'],
265
			}
265
			}
266
		}
266
		}
267
		old_azure_data_encoded = old.get('univentionOffice365Data', [''])[0]
267
		old_azure_data_encoded = udm_user["UniventionOffice365Data"]
268
		if old_azure_data_encoded:
268
		if old_azure_data_encoded:
269
			# The account already has an Azure AD connection
269
			# The account already has an Azure AD connection
270
			old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
270
			old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
Lines 294-300 def delete_user(ol, dn, new, old): Link Here
294
		udm_user["UniventionOffice365Data"] = Office365Listener.encode_o365data(None)
294
		udm_user["UniventionOffice365Data"] = Office365Listener.encode_o365data(None)
295
		udm_user.modify()
295
		udm_user.modify()
296
	else:
296
	else:
297
		old_azure_data_encoded = old.get('univentionOffice365Data', [''])[0]
297
		old_azure_data_encoded = udm_user["UniventionOffice365Data"]
298
		if old_azure_data_encoded:
298
		if old_azure_data_encoded:
299
			old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
299
			old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
300
			try:
300
			try:
Lines 317-323 def deactivate_user(ol, dn, new, old): Link Here
317
		udm_user["UniventionOffice365Data"] = Office365Listener.encode_o365data(None)
317
		udm_user["UniventionOffice365Data"] = Office365Listener.encode_o365data(None)
318
		udm_user.modify()
318
		udm_user.modify()
319
	else:
319
	else:
320
		old_azure_data_encoded = old.get('univentionOffice365Data', [''])[0]
320
		old_azure_data_encoded = udm_user["UniventionOffice365Data"]
321
		if old_azure_data_encoded:
321
		if old_azure_data_encoded:
322
			# The account already has an Azure AD connection
322
			# The account already has an Azure AD connection
323
			old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
323
			old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
Lines 344-350 def modify_user(ol, dn, new, old): Link Here
344
				'userPrincipalName': azure_user['userPrincipalName'],
344
				'userPrincipalName': azure_user['userPrincipalName'],
345
			}
345
			}
346
		}
346
		}
347
		old_azure_data_encoded = old.get('univentionOffice365Data', [''])[0]
347
		old_azure_data_encoded = udm_user["UniventionOffice365Data"]
348
		if old_azure_data_encoded:
348
		if old_azure_data_encoded:
349
			# The account already has an Azure AD connection
349
			# The account already has an Azure AD connection
350
			old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
350
			old_azure_data = Office365Listener.decode_o365data(old_azure_data_encoded)
(-)a/office365_user_ADConnections_hook.py (+4 lines)
Lines 82-87 class Office365ADConnectionsHook(simpleHook): Link Here
82
			value = (adconnection, upn)
82
			value = (adconnection, upn)
83
			module["UniventionOffice365ADConnections"].append(value)
83
			module["UniventionOffice365ADConnections"].append(value)
84
84
85
	def hook_ldap_addlist(self, module, al=[]):
86
		al = [a for a in al if a[0] != "dummyUniventionOffice365ADConnections"]
87
		return al
88
85
	def hook_ldap_modlist(self, module, ml=[]):
89
	def hook_ldap_modlist(self, module, ml=[]):
86
		# remove virtual dummy attribute from modlist
90
		# remove virtual dummy attribute from modlist
87
		ml = [m for m in ml if m[0] != "dummyUniventionOffice365ADConnections"]
91
		ml = [m for m in ml if m[0] != "dummyUniventionOffice365ADConnections"]

Return to bug 50573