Sample user.config

Sample user.config File

As mentioned in the Web.config guide, you can use the user.config file to override any of the mojoPortal content management system settings delivered in the appConfig section of web.config. The advantage of putting custom settings in user.config is that they won't be overwritten during upgrades.

Below is a sample user.config file, with a number of common settings listed and commented for reference. There are many other settings in the appConfig section of web.config, so you should review your web.config after installation, and decide which overrides you would like to make in your user.config file.

Important: You should only put settings in user.config when you are not using the default value for the setting because defaults may change over time in some cases. The settings outlined below are generally the ones of most interest for customization, but they may not all be settings that you need to override.

When you make a change to user.config, remember to "touch" web.config so the web server will reload the changes. A recommended method is to open web.config in a text editor, add a space, then save the file.  Or if using a remote server, just download it and then upload it again. This will update web.config's date/time stamp without changing its contents. The ASP.NET runtime detects changes to the Web.config file and this makes it clear the cache and reload settings.

Sample user.config

<?xml version="1.0" encoding="utf-8"?>
<appSettings>

   <!-- Disable setup page by default. If logged in as admin, can still get to setup page -->
   <add key="DisableSetup" value="true" />
 
   <!-- Database connection string -->
    <add key="MySqlConnectionString" value="Data Source=localhost;Database=mojoportal;User ID=mojouser;Password=mojo123;Charset=utf8;"/>
 
   <!-- use the newer crypto helper methods -->
    <add key="UseLegacyCryptoHelper" value="false" />

   <!-- Indicate that SSL is available to ALL sites.
        Forces high security pages to use SSL (login, etc.) -->
   <!--
   <add key="SSLIsAvailable" value="true" />
   -->
 
   <!-- Indicate that SSL is available only to selected sites. -->
   <add key="Site1-SSLIsAvailable value="true" />
   <add key="Site2-SSLIsAvailable value="false" />
   <add key="Site3-SSLIsAvailable value="true" />
  
   <!-- Use SSL for LDAP authentication requests -->
   <add key="UseSslForLdap" value="true" />
 
   <!-- Notify administrators when new users register on the system -->
   <!-- NOTE: This key is no longer used in mojoPortal. Instead, put your -->
   <!--       notification email address(es) into: -->
   <!--       "Email Addresses(es) For User Approval Notification" -->
   <!--       in Administration, Site Settings, Security -->
   <!--
   <add key="NotifyAdminsOnNewUserRegistration" value="true" />
   -->
 
   <!-- Turn on content versioning globally throughout the site -->
   <add key="EnforceContentVersioningGlobally" value="true" />
 
   <!-- Add .dwg to the allowed extensions for upload -->
   <add key="AllowedUploadFileExtensions" value=".gif|.jpg|.jpeg|.png|.flv|.swf|.wmv|.mp3|.mp4|.tif|.asf|.asx|.avi|.mov|.mpeg|.mpg|.zip|.pdf|.doc|.docx|    .xls|.xlsx|.ppt|.pptx|.csv|.txt|.dwg"/>

   <!-- Add two keys to allow for mixed case in folder/file names. Per Joe Audette,

        The reason we force lower case by default is because mojoPortal can run on Linux. On Windows urls are not case sensitive
        because the file system is not case sensitive, but on Linux both the file system and urls are case sensitive so one
        mistake in capitalization can cause a broken url and forcing lower case ensures a convention that will prevent that.
 
        If you are 100% sure you will never move your mojoPortal site to Linux or host the files on a Linux server it is fine
        to allow mixed case.-->
   <add key="ForceLowerCaseForFolderCreation" value="false" />
   <add key="ForceLowerCaseForUploadedFiles" value="false" />
 
   <!-- Place galleries under media folder. Recommended for new sites -->
   <add key="ImageGalleryUseMediaFolder" value="true" />
 
   <!-- Take advantage of latest search improvements -->
   <add key="DisableSearchFeatureFilters" value="false" />
   <add key="SearchUseBackwardCompatibilityMode" value="false" />
   <add key="EnableSearchResultsHighlighting" value="true" />
 
   <!-- Allow admins to easily rebuild search index when needed -->
   <add key="ShowRebuildSearchIndexButtonToAdmins" value="true" />
   
   <!-- Prevent leaking of hidden information through search -->
   <add key="SearchIncludeModuleRoleFilters" value="true" />
 
   <!-- SMTP Settings -->
   <add key="SMTPServer" value="localhost" />
   <add key="SMTPUser" value="me@mydomain.com" />
   <add key="SMTPUseSsl" value="false" />
   <add key="SMTPPort" value="25" />
   <add key="SMTPTimeoutInMilliseconds" value="30000" />
 
   <add key="SearchResultsPageSize" value="20" />
 
   <add key="FolderGalleryPreviewWidth" value="800" />
 
   <!-- Customize hiding/unhiding of menus throughout different parts of the site -->  
   <add key="HideMenusOnLoginPage" value="true" />
   <add key="HideMenusOnRegisterPage" value="true" />
   <add key="HideMenusOnPasswordRecoveryPage" value="true" />
   <add key="HideMenusOnChangePasswordPage" value="true" />
   <add key="HideAllMenusOnProfilePage" value="false" />
   <add key="HidePageMenuOnProfilePage" value="true" />
   <add key="HideAllMenusOnMyPage" value="false" />
   <add key="HideMenusOnSiteMap" value="false" />
   <add key="HidePageMenusOnSiteMap" value="true" />
   <add key="SuppressMenuOnBuiltIn404Page" value="false"/>
 
   <!-- Alter page title - may make the title better for SEO -->
   <add key="PageTitleFormatName" value="TitlePlusSite" />
 
   <!-- Specify a custom config file name for potential custom profile options -->
   <add key="mojoProfileConfigFileName" value="myCustomProfile.config" />  
 
   <!-- Don't show the Google search on the 404 page -->
   <add key="EnableGoogle404Enhancement" value="false"/>
 
   <!-- Allow forcing of incoming host name to a canonical value, so SSL will work correctly.
        This is also supposed to be good for SEO optimization purposes -->
   <add key="AllowForcingPreferredHostName" value="true" />
     
   <!-- The following should be disabled on a development server only!
        Setting these values to false will make skin/CSS development and  
        debugging much easier -->
   <add key="CombineCSS" value="true" />
   <add key="MinifyCSS" value="true" />
   <add key="CacheCssOnServer" value="true"/>
   <add key="CacheCssInBrowser" value="true"/>

</appSettings>

Created 2010-11-18 by Jamie Eubanks
Modified 2012-04-10 by Jamie Eubanks