Exemple #1
0
        /// <summary>
        /// Gets the page change moderation mode for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static ChangeModerationMode GetModerationMode(string wiki)
        {
            string value = SettingsTools.GetString(GetProvider(wiki).GetSetting("ChangeModerationMode"),
                                                   ChangeModerationMode.None.ToString());

            return((ChangeModerationMode)Enum.Parse(typeof(ChangeModerationMode), value, true));
        }
Exemple #2
0
        /// <summary>
        /// Gets or sets the main URL of the Wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        /// <returns>The main URL associated with the given wiki.</returns>
        public static string GetMainUrl(string wiki)
        {
            string s = SettingsTools.GetString(GetProvider(wiki).GetSetting("MainUrl"), "http://www.server.com/");

            if (!s.EndsWith("/"))
            {
                s += "/";
            }
            return(s);
        }
Exemple #3
0
        /// <summary>
        /// Gets the name of the theme for the given wiki for the given namespace.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        /// <param name="nspace">The namespace (<c>null</c> for the root).</param>
        /// <returns>The name of the theme.</returns>
        public static string GetTheme(string wiki, string nspace)
        {
            if (!string.IsNullOrEmpty(nspace))
            {
                nspace = Pages.FindNamespace(wiki, nspace).Name;
            }
            string propertyName = "Theme" + (!string.IsNullOrEmpty(nspace) ? "-" + nspace : "");

            return(SettingsTools.GetString(GetProvider(wiki).GetSetting(propertyName), "standard|Default"));
        }
Exemple #4
0
        /// <summary>
        /// Gets the Account Activation Mode for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static AccountActivationMode GetAccountActivationMode(string wiki)
        {
            string value = SettingsTools.GetString(GetProvider(wiki).GetSetting("AccountActivationMode"), "EMAIL");

            switch (value.ToLowerInvariant())
            {
            case "email":
                return(AccountActivationMode.Email);

            case "admin":
                return(AccountActivationMode.Administrator);

            case "auto":
                return(AccountActivationMode.Auto);

            default:
                return(AccountActivationMode.Email);
            }
        }
Exemple #5
0
 /// <summary>
 /// Gets the name of the default Administrators group in the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetAdministratorsGroup(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("AdministratorsGroup"), "Administrators"));
 }
Exemple #6
0
 /// <summary>
 /// Gets the Discussion Permissions for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetDiscussionPermissions(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DiscussionPermissions"), "PAGE"));
 }
Exemple #7
0
 /// <summary>
 /// Gets the IP/Host filter for page editing for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetIpHostFilter(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("IpHostFilter"), ""));
 }
Exemple #8
0
        /// <summary>
        /// Gets the file download count extension filter for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static string[] GetFileDownloadCountFilter(string wiki)
        {
            string raw = SettingsTools.GetString(GetProvider(wiki).GetSetting("FileDownloadCountFilter"), "");

            return(raw.ToLowerInvariant().Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries));
        }
Exemple #9
0
 /// <summary>
 /// Gets the last page indexing.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 /// <returns>The last page indexing DateTime.</returns>
 public static DateTime GetLastPageIndexing(string wiki)
 {
     return(DateTime.ParseExact(SettingsTools.GetString(GetProvider(wiki).GetSetting("LastPageIndexing"), DateTime.Now.AddYears(-10).ToString("yyyyMMddHHmmss")),
                                "yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture));
 }
Exemple #10
0
 /// <summary>
 /// Gets the Master Password of the given wiki, used to encrypt the Users data.
 /// </summary>
 public static string GetMasterPassword()
 {
     return((string)Cache.GetCachedItem("MasterPassword", () => SettingsTools.GetString(Provider.GetSetting("MasterPassword"), "")));
 }
Exemple #11
0
 /// <summary>
 /// Gets the name of the default Anonymous users group in the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetAnonymousGroup(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("AnonymousGroup"), "Anonymous"));
 }
Exemple #12
0
 /// <summary>
 /// Gets the Defaul Page of the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetDefaultPage(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DefaultPage"), "MainPage"));
 }
Exemple #13
0
 /// <summary>
 /// Gets the DateTime format for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetDateTimeFormat(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DateTimeFormat"), "yyyy'/'MM'/'dd' 'HH':'mm"));
 }
Exemple #14
0
 /// <summary>
 /// Gets the Default Timezone Id for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetDefaultTimezone(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DefaultTimezone"), null));
 }
Exemple #15
0
 /// <summary>
 /// Gets the Default Language for the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetDefaultLanguage(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("DefaultLanguage"), "en-US"));
 }
Exemple #16
0
 /// <summary>
 /// Gets or sets the Title of the Wiki.
 /// </summary>
 public static string GetWikiTitle(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("WikiTitle"), "ScrewTurn Wiki"));
 }
Exemple #17
0
 /// <summary>
 /// Gets the name of the default Users group in the given wiki.
 /// </summary>
 /// <param name="wiki">The wiki.</param>
 public static string GetUsersGroup(string wiki)
 {
     return(SettingsTools.GetString(GetProvider(wiki).GetSetting("UsersGroup"), "Users"));
 }
Exemple #18
0
        /// <summary>
        /// Gets the list of allowed file types for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static string[] GetAllowedFileTypes(string wiki)
        {
            string raw = SettingsTools.GetString(GetProvider(wiki).GetSetting("AllowedFileTypes"), "jpg|jpeg|gif|png|tif|tiff|bmp|svg|htm|html|zip|rar|pdf|txt|doc|xls|ppt|docx|xlsx|pptx");

            return(raw.ToLowerInvariant().Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries));
        }
Exemple #19
0
 /// <summary>
 /// Gets the Master Password of the given wiki, used to encrypt the Users data.
 /// </summary>
 public static string GetMasterPassword()
 {
     return(SettingsTools.GetString(Provider.GetSetting("MasterPassword"), ""));
 }
Exemple #20
0
        /// <summary>
        /// Gets the file download count filter mode for the given wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static FileDownloadCountFilterMode GetFileDownloadCountFilterMode(string wiki)
        {
            string raw = SettingsTools.GetString(GetProvider(wiki).GetSetting("FileDownloadCountFilterMode"), FileDownloadCountFilterMode.CountAll.ToString());

            return((FileDownloadCountFilterMode)Enum.Parse(typeof(FileDownloadCountFilterMode), raw));
        }
Exemple #21
0
 /// <summary>
 /// Gets the Master Password of the given wiki, used to encrypt the Users data.
 /// </summary>
 public static string GetMasterPassword(IGlobalSettingsStorageProviderV60 provider)
 {
     return((string)Cache.GetCachedItem("MasterPassword", () => SettingsTools.GetString(provider.GetSetting("MasterPassword"), "")));
 }
Exemple #22
0
        /// <summary>
        /// Gets the functioning mode of RSS feeds for the specified wiki.
        /// </summary>
        /// <param name="wiki">The wiki.</param>
        public static RssFeedsMode GetRssFeedsMode(string wiki)
        {
            string value = SettingsTools.GetString(GetProvider(wiki).GetSetting("RssFeedsMode"), RssFeedsMode.Summary.ToString());

            return((RssFeedsMode)Enum.Parse(typeof(RssFeedsMode), value));
        }