Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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"));
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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"));
 }
Exemplo n.º 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"));
 }
Exemplo n.º 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"), ""));
 }
Exemplo n.º 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));
        }
Exemplo n.º 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));
 }
Exemplo n.º 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"), "")));
 }
Exemplo n.º 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"));
 }
Exemplo n.º 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"));
 }
Exemplo n.º 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"));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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"));
 }
Exemplo n.º 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"));
 }
Exemplo n.º 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"));
 }
Exemplo n.º 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));
        }
Exemplo n.º 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"), ""));
 }
Exemplo n.º 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));
        }
Exemplo n.º 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"), "")));
 }
Exemplo n.º 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));
        }