Пример #1
0
        static ConfigUtil()
        {
            //All Non-Nullable values, meaning key/value pair that MUST exist in config file are loaded here.
            GoogleApiKey = GetNonNullableParamValue <string>(ConfigUtilKeys.GoogleApiKey);

            //User Registration; Login related
            PasswordMinLength = GetNonNullableParamValue <int>(ConfigUtilKeys.PasswordMinLength);
            PasswordMaxLength = GetNonNullableParamValue <int>(ConfigUtilKeys.PasswordMaxLength);
            PasswordWarningAfterHowManyDays = GetNonNullableParamValue <int>(ConfigUtilKeys.PasswordWarningAfterHowManyDays);
            PendingUserRegistrationDays     = GetNonNullableParamValue <int>(ConfigUtilKeys.PendingUserRegistrationDays);

            //Emai related
            HostingPlace         = GetNonNullableParamValue <string>(ConfigUtilKeys.HostingPlace);
            OverrideEmailAddress = GetNullableReferenceTypeValue <string>(ConfigUtilKeys.OverrideEmail) + string.Empty;
            MustOverrideEmail    = !(OverrideEmailAddress == string.Empty);

            EmailServer         = GetNonNullableParamValue <string>(ConfigUtilKeys.EmailServer);
            EmailServerUserName = GetNonNullableParamValue <string>(ConfigUtilKeys.EmailServerUserName);
            EmailServerPassword = GetNonNullableParamValue <string>(ConfigUtilKeys.EmailServerPassword);
            EmailOfTechSupport  = GetNonNullableParamValue <string>(ConfigUtilKeys.EmailOfTechSupport);
            EmailOfTechSupport  = GetNonNullableParamValue <string>(ConfigUtilKeys.EmailOfCriticalErrorCC);

            EmailOfResourceCenter = GetNonNullableParamValue <string>(ConfigUtilKeys.EmailOfResourceCenter);

            //Regular expression for validating email addresses
            EmailValidationRegex = GetNonNullableParamValue <string>(ConfigUtilKeys.EmailValidationRegEx);

            //Web site environment related
            WebEnvironment = GetNonNullableParamValue <string>(ConfigUtilKeys.WebEnvironment);
            ShiptalkUrl    = GetNonNullableParamValue <string>(ConfigUtilKeys.ShiptalkUrl);
            EmailServerRequiresAuthentication = GetNonNullableParamValue <bool>(ConfigUtilKeys.EmailServerRequiresAuthentication);
            SecureAllPages = GetNonNullableParamValue <bool>(ConfigUtilKeys.SecureAllPages);

            //Registration / Email Confirmation / Password Reset etc.,
            PasswordResetUrl     = ShiptalkUrl + (ShiptalkUrl.EndsWith("/") ? "" : "/") + "NewPass.aspx";
            EmailConfirmationUrl = ShiptalkUrl + (ShiptalkUrl.EndsWith("/") ? "" : "/") + "EmailConf.aspx";

            //Contact Shiptalk, Support
            ShiptalkSupportPhone = GetNonNullableParamValue <string>(ConfigUtilKeys.SHIPtalkSupportPhone);

            //Session stuff
            SessionTimeOutInMinutes = GetNullableValueTypeValue <int>(ConfigUtilKeys.SessionTimeOut) ?? SESSION_TIMEOUT_DEFAULT_IN_MINS;

            //Infolib stuff
            InfolibLinkAllowedExtensions   = GetNullableReferenceTypeValue <string>(ConfigUtilKeys.InfoLibLinkAllowedExtensions) ?? string.Empty;
            InfolibHeaderAllowedExtensions = GetNullableReferenceTypeValue <string>(ConfigUtilKeys.InfoLibHeaderAllowedExtensions) ?? string.Empty;
        }
Пример #2
0
        static ConfigUtil()
        {
            ////All Non-Nullable values, meaning key/value pair that MUST exist in config file are loaded here.
            GoogleRecaptchaSecret = GetNonNullableParamValue <string>(ConfigUtilKeys.GoogleRecaptchaSecret);

            ////User Registration; Login related
            //PasswordMinLength = GetNonNullableParamValue<int>(ConfigUtilKeys.PasswordMinLength);
            //PasswordMaxLength = GetNonNullableParamValue<int>(ConfigUtilKeys.PasswordMaxLength);
            //PasswordWarningAfterHowManyDays = GetNonNullableParamValue<int>(ConfigUtilKeys.PasswordWarningAfterHowManyDays);
            //PendingUserRegistrationDays = GetNonNullableParamValue<int>(ConfigUtilKeys.PendingUserRegistrationDays);

            ////Emai related
            //HostingPlace = GetNonNullableParamValue<string>(ConfigUtilKeys.HostingPlace);
            //OverrideEmailAddress = GetNullableReferenceTypeValue<string>(ConfigUtilKeys.OverrideEmail) + string.Empty;
            //MustOverrideEmail = !(OverrideEmailAddress == string.Empty);

            //smtp Emai related
            SmtpHost              = GetNonNullableParamValue <string>(ConfigUtilKeys.SmtpHost);
            SmtpPort              = GetNonNullableParamValue <int>(ConfigUtilKeys.SmtpPort);
            SmtpCredentialsUid    = GetNonNullableParamValue <string>(ConfigUtilKeys.SmtpCredentialsUid);
            SmtpCredentialsPwd    = GetNonNullableParamValue <string>(ConfigUtilKeys.SmtpCredentialsPwd);
            SmtpConnectionTimeout = GetNonNullableParamValue <string>(ConfigUtilKeys.SmtpConnectionTimeout);
            SmtpSendUsing         = GetNonNullableParamValue <int>(ConfigUtilKeys.SmtpSendUsing);
            SmtpAuthenticate      = GetNonNullableParamValue <int>(ConfigUtilKeys.SmtpAuthenticate);

            CriticalErrorEmail   = GetNonNullableParamValue <string>(ConfigUtilKeys.CriticalErrorEmail);
            CriticalErrorEmailCC = GetNonNullableParamValue <string>(ConfigUtilKeys.CriticalErrorEmailCC);

            EmailOfResourceCenter = GetNonNullableParamValue <string>(ConfigUtilKeys.EmailOfResourceCenter);

            ////Regular expression for validating email addresses
            //EmailValidationRegex = GetNonNullableParamValue<string>(ConfigUtilKeys.EmailValidationRegEx);

            ////Web site environment related
            WebEnvironment = GetNonNullableParamValue <string>(ConfigUtilKeys.WebEnvironment);


            ShiptalkUrl = GetNonNullableParamValue <string>(ConfigUtilKeys.ShiptalkUrl);
            //EmailServerRequiresAuthentication = GetNonNullableParamValue<bool>(ConfigUtilKeys.EmailServerRequiresAuthentication);
            //SecureAllPages = GetNonNullableParamValue<bool>(ConfigUtilKeys.SecureAllPages);

            ////Registration / Email Confirmation / Password Reset etc.,
            PasswordResetUrl     = ShiptalkUrl + (ShiptalkUrl.EndsWith("/") ? "" : "/") + "resetpassword";
            EmailConfirmationUrl = ShiptalkUrl + (ShiptalkUrl.EndsWith("/") ? "" : "/") + "umbraco/surface/authsurface/RenderVerifyEmail";

            //Contact Shiptalk, Support
            ShiptalkSupportPhone = GetNonNullableParamValue <string>(ConfigUtilKeys.SHIPtalkSupportPhone);

            //Session stuff
            SessionTimeOutInMinutes = GetNullableValueTypeValue <int>(ConfigUtilKeys.SessionTimeOut) ?? SESSION_TIMEOUT_DEFAULT_IN_MINS;


            //umbracoID
            AllStateRootId = GetNonNullableParamValue <int>(ConfigUtilKeys.AllStateRootId);

            MediaRootId = GetNonNullableParamValue <int>(ConfigUtilKeys.MediaRootId);

            ResourceUnpublishedId = GetNonNullableParamValue <int>(ConfigUtilKeys.ResourceUnpublishedId);

            ResourceRootId    = GetNonNullableParamValue <int>(ConfigUtilKeys.ResourceRootId);
            ResourceR1Id      = GetNonNullableParamValue <int>(ConfigUtilKeys.ResourceR1Id);
            ResourceR2Id      = GetNonNullableParamValue <int>(ConfigUtilKeys.ResourceR2Id);
            ResourceR3Id      = GetNonNullableParamValue <int>(ConfigUtilKeys.ResourceR3Id);
            ResourceR4Id      = GetNonNullableParamValue <int>(ConfigUtilKeys.ResourceR4Id);
            ResourceFeatureId = GetNonNullableParamValue <int>(ConfigUtilKeys.ResourceFeatureId);

            FeatureRootId = GetNonNullableParamValue <int>(ConfigUtilKeys.FeatureRootId);

            EventRootId = GetNonNullableParamValue <int>(ConfigUtilKeys.EventRootId);
            EventE1Id   = GetNonNullableParamValue <int>(ConfigUtilKeys.EventE1Id);
            EventE2Id   = GetNonNullableParamValue <int>(ConfigUtilKeys.EventE2Id);
            EventE3Id   = GetNonNullableParamValue <int>(ConfigUtilKeys.EventE3Id);
            EventE4Id   = GetNonNullableParamValue <int>(ConfigUtilKeys.EventE4Id);



            ResetPasswordTimeOutInHours = GetNonNullableParamValue <int>(ConfigUtilKeys.ResetPasswordTimeOutInHours);
        }