# -*- coding: iso-8859-1 -*-

"""
    MoinMoin - example farm config

	DJ / 1.0 / 08.04.2006 - Initial Release
	DJ / 2.0 / 19.11.2009 - Rewrote for MoinMoin 1.8 as syntax changed after 1.5
	DJ / 2.1 / 15.12.2009 - Changed wiki path, tested with 1.9
        DJ / 2.2 / 16.12.2009 - added authentication with LDAP under MoinMoin 1.9

   When used with ISAPI/WSGI under IIS, an iisreset must be issued
   for changes in this file to apply

"""

# Wikis in your farm --------------------------------------------------
wikis = [
    ("Wiki1",  r"^.*/wiki1.*$"),
    ("Wiki2",  r"^.*/wiki2.*$"),
]


# Common configuration for all wikis ----------------------------------
from MoinMoin.config.multiconfig import DefaultConfig
import os.path

# Automatically calculates path based on standard OEM structures, used by subwikis
class ConfigPath(object):
		# where are we...
		ConfigDir = os.path.dirname( os.path.realpath( __file__ ) )
		Root = os.path.dirname( os.path.realpath(  (ConfigDir + "\\..") ) )
		Common = os.path.dirname( os.path.realpath(  (ConfigDir + "\\..\\common") ) )
	
class FarmConfig(DefaultConfig):

    # Critical setup  ---------------------------------------------------

    data_dir = './data/'	
    data_underlay_dir = ConfigPath.Common + '/underlay/'
    url_prefix_static = '/moin'  #create an alias in IIS, changed from /moin_static185 in ver 1.8.5



    # Mail --------------------------------------------------------------

    mail_smarthost = "smtp.somewhere.invalid"
    mail_from = "wiki@somewhere.invalid"

    # User interface ----------------------------------------------------
    navi_bar = [
        u'%(page_front_page)s',
        u'RecentChanges',
        u'FindPage',
        u'HelpContents',
    ]
	
    # The default theme anonymous or new users get
    theme_default = 'sinorca4moin'

    # Authentication --- Valid for MoinMoin > 1.9

    ## Insert your LDAPAuth here...

    # a list of form field names to be disabled in the UserPreferences.
    user_form_disable = ['name', ]
 
    # a list of form field names to be removed from the UserPreferences.
    user_form_remove = ['password', 'password2', ]

	
    # Language options --------------------------------------------------

    language_default = 'en'

    page_category_regex = ur'(?P<all>Category(?P<key>\S+))'
    page_dict_regex = ur'(?P<all>(?P<key>\S+)Dict)'
    page_group_regex = ur'(?P<all>(?P<key>\S+)Group)'
    page_template_regex = ur'(?P<all>(?P<key>\S+)Template)'

    # Content options ---------------------------------------------------
    show_hosts = 0
    show_interwiki = True
    logo_string = u''

    # Interwiki linking ----------------
    shared_intermap = ConfigPath.ConfigDir + '\\intermap.txt'
    user_homewiki = 'Wiki1'
    user_dir = ConfigPath.Common + '\\User'
    interwiki_preferred = ['Wiki1','Wiki2']
    trusted_wikis = [ 'Wiki1','Wiki2']

    # Valid for MoinMoin <= 1.9.0; to be changed after 1.9.0
    cookie_path = '/'

    # Permissions ---------------------
    superuser = [u"JohnDoe", ]
    acl_hierarchic = True
    acl_rights_before = u"AdminGroup:admin,read,write,delete,revert"
    acl_rights_default=u"Trusted:read,write,delete,revert Known:read,write,delete,revert ViewerGroup:read All:"


    # show_timings = True
    # Enable graphical charts, requires gdchart.
    #chart_options = {'width': 600, 'height': 300}

