/// <summary> /// Create the persisted object that contains default configuration of LDAPCP. /// It should be created only in central administration with application pool credentials /// because this is the only place where we are sure user has the permission to write in the config database /// </summary> public static ZimbraConfig CreatePersistedObject() { ZimbraConfig PersistedObject = new ZimbraConfig(SPFarm.Local); PersistedObject.Id = new Guid(Constants.LDAPCPPersistedObjectID); PersistedObject = GetDefaultSettings(PersistedObject); try { PersistedObject.Update(); } catch (NullReferenceException nullex) { // This exception occurs if an older version of the persisted object lives in the config database with a schema that doesn't match current one string stsadmcmd = String.Format("SELECT * FROM Objects WHERE Id LIKE '{0}'", Constants.LDAPCPPersistedObjectID); string error = String.Format("Unable to create PersistedObject {0}. This usually occurs because a persisted object with the same Id is used by another assembly (could be a previous version). Object is impossible to update or delete from Object Model unless you add the missing assembly to the GAC. You can see this object by running this query: \"{1}\"", PersistedObject.Name, stsadmcmd); //ZimbraClaimProvider.LogToULS(error,TraceSeverity.Unexpected,EventSeverity.Error); // Tyy to delete it... but OM doesn't manage to get the object SPPersistedObject staleObject = SPFarm.Local.GetObject(new Guid(Constants.LDAPCPPersistedObjectID)); if (staleObject != null) { staleObject.Delete(); PersistedObject.Update(); } else { throw new Exception(error, nullex); } } //ZimbraClaimProvider.LogToULS(String.Format("Created PersistedObject {0} with Id {1}", PersistedObject.Name, PersistedObject.Id),TraceSeverity.Medium,EventSeverity.Information); return(PersistedObject); }
public static LDAPCPConfig GetFromConfigDB() { SPPersistedObject parent = SPFarm.Local; try { LDAPCPConfig persistedObject = parent.GetChild <LDAPCPConfig>(Constants.LDAPCPCONFIG_NAME); if (persistedObject != null) { if (persistedObject.LDAPConnectionsProp == null) { // persistedObject.LDAPConnections introduced in v2.1 (SP2013) // This can happen if LDAPCP was migrated from a previous version and LDAPConnections didn't exist yet in persisted object persistedObject.LDAPConnectionsProp = GetDefaultLDAPConnection(); LdapcpLogging.Log( String.Format("LDAP connections array is missing in the persisted object {0} and default connection was used. Visit LDAPCP admin page and validate it to create the array.", Constants.LDAPCPCONFIG_NAME), TraceSeverity.High, EventSeverity.Information, LdapcpLogging.Categories.Configuration); } } return(persistedObject); } catch (Exception ex) { LdapcpLogging.LogException(LDAPCP._ProviderInternalName, String.Format("Error while retrieving SPPersistedObject {0}", Constants.LDAPCPCONFIG_NAME), LdapcpLogging.Categories.Core, ex); } return(null); }
public Auth0Config(string objectName, SPPersistedObject parent) : base(objectName, parent) { this.ClientId = string.Empty; this.ClientSecret = string.Empty; this.Domain = string.Empty; this.IdentifierUserField = string.Empty; this.PickerEntityGroupName = string.Empty; }
/* * /// <summary> * /// Initializes a new instance of the <see cref="WebSiteControllerConfig"/> class. * /// </summary> * /// <param name="persisted"></param> * public WebSiteControllerConfig(SPWebApplication webApp)// * : base(OBJECTNAME, webApp, ID) * { * try * { * this.rules = new WebSiteControllerRulesCollection(this); * this.modules = new WebSiteControllerModulesCollection(this); * } * catch (Exception ex) * { * ex.ToString(); * } * } */ public WebSiteControllerConfig(SPPersistedObject persisted, Guid guid) : base(OBJECTNAME, persisted, guid) { try { this.rules = new WebSiteControllerRulesCollection(this); this.modules = new WebSiteControllerModulesCollection(this); } catch (Exception ex) { SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory(ex.Source, TraceSeverity.High, EventSeverity.Error), TraceSeverity.High, ex.Message, ex.Data); //ex.ToString(); } }
public static AzureCPConfig GetFromConfigDB() { SPPersistedObject parent = SPFarm.Local; try { AzureCPConfig persistedObject = parent.GetChild <AzureCPConfig>(Constants.AZURECPCONFIG_NAME); return(persistedObject); } catch (Exception ex) { AzureCPLogging.Log(String.Format("Error while retrieving SPPersistedObject {0}: {1}", Constants.AZURECPCONFIG_NAME, ex.Message), TraceSeverity.Unexpected, EventSeverity.Error, AzureCPLogging.Categories.Core); } return(null); }
internal static SPPersistedObject Create(string name, SPPersistedObject service, SPIisWebServiceApplicationPool pool) { return((SPPersistedObject)Utilities.Reflection.ExecuteMethod(ServiceApplicationType, ServiceApplicationType, "Create", new[] { typeof(string), InterCommService.ServiceType, typeof(SPIisWebServiceApplicationPool) }, new object[] { name, service, pool })); }
internal static SPPersistedObject Create(string name, SPPersistedObject service, SPIisWebServiceApplicationPool pool, SPDatabaseParameters dbParameters) { return((SPPersistedObject)Utilities.Reflection.ExecuteMethod(ServiceApplicationType, ServiceApplicationType, "Create", new[] { typeof(string), InnovationService.ServiceType, typeof(SPIisWebServiceApplicationPool), typeof(SPDatabaseParameters) }, new object[] { name, service, pool, dbParameters })); }
/// <summary> /// Initializes a new instance of the <see cref="WebSiteControllerRule"/> class. /// </summary> /// <param name="site">The site collection.</param> /// <param name="page">The page to which this rule applies. It cannot be null</param> /// <param name="ruleType">Type of the rule.</param> /// <param name="principal">The principal.</param> /// <param name="principalType">Type of the principal.</param> /// <param name="disabled">if set to <c>true</c> the rule is disabled.</param> /// <param name="appliesToSsl">if set to <c>true</c> the rule applies to SSL.</param> /// <param name="sequence">The sequence of the rule compared to other rules.</param> /// <param name="parent">Parent object of the WebSiteControllerRule</param> public WebSiteControllerRule( string site, string page, string ruleType, string principal, WebSiteControllerPrincipalType principalType, bool disabled, bool appliesToSsl, int sequence, SPPersistedObject parent) : base(String.Empty, parent) { if (String.IsNullOrEmpty(site)) { throw new ArgumentNullException("siteCollection"); } if (String.IsNullOrEmpty(page)) { throw new ArgumentNullException("page"); } this.SiteCollection = site; // Trim the slash if the user put one in. Slash is on the site collection if (page.StartsWith("/", StringComparison.Ordinal)) { page = page.TrimStart('/'); } this.page = page; this.ruleType = ruleType; this.principal = principal; this.principalType = principalType; this.appliesToSsl = appliesToSsl; this.disabled = disabled; this.sequence = sequence; }
public UserManager(string name, SPPersistedObject parent, Guid guid) : base(name, parent, guid) { _userslist = ""; }
public MonitoraJobConfig(SPPersistedObject parent, Guid id) : base(ConfigNome, parent, id) { }
public AzureCPConfig(SPPersistedObject parent) : base(Constants.AZURECPCONFIG_NAME, parent) { }
public SyncConfiguration(string name, SPPersistedObject parent, Guid id) : base(name, parent, id) { }
public FoundationSyncSettings(SPPersistedObject parent) : base(name, parent) { }
/// <summary> /// Initializes a new instance of the <see cref="PackageManagerSettings"/> class. /// </summary> /// <param name="parent"> /// The parent. /// </param> public PackageManagerSettings(SPPersistedObject parent) : base(PackageSourceProperytyName, parent) { }
public AppData(string Name, SPPersistedObject Parent, Guid Id) : base(Name, Parent, Id) { }
/// <summary> /// Initializes a new instance of the <see cref="PersistedWebSiteControllerModule"/> class. /// </summary> /// <param name="id">The id of the module</param> /// <param name="shortClassName">Short name of the class.</param> /// <param name="fullyQualifiedClassName">Full name of the class.</param> /// <param name="parent">The parent persisted object</param> public PersistedWebSiteControllerModule(Guid id, string shortClassName, string fullyQualifiedClassName, SPPersistedObject parent) : base(String.Empty, parent) { this.Id = id; this.Name = shortClassName; this.fullyQualifiedClassName = fullyQualifiedClassName; }
public ChangeTokenStore(string name, SPPersistedObject parent, Guid id) : base(name, parent, id) { }
public PowerWebPartStore(string strName, SPPersistedObject objParent, Guid objGuid) : base(strName, objParent, objGuid) { }
public LDAPCPConfig(string name, SPPersistedObject parent) : base(name, parent) { }
public LDAPCPConfig(SPPersistedObject parent) : base(Constants.LDAPCPCONFIG_NAME, parent) { }
public FoundationSyncSettings(string name, SPPersistedObject parent, Guid guid) : base(name, parent, guid) { }
public IronHiveRegistry(string name, SPPersistedObject parent, Guid id) : base(name, parent, id) { }
public JobSettings(string name, SPPersistedObject parent, Guid id) : base(name, parent, id) { this.SiteCollectionsEnabled = new List <Guid>(); }
/// <summary> /// Required constructor by the SPPersistedObject base class. /// </summary> /// <param name="name">The name for the persisted object</param> /// <param name="parent">The parent of this persisted object</param> public WebAppSettingStore(string name, SPPersistedObject parent) : base(name, parent) { }
public ReportAuth(string name, SPPersistedObject parent, Guid guid) : base(name, parent, guid) { _username = ""; _password = ""; }
public SignInConfiguration(string name, SPPersistedObject parent) : base(name, parent) { }
public CleanupLogListTimerJobSettings(SPPersistedObject parent, Guid id) : base(SettingsName, parent, id) { }
public ConfigObject(string name, SPPersistedObject parent) : base(name, parent) { }
public ZimbraConfig(SPPersistedObject parent) : base(LdapcpPersistecObjectName, parent) { }
public ZimbraProviderSettings(SPPersistedObject parent) : base(ZimbraPersistedObjectName, parent, Guid.Parse(ZimbraPersistedObjectId)) { }
public LinkCheckerPersistedSettings(string name, SPPersistedObject parent) : base(name, parent) { }