LDAP Authentication
In order to enable LDAP, the following has been added to the CompSocWiki configuration (/etc/moin/compsocwiki.py):
1 import ldap
2
3 auth = [ldap_login, moin_cookie] # LDAP should be used,
4 # MoinMoin should create cookies
5 ldap_uri = 'ldap://backus.uwcs.co.uk' # Our server
6 ldap_coding = 'utf-8'
7 ldap_verbose = True # More informative error messages, this may want
8 # to go
9
10 ldap_binddn = '' # We currently have our LDAP server set up for anonymous bind, so that is
11 ldap_bindpw = '' # what is used
12
13 ldap_email_attribute = '' # If email addresses are ever stored in LDAP, this should be
14 # set to point to them
15
16 ldap_base = 'ou=People,dc=backus,dc=uwcs,dc=co,dc=uk' # base DN we use for searching
17 ldap_scope = ldap.SCOPE_SUBTREE # scope of the search we do
18 ldap_name_attribute = 'uid'
19 ldap_timeout = 10 # how long we wait for the ldap server [s]
20 cookie_lifetime = 1 # 1 hour after last access ldap login is required again
21 user_autocreate = True # If a user doesn't exist, create them
To only allow logged in users to edit pages add:
1 from MoinMoin.security import Permissions
2 class SecurityPolicy(Permissions):
3 def save(self, editor, newtext, rev, **kw):
4 #only known users are allowed to edit
5 return self.request.user.valid