/// <summary> /// Register a provisioning provider /// </summary> public static void RegisterProvider(IProvisionUserProvider provider) { if (Simias.Service.Manager.LdapServiceEnabled == false) { logger.Debug("Registering {0}", provider.GetType().ToString()); callout = new hostProvisionMethod(provider.ProvisionUser); } else { logger.Debug("Registering The new provider "); string assemblyName = Simias.Service.Manager.LdapAssemblyName; if (assemblyName != null) { logger.Debug("Provision assembly: {0} class: {1}", assemblyName, "Simias.Identity.UserProvisionProvider"); Assembly idAssembly = Assembly.Load(assemblyName); if (idAssembly != null) { Type type = idAssembly.GetType(userProvisionClass); if (type != null) { MethodInfo provisionUser = type.GetMethod(userProvisionmethod, BindingFlags.Public | BindingFlags.Static); Delegate newDel = Delegate.CreateDelegate(typeof(hostProvisionMethod), provisionUser); callout = (hostProvisionMethod)newDel; } } } if (callout == null) { callout = new hostProvisionMethod(provider.ProvisionUser); } } }
/// <summary> /// Unregister a previously registered provisioning provider. /// </summary> public static void UnRegisterProvider(IProvisionUserProvider provider) { logger.Debug("Unregistering {0}", provider.GetType().ToString()); callout -= new hostProvisionMethod(provider.ProvisionUser); }