schooltool.ldap-1.0.2/0000755000175000017500000000000012275203725015753 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/base.cfg0000644000175000017500000000162312252370732017346 0ustar menesismenesis00000000000000[buildout] extends = http://ftp.schooltool.org/schooltool/trunk/versions.cfg versions = versions newest = false find-links = http://ftp.schooltool.org/schooltool/trunk/ http://ftp.schooltool.org/schooltool/trunk/dev/ parts = package test scripts ctags omelette [package] recipe = zc.recipe.egg:eggs unzip = true # set eggs to package name in buildout.cfg eggs = [scripts] recipe = zc.recipe.egg:scripts unzip = true eggs = ${package:eggs} schooltool schooltool.devtools scripts = # schooltool.devtools: i18nextract # schooltool: make-schooltool-instance start-schooltool-instance interpreter = python [test] recipe = zc.recipe.testrunner eggs = ${package:eggs} defaults = ['-v', '--auto-color'] [ctags] recipe = z3c.recipe.tag:tags eggs = ${test:eggs} [omelette] recipe = collective.recipe.omelette eggs = ${test:eggs} ignores = roman zope.ucol site schooltool.ldap-1.0.2/buildout.cfg0000644000175000017500000000023312275203724020260 0ustar menesismenesis00000000000000[buildout] extends = base.cfg develop = . [versions] # Unset versions of packages you want to develop schooltool.ldap = [package] eggs = schooltool.ldap schooltool.ldap-1.0.2/develop.cfg0000644000175000017500000000017612232251015020062 0ustar menesismenesis00000000000000[buildout] extends = deploy.cfg parts += coverage [coverage] recipe = zc.recipe.egg:scripts unzip = true eggs = z3c.coverage schooltool.ldap-1.0.2/src/0000755000175000017500000000000012275203725016542 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool.ldap.egg-info/0000755000175000017500000000000012275203725023340 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool.ldap.egg-info/SOURCES.txt0000644000175000017500000000255512275203725025233 0ustar menesismenesis00000000000000CHANGES.txt GPL.txt MANIFEST.in Makefile README.txt base.cfg bootstrap.py buildout.cfg deploy.cfg develop.cfg setup.py version.txt.in src/schooltool/__init__.py src/schooltool.ldap.egg-info/PKG-INFO src/schooltool.ldap.egg-info/SOURCES.txt src/schooltool.ldap.egg-info/dependency_links.txt src/schooltool.ldap.egg-info/entry_points.txt src/schooltool.ldap.egg-info/namespace_packages.txt src/schooltool.ldap.egg-info/not-zip-safe src/schooltool.ldap.egg-info/requires.txt src/schooltool.ldap.egg-info/top_level.txt src/schooltool/ldap/__init__.py src/schooltool/ldap/component.xml src/schooltool/ldap/config.py src/schooltool/ldap/configure.zcml src/schooltool/ldap/i18n.zcml src/schooltool/ldap/interfaces.py src/schooltool/ldap/plugin.zcml src/schooltool/ldap/security.py src/schooltool/ldap/security.txt src/schooltool/ldap/translations.zcml src/schooltool/ldap/browser/__init__.py src/schooltool/ldap/browser/configure.zcml src/schooltool/ldap/browser/settings.py src/schooltool/ldap/browser/templates/ldap.pt src/schooltool/ldap/browser/templates/ldap_overview.pt src/schooltool/ldap/locales/nl.po src/schooltool/ldap/locales/schooltool.ldap.pot src/schooltool/ldap/locales/si.po src/schooltool/ldap/locales/nl/LC_MESSAGES/schooltool.ldap.mo src/schooltool/ldap/locales/si/LC_MESSAGES/schooltool.ldap.mo src/schooltool/ldap/tests/__init__.py src/schooltool/ldap/tests/test_security.pyschooltool.ldap-1.0.2/src/schooltool.ldap.egg-info/top_level.txt0000644000175000017500000000001312275203725026064 0ustar menesismenesis00000000000000schooltool schooltool.ldap-1.0.2/src/schooltool.ldap.egg-info/entry_points.txt0000644000175000017500000000020612275203725026634 0ustar menesismenesis00000000000000 [schooltool.plugin_configuration] schooltool.ldap = schooltool.ldap [z3c.autoinclude.plugin] target = schooltool schooltool.ldap-1.0.2/src/schooltool.ldap.egg-info/PKG-INFO0000644000175000017500000000377412275203725024450 0ustar menesismenesis00000000000000Metadata-Version: 1.1 Name: schooltool.ldap Version: 1.0.2 Summary: LDAP authentication plugin for SchoolTool Home-page: http://www.schooltool.org Author: SchoolTool Developers Author-email: schooltool-developers@lists.launchpad.net License: GPL Description: Allows users to authenticate to SchoolTool using LDAP. Deployment ---------- Here is what it takes to get this plugin deployed: 1) schooltool.ldap needs to be in the path (whether as an egg or as part of a sandbox) 2) you can configure ldap before first start by adding to schooltool.conf:: %import schooltool.ldap uri ldap://localhost:389 3) or through the web from the Server tab. See http://book.schooltool.org/ldap.html for more information ======= CHANGES ======= 1.0.2 (2014-02-07) ------------------ - Support non-ascii characters in data coming from LDAP (https://launchpad.net/bugs/1277518) 1.0.1 (2013-12-12) ------------------ - Fix failure to start when example /etc/ldap.conf exists (https://launchpad.net/bugs/1251181) - Add Dutch and Sinhalese translations. 1.0 (2012-09-21) ---------------- First release. Platform: any Classifier: Development Status :: 4 - Beta Classifier: Environment :: Web Environment Classifier: Intended Audience :: End Users/Desktop Classifier: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.5 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Zope Classifier: Topic :: Education schooltool.ldap-1.0.2/src/schooltool.ldap.egg-info/requires.txt0000644000175000017500000000013712275203725025741 0ustar menesismenesis00000000000000schooltool python-ldap zope.authentication zope.component zope.session zope.security setuptoolsschooltool.ldap-1.0.2/src/schooltool.ldap.egg-info/dependency_links.txt0000644000175000017500000000000112275203725027406 0ustar menesismenesis00000000000000 schooltool.ldap-1.0.2/src/schooltool.ldap.egg-info/namespace_packages.txt0000644000175000017500000000001312275203725027665 0ustar menesismenesis00000000000000schooltool schooltool.ldap-1.0.2/src/schooltool.ldap.egg-info/not-zip-safe0000644000175000017500000000000112232251016025553 0ustar menesismenesis00000000000000 schooltool.ldap-1.0.2/src/schooltool/0000755000175000017500000000000012275203725020727 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/__init__.py0000644000175000017500000000007012232251015023021 0ustar menesismenesis00000000000000__import__('pkg_resources').declare_namespace(__name__) schooltool.ldap-1.0.2/src/schooltool/ldap/0000755000175000017500000000000012275203725021647 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/security.txt0000644000175000017500000000012112232251015024235 0ustar menesismenesis00000000000000Unit tests for schooltool.ldap.security >>> import schooltool.ldap.security schooltool.ldap-1.0.2/src/schooltool/ldap/config.py0000644000175000017500000002740412252370743023475 0ustar menesismenesis00000000000000# # SchoolTool - common information systems platform for school administration # Copyright (c) 2012 Shuttleworth Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # """ LDAP authentication plugin configuration. """ import os import re import ldap from persistent import Persistent from zope.annotation.interfaces import IAnnotations from zope.component import provideUtility, adapter, getUtility from zope.interface import implements, implementer from schooltool.app.interfaces import ISchoolToolApplication from schooltool.ldap.interfaces import ILDAPConfig, ILDAPPersonsConfig from schooltool.ldap.interfaces import ILDAPAutoConfig ST_APP_LDAP_KEY = 'schooltool.ldap.configuration' LDAP_SCOPES = { 'base': ldap.SCOPE_BASE, # scope of the entry 'one': ldap.SCOPE_ONELEVEL, # search directly into entry 'sub': ldap.SCOPE_SUBTREE, # search whole subtree } def cleanup_ldap_filter(filter): if not filter: return filter filter = filter.strip() if not filter.startswith('('): filter = '(%s)' % filter return filter def filter_op_filter(filter, other, op='&'): if not filter: return cleanup_ldap_filter(other) filter = filter.strip() if filter.startswith('('): template = '%s%s(%s)' else: template = '%s(%s)(%s)' result = template % ( op, filter, ldap.filter.filter_format('%s=%s', other)) return cleanup_ldap_filter(result) def decode_ldap_query(query, lenient=False): """Decode params from ldap.conf query.""" # RFC2307bis naming contexts # Syntax: base?scope?filter # where scope is {base,one,sub} base = scope = filter = None query = [s.strip() for s in query.split('?')] if query: base = query.pop(0) if query: token = query.pop(0).lower() if token not in LDAP_SCOPES and not lenient: raise ValueError(query, 'expected %r got %r' % ( tuple(LDAP_SCOPES), token)) scope = token if query: filter = '?'.join(query) return base, scope, filter class LDAPConfig(Persistent): implements(ILDAPConfig) uri = 'ldap://127.0.0.1:389' timeout = 10 bind_dn = None bind_password = None def copy(self): copy = self.__class__() copy.uri = self.uri copy.timeout = self.timeout copy.bind_dn = self.bind_dn copy.bind_password = self.bind_password return copy class LDAPPersonsConfig(LDAPConfig): implements(ILDAPPersonsConfig) queries = u'' groupQueries = u'' posixGroups = u'' def copy(self): copy = LDAPConfig.copy(self) copy.queries = self.queries copy.groupQueries = self.groupQueries copy.posixGroups = self.posixGroups return copy class LDAPPersonsAutoConfig(LDAPPersonsConfig): implements(ILDAPAutoConfig) enable_ttw = True def iter_ldap_config(config_file): if isinstance(config_file, str): config_file = open(config_file) text = config_file.read() token_re = re.compile('\s') for line in text.splitlines(): line = line.strip() if not line or line.startswith('#'): continue tokens = [t.strip() for t in token_re.split(line, 1)] if len(tokens) == 1: yield tokens[0], None else: yield tokens[0], tokens[1] class LDAPConfigParser(object): config = None def __init__(self): self.clear() def clear(self): self.config = LDAPPersonsConfig() self.config.uri = None def parse(self, config_file, **defaults): cache = dict(defaults) entries = list(iter_ldap_config(config_file)) for token, value in entries: method = getattr(self, 'pre_%s' % token.lower(), None) if method is not None: method(value, cache) for token, value in entries: method = getattr(self, 'on_%s' % token.lower(), None) if method is not None: method(value, cache) self.after_parse(config_file, cache) def after_parse(self, config_file, cache): self.set_default_uri(cache) self.append_pam_query(cache) self.set_fallback_query(cache) def set_default_uri(self, cache): if self.config.uri is None: self.config.uri = 'ldap://%(host)s:%(port)s' % { 'host': cache.get('host', '127.0.0.1'), 'port': cache.get('port', '389'), } def append_pam_query(self, cache): if ('base' in cache and ('pam_filter' in cache or 'pam_login_attribute' in cache)): pam_filter = cleanup_ldap_filter( cache.get('pam_filter', 'objectClass=posixAccount')) pam_login_attr = cache.get('pam_login_attribute', 'uid') query = '%s %s?%s?%s' % ( pam_login_attr, cache['base'], cache.get('scope', 'sub'), pam_filter ) self.config.queries = ('%s\n%s' % (self.config.queries, query)).strip() def set_fallback_query(self, cache): if not self.config.queries: if ('fallback_login_attr' in cache and 'fallback_login_filter' in cache and 'base' in cache): self.config.queries = '%s %s?%s?%s' % ( cache['fallback_login_attr'], cache['base'], cache.get('scope', 'sub'), cleanup_ldap_filter(cache['fallback_login_filter']) ) def pre_host(self, value, cache): cache['host'] = value def pre_port(self, value, cache): cache['port'] = value def pre_base(self, value, cache): cache['base'] = value def on_uri(self, value, cache): self.config.uri = value def on_binddn(self, value, cache): self.config.bind_dn = value def on_bindpw(self, value, cache): self.config.bind_password = value def pre_scope(self, value, cache): value = value.lower() if value in LDAP_SCOPES: cache['scope'] = value def on_timelimit(self, value, cache): pass # not implemented def on_bind_timelimit(self, value, cache): pass # not implemented def pre_pam_filter(self, value, cache): #A filter to AND with uid=%s #pam_filter objectclass=account cache['pam_filter'] = value def pre_pam_login_attribute(self, value, cache): # The user ID attribute (defaults to uid) #pam_login_attribute uid cache['pam_login_attribute'] = value def on_pam_password(self, value, cache): # Password type. # XXX: we support only md5 (I think) pass # not implemented def on_pam_groupdn(self, value, cache): # Group to enforce membership of #pam_groupdn cn=PAM,ou=Groups,dc=example,dc=com pass # not implemented def on_nss_base_passwd(self, value, cache): # account query base, scope, ldap_filter = decode_ldap_query(value, lenient=True) scope = scope.lower() if scope is not None else '' if scope not in LDAP_SCOPES: scope = cache.get('scope', 'sub') attr = cache.get('fallback_login_attr', 'uid') query = '%s %s' % ( attr, '?'.join(filter(None, (base, scope, ldap_filter)))) self.config.queries = ('%s\n%s' % (self.config.queries, query)).strip() def on_nss_base_group(self, value, cache): base, scope, ldap_filter = decode_ldap_query(value, lenient=True) scope = scope.lower() if scope is not None else '' if scope not in LDAP_SCOPES: scope = cache.get('scope', 'sub') if ldap_filter: ldap_filter = cleanup_ldap_filter(ldap_filter) query = '?'.join(filter(None, (base, scope, ldap_filter))) self.config.groupQueries = ('%s\n%s' % (self.config.groupQueries, query)).strip() AUTODETECT_FROM = '/etc/ldap.conf' FALLBACK_LOGIN_ATTR = 'uid' FALLBACK_LOGIN_FILTER = 'objectClass=posixAccount' def handle_configuration(options, context): parser = LDAPConfigParser() context.provideFeature('ldap_authentication') if getattr(options.config, 'ldap_authentication', None) is None: if (AUTODETECT_FROM and os.path.isfile(AUTODETECT_FROM)): parser.parse( AUTODETECT_FROM, fallback_login_attr=FALLBACK_LOGIN_ATTR, fallback_login_filter=FALLBACK_LOGIN_FILTER) else: config = options.config.ldap_authentication if (config.autodetect_from and os.path.isfile(config.autodetect_from)): parser.parse( config.autodetect_from, fallback_login_attr=config.default_login_attr, fallback_login_filter=config.default_login_filter) if config.uri: parser.config.uri = config.uri if config.query_users: queries = [ entry if len(entry.split()) > 1 else '%s %s' % ( config.default_login_attr, entry) for entry in config.query_users if entry.strip()] parser.config.queries = '\n'.join(queries) if config.query_groups: parser.config.groupQueries = '\n'.join(filter(None, config.query_groups)) if config.bind_dn: parser.config.bind_dn = config.bind_dn parser.config.bind_password = '' if config.bind_password: parser.config.bind_password = config.bind_password if config.bind_group: groups = [] for entry in config.bind_group: if not entry.strip(): continue entry = entry.split() if len(entry) == 2: st_year = '' st_group, posix_id = entry groups.append((st_year, st_group, posix_id)) elif len(entry) == 3: st_year, st_group, posix_id = entry groups.append((st_year, st_group, posix_id)) parser.config.posixGroups = '\n'.join([', '.join(e) for e in groups]) parser.config.timeout = int(config.timeout) provideUtility(parser.config, ILDAPConfig) context.provideFeature('authentication') @adapter(ISchoolToolApplication) @implementer(ILDAPConfig) def getAppLDAPConfig(app): annotations = IAnnotations(app) config = annotations.get(ST_APP_LDAP_KEY, None) if config is None: template = getUtility(ILDAPConfig) config = template.copy() return config @adapter(ISchoolToolApplication) @implementer(ILDAPPersonsConfig) def getAppLDAPPersonsConfig(app): config = getAppLDAPConfig(app) if config is None: return None return ILDAPPersonsConfig(config, None) def get_configuration(): return ("""
Configuration for LDAP authentication plugin. <ldap_authentication> allow_web_config no uri ldap://127.0.0.1:389 </ldap_authentication>
""", handle_configuration) schooltool.ldap-1.0.2/src/schooltool/ldap/__init__.py0000644000175000017500000000232112232251015023742 0ustar menesismenesis00000000000000# # SchoolTool - common information systems platform for school administration # Copyright (c) 2005 Shuttleworth Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # """ LDAP authentication plugin. """ from __future__ import absolute_import from zope.i18nmessageid import Message, MessageFactory SchoolToolLDAPMessage = MessageFactory("schooltool.ldap") from schooltool.ldap import ( config, interfaces, security, ) from schooltool.ldap.config import get_configuration, handle_configuration from schooltool.ldap.security import LDAPAuthenticationPlugin schooltool.ldap-1.0.2/src/schooltool/ldap/component.xml0000644000175000017500000000540212232251015024360 0ustar menesismenesis00000000000000 Allow changing configuration through the web. Try auto detecting LDAP settings from here. Default login attribute for LDAP user entries. Default login filter to get LDAP user entries. The uri of the LDAP server. Examples: uri ldap://127.0.0.1:389 uri ldaps://127.0.0.1 uri ldapi://%2fvar%2frun%2fldapi_sock/ Timeout in seconds. Negative timeout means no timeout. One or more queries to obtain LDAP users, in form of "login_attribute base?scope?filter" (scope is base/one/sub). Examples: query_users uid dc=localhost?sub?(objectClass=inetOrgPerson) query_users cn ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person) One or more queries to obtain LDAP groups, in form of "login_attribute base?scope?filter" (scope is base/one/sub). Examples: query_groups dc=localhost?sub?(objectClass=posixGroup) query_groups ou=Groups,dc=school,dc=example,dc=com?one POSIX group ids to bind with schooltool groups Format (year) group posix_id Examples: bind_group teachers 7001 bind_group 2011-2012 students 6001 Bind DN. Bind password. schooltool.ldap-1.0.2/src/schooltool/ldap/i18n.zcml0000644000175000017500000000035612232251015023305 0ustar menesismenesis00000000000000 schooltool.ldap-1.0.2/src/schooltool/ldap/plugin.zcml0000644000175000017500000000033112232251015024015 0ustar menesismenesis00000000000000 schooltool.ldap-1.0.2/src/schooltool/ldap/configure.zcml0000644000175000017500000000312712232251015024506 0ustar menesismenesis00000000000000 schooltool.ldap-1.0.2/src/schooltool/ldap/locales/0000755000175000017500000000000012275203725023271 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/locales/si.po0000644000175000017500000002060412252370015024236 0ustar menesismenesis00000000000000# Sinhalese translation for schooltool.ldap # Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 # This file is distributed under the same license as the schooltool.ldap package. # FIRST AUTHOR , 2013. # msgid "" msgstr "" "Project-Id-Version: schooltool.ldap\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-09-21 14:55+0300\n" "PO-Revision-Date: 2013-05-31 17:29+0000\n" "Last-Translator: Thilini Lakmini \n" "Language-Team: Sinhalese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2013-06-01 05:41+0000\n" "X-Generator: Launchpad (build 16660)\n" #: /src/schooltool/ldap/browser/configure.zcml:10 #: /src/schooltool/ldap/browser/configure.zcml:23 msgid "LDAP Configuration" msgstr "LDAP වින්‍යාසය" #: /src/schooltool/ldap/browser/settings.py:42 msgid "LDAP settings" msgstr "LDAP සිටුවම්" #: /src/schooltool/ldap/browser/settings.py:55 msgid "Apply" msgstr "යොදන්න" #: /src/schooltool/ldap/browser/settings.py:66 msgid "Reset to defaults" msgstr "පෙරනිමි අගයන්ට නැවත සකසන්න" #: /src/schooltool/ldap/browser/settings.py:74 msgid "Cancel" msgstr "අහෝසි කරන්න" #: /src/schooltool/ldap/browser/settings.py:99 #: /src/schooltool/ldap/browser/settings.py:102 msgid "Not configured" msgstr "වින්‍යාස නොකළ" #: /src/schooltool/ldap/browser/settings.py:106 msgid "Bad configuration" msgstr "නුසුදුසු වින්‍යාසයකි" #: /src/schooltool/ldap/browser/settings.py:108 msgid "Bad bind DN or password" msgstr "නුසුදුසු ලෙස බැඳී DN හෝ මුරපදයකි" #: /src/schooltool/ldap/browser/settings.py:110 msgid "Down" msgstr "පහලට" #: /src/schooltool/ldap/browser/settings.py:113 msgid "Active" msgstr "සක්‍රීය කරන්න" #: /src/schooltool/ldap/browser/settings.py:124 msgid "No client DN queries configured, LDAP SSO disabled." msgstr "වින්‍යාස කළ සේවා ලාභී DN විමසීම් නැත, LDAP SSO අක්‍රීය කර ඇත" #: /src/schooltool/ldap/browser/settings.py:133 msgid "Bad DN query(-ies)" msgstr "නුසුදුසු DN විමසීමක්" #: /src/schooltool/ldap/browser/settings.py:140 msgid "${amount} users in LDAP." msgstr "LDAP හි පරිශීලකයන් $(ප්‍රමාණය) ක් සිටියි" #: /src/schooltool/ldap/browser/templates/ldap.pt:11 #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:31 msgid "Server status" msgstr "සේවාදායක තත්වය" #: /src/schooltool/ldap/browser/templates/ldap.pt:15 #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:35 msgid "Users" msgstr "පරිශීලකයන්" #: /src/schooltool/ldap/browser/templates/ldap.pt:22 msgid "Done" msgstr "අවසන්" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:3 msgid "LDAP single sign on" msgstr "LDAP තනි පිවිසීමක්" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:7 msgid "Change LDAP settings" msgstr "LDAP සිටුවම් වෙනස් කරන්න" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:10 msgid "Edit" msgstr "සංස්කරණය කරන්න" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:17 msgid "LDAP support is installed but not configured." msgstr "LDAP සහය ස්ථාපනය කර ඇති නමුත් වින්‍යාස කර නැත" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:27 msgid "URI" msgstr "URI" #: /src/schooltool/ldap/interfaces.py:32 #: /src/schooltool/ldap/interfaces.py:104 msgid "LDAP server URI" msgstr "LDAP සේවාදායක URI" #: /src/schooltool/ldap/interfaces.py:33 #: /src/schooltool/ldap/interfaces.py:105 msgid "Example: ldap://localhost:389" msgstr "උදාහරණ: ldap://localhost:389" #: /src/schooltool/ldap/interfaces.py:38 msgid "Bind DN" msgstr "සුවිශේෂී නාමය(DN) බඳින්න" #: /src/schooltool/ldap/interfaces.py:39 msgid "LDAP distinguished name to bind for searching users to authenticate." msgstr "" "අනන්‍යතාවය තහවුරු කරගැනීමට පරිශීලකයන් සෙවීම සඳහා බැඳීමට LDAP සුවිශේෂී නාමය" #: /src/schooltool/ldap/interfaces.py:47 msgid "Bind password" msgstr "මුරපදය බඳින්න" #: /src/schooltool/ldap/interfaces.py:48 msgid "Bind DN password." msgstr "DN මුරපදය බඳින්න" #: /src/schooltool/ldap/interfaces.py:53 msgid "Timeout (in seconds)." msgstr "සංක්‍රාන්ති කාලය(තත්පර වලින්)" #: /src/schooltool/ldap/interfaces.py:61 #: /src/schooltool/ldap/interfaces.py:138 msgid "User DN queries" msgstr "පරිශීලක DN විමසීම්" #: /src/schooltool/ldap/interfaces.py:62 msgid "" "One or more queries to obtain LDAP users, in form of \"login_attribute " "base?scope?filter\" (scope is base/one/sub). Examples: \"uid " "ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)\", \"cn " "ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)\"" msgstr "" "LDAP පරිශීලකයන් ග්‍රහණය කරගැනීම සඳහා \"login_attribute base?scope?filter\" " "(scope is base/one/sub). Examples: \"uid " "ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)\", \"cn " "ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)\" ආකාරයේ " "විමසීමක් හෝ විමසීම් කිහිපයක්" #: /src/schooltool/ldap/interfaces.py:72 #: /src/schooltool/ldap/interfaces.py:145 msgid "Group DN queries" msgstr "සමූහ DN විමසීම්" #: /src/schooltool/ldap/interfaces.py:73 msgid "" "One or more queries to obtain LDAP groups, in form of \"login_attribute " "base?scope?filter\" (scope is base/one/sub). Examples: " "\"dc=localhost?sub?(objectClass=posixGroup)\", " "\"ou=Groups,dc=school,dc=example,dc=com?one\"" msgstr "" "LDAP කණ්ඩායම් ග්‍රහණය කරගැනීම සඳහා \"login_attribute base?scope?filter\" " "(scope is base/one/sub). උදාහරණ: " "\"dc=localhost?sub?(objectClass=posixGroup)\", " "\"ou=Groups,dc=school,dc=example,dc=com?one\" ආකාරයේ විමසීමක් හෝ විමසීම් " "කිහිපයක්" #: /src/schooltool/ldap/interfaces.py:83 msgid "POSIX group counterparts in SchoolTool." msgstr "SchoolTool හි POSIX කණ්ඩායමේ ප්‍රතිපූර්ණ" #: /src/schooltool/ldap/interfaces.py:84 msgid "" "\"School year\" (optional) \"Group ID\" \"POSIX group ID\". Examples: \"2011-" "2012, teachers, 6001\", \"2012-2013, teachers, 7001\", \", students, 6000\"" msgstr "" "\"පාසල් වර්ෂය\" (වෛකල්පිත) \"කණ්ඩායමේ හදුනා ගැනීමේ යෙදුම \" \"POSIX කණ්ඩායමේ " "හදුනා ගැනීමේ යෙදුම\". උදාහරණ : \"2011-2012, ගුරුවරුන්, 6001\", \"2012-2013, " "ගුරුවරුන්, 7001\", \", සිසුන්, 6000\"" #: /src/schooltool/ldap/interfaces.py:97 msgid "Enable TTW editing" msgstr "TTV සංස්කරණය සදහා ඉඩ සලසන්න" #: /src/schooltool/ldap/interfaces.py:110 msgid "Configured" msgstr "වින්‍යාස කල" #: /src/schooltool/ldap/interfaces.py:111 msgid "Is this client properly configured." msgstr "මෙම සේවාලාභියා නිසිලෙස වින්‍යාස කරන ලද්දෙක්ද" #: /src/schooltool/ldap/interfaces.py:140 msgid "login_attribute, query" msgstr "ලොගනය වීමේ ගුණාංග, විමසීම්" #: /src/schooltool/ldap/interfaces.py:150 msgid "POSIX group counterparts." msgstr "POSIX කණ්ඩායමේ ප්‍රතිපූර්ණ" #: /src/schooltool/ldap/interfaces.py:152 msgid "Year ID, group ID, posix ID" msgstr "" "වර්ෂය හඳුනා ගැනීමේ යෙදුම, කණ්ඩායම හඳුනා ගැනීමේ යෙදුම, posix හඳුනා ගැනීමේ " "යෙදුම" schooltool.ldap-1.0.2/src/schooltool/ldap/locales/si/0000755000175000017500000000000012275203725023704 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/locales/si/LC_MESSAGES/0000755000175000017500000000000012275203725025471 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/locales/si/LC_MESSAGES/schooltool.ldap.mo0000644000175000017500000001372412275203724031140 0ustar menesismenesis00000000000000)d;&?FL_w  #)MD` -39H'F` rr ` %j  4 T :- <h ( %  :Oo (C(%"zH !*o%b4R@qH(O$t.xF#  )'%$ " &  (!"School year" (optional) "Group ID" "POSIX group ID". Examples: "2011-2012, teachers, 6001", "2012-2013, teachers, 7001", ", students, 6000"${amount} users in LDAP.ActiveApplyBad DN query(-ies)Bad bind DN or passwordBad configurationBind DNBind DN password.Bind passwordCancelChange LDAP settingsConfiguredDoneDownEditEnable TTW editingExample: ldap://localhost:389Group DN queriesIs this client properly configured.LDAP ConfigurationLDAP distinguished name to bind for searching users to authenticate.LDAP server URILDAP settingsLDAP single sign onLDAP support is installed but not configured.No client DN queries configured, LDAP SSO disabled.Not configuredOne or more queries to obtain LDAP groups, in form of "login_attribute base?scope?filter" (scope is base/one/sub). Examples: "dc=localhost?sub?(objectClass=posixGroup)", "ou=Groups,dc=school,dc=example,dc=com?one"One or more queries to obtain LDAP users, in form of "login_attribute base?scope?filter" (scope is base/one/sub). Examples: "uid ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)", "cn ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)"POSIX group counterparts in SchoolTool.POSIX group counterparts.Reset to defaultsServer statusTimeout (in seconds).URIUser DN queriesUsersYear ID, group ID, posix IDlogin_attribute, queryProject-Id-Version: schooltool.ldap Report-Msgid-Bugs-To: FULL NAME POT-Creation-Date: 2012-09-21 14:55+0300 PO-Revision-Date: 2013-05-31 17:29+0000 Last-Translator: Thilini Lakmini Language-Team: Sinhalese MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Launchpad-Export-Date: 2013-06-01 05:41+0000 X-Generator: Launchpad (build 16660) "පාසල් වර්ෂය" (වෛකල්පිත) "කණ්ඩායමේ හදුනා ගැනීමේ යෙදුම " "POSIX කණ්ඩායමේ හදුනා ගැනීමේ යෙදුම". උදාහරණ : "2011-2012, ගුරුවරුන්, 6001", "2012-2013, ගුරුවරුන්, 7001", ", සිසුන්, 6000"LDAP හි පරිශීලකයන් $(ප්‍රමාණය) ක් සිටියිසක්‍රීය කරන්නයොදන්නනුසුදුසු DN විමසීමක්නුසුදුසු ලෙස බැඳී DN හෝ මුරපදයකිනුසුදුසු වින්‍යාසයකිසුවිශේෂී නාමය(DN) බඳින්නDN මුරපදය බඳින්නමුරපදය බඳින්නඅහෝසි කරන්නLDAP සිටුවම් වෙනස් කරන්නවින්‍යාස කලඅවසන්පහලටසංස්කරණය කරන්නTTV සංස්කරණය සදහා ඉඩ සලසන්නඋදාහරණ: ldap://localhost:389සමූහ DN විමසීම්මෙම සේවාලාභියා නිසිලෙස වින්‍යාස කරන ලද්දෙක්දLDAP වින්‍යාසයඅනන්‍යතාවය තහවුරු කරගැනීමට පරිශීලකයන් සෙවීම සඳහා බැඳීමට LDAP සුවිශේෂී නාමයLDAP සේවාදායක URILDAP සිටුවම්LDAP තනි පිවිසීමක්LDAP සහය ස්ථාපනය කර ඇති නමුත් වින්‍යාස කර නැතවින්‍යාස කළ සේවා ලාභී DN විමසීම් නැත, LDAP SSO අක්‍රීය කර ඇතවින්‍යාස නොකළLDAP කණ්ඩායම් ග්‍රහණය කරගැනීම සඳහා "login_attribute base?scope?filter" (scope is base/one/sub). උදාහරණ: "dc=localhost?sub?(objectClass=posixGroup)", "ou=Groups,dc=school,dc=example,dc=com?one" ආකාරයේ විමසීමක් හෝ විමසීම් කිහිපයක්LDAP පරිශීලකයන් ග්‍රහණය කරගැනීම සඳහා "login_attribute base?scope?filter" (scope is base/one/sub). Examples: "uid ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)", "cn ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)" ආකාරයේ විමසීමක් හෝ විමසීම් කිහිපයක්SchoolTool හි POSIX කණ්ඩායමේ ප්‍රතිපූර්ණPOSIX කණ්ඩායමේ ප්‍රතිපූර්ණපෙරනිමි අගයන්ට නැවත සකසන්නසේවාදායක තත්වයසංක්‍රාන්ති කාලය(තත්පර වලින්)URIපරිශීලක DN විමසීම්පරිශීලකයන්වර්ෂය හඳුනා ගැනීමේ යෙදුම, කණ්ඩායම හඳුනා ගැනීමේ යෙදුම, posix හඳුනා ගැනීමේ යෙදුමලොගනය වීමේ ගුණාංග, විමසීම්schooltool.ldap-1.0.2/src/schooltool/ldap/locales/nl.po0000644000175000017500000001517212232251015024234 0ustar menesismenesis00000000000000# Dutch translation for schooltool.ldap # Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 # This file is distributed under the same license as the schooltool.ldap package. # FIRST AUTHOR , 2012. # msgid "" msgstr "" "Project-Id-Version: schooltool.ldap\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-09-21 14:55+0300\n" "PO-Revision-Date: 2012-10-27 20:19+0000\n" "Last-Translator: rob \n" "Language-Team: Dutch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2013-03-06 06:12+0000\n" "X-Generator: Launchpad (build 16514)\n" #: /src/schooltool/ldap/browser/configure.zcml:10 #: /src/schooltool/ldap/browser/configure.zcml:23 msgid "LDAP Configuration" msgstr "LDAP-configuratie" #: /src/schooltool/ldap/browser/settings.py:42 msgid "LDAP settings" msgstr "LDAP-instellingen" #: /src/schooltool/ldap/browser/settings.py:55 msgid "Apply" msgstr "Toepassen" #: /src/schooltool/ldap/browser/settings.py:66 msgid "Reset to defaults" msgstr "Standaardinstellingen herstellen" #: /src/schooltool/ldap/browser/settings.py:74 msgid "Cancel" msgstr "Annuleren" #: /src/schooltool/ldap/browser/settings.py:99 #: /src/schooltool/ldap/browser/settings.py:102 msgid "Not configured" msgstr "Niet geconfigureerd" #: /src/schooltool/ldap/browser/settings.py:106 msgid "Bad configuration" msgstr "Ongeldige configuratie" #: /src/schooltool/ldap/browser/settings.py:108 msgid "Bad bind DN or password" msgstr "Ongeldige aanmeldnaam of wachtwoord voor LDAP-server" #: /src/schooltool/ldap/browser/settings.py:110 msgid "Down" msgstr "Omlaag" #: /src/schooltool/ldap/browser/settings.py:113 msgid "Active" msgstr "Actief" #: /src/schooltool/ldap/browser/settings.py:124 msgid "No client DN queries configured, LDAP SSO disabled." msgstr "Geen client-DN zoekopdrachten ingesteld, LDAP-SSO uitgeschakeld." #: /src/schooltool/ldap/browser/settings.py:133 msgid "Bad DN query(-ies)" msgstr "Ongeldige DN-zoekopdracht(en)" #: /src/schooltool/ldap/browser/settings.py:140 msgid "${amount} users in LDAP." msgstr "${amount} gebruikers in LDAP." #: /src/schooltool/ldap/browser/templates/ldap.pt:11 #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:31 msgid "Server status" msgstr "Serverstatus" #: /src/schooltool/ldap/browser/templates/ldap.pt:15 #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:35 msgid "Users" msgstr "Gebruikers" #: /src/schooltool/ldap/browser/templates/ldap.pt:22 msgid "Done" msgstr "Gereed" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:3 msgid "LDAP single sign on" msgstr "LDAP-SSO (single sign on)" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:7 msgid "Change LDAP settings" msgstr "LDAP-instellingen wijzigen" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:10 msgid "Edit" msgstr "Bewerken" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:17 msgid "LDAP support is installed but not configured." msgstr "LDAP-ondersteuning is geïnstalleerd, maar niet geconfigureerd." #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:27 msgid "URI" msgstr "URI" #: /src/schooltool/ldap/interfaces.py:32 #: /src/schooltool/ldap/interfaces.py:104 msgid "LDAP server URI" msgstr "URI LDAP-server" #: /src/schooltool/ldap/interfaces.py:33 #: /src/schooltool/ldap/interfaces.py:105 msgid "Example: ldap://localhost:389" msgstr "Bijvoorbeeld: ldap://localhost:389" #: /src/schooltool/ldap/interfaces.py:38 msgid "Bind DN" msgstr "Aanmeldnaam voor LDAP-server" #: /src/schooltool/ldap/interfaces.py:39 msgid "LDAP distinguished name to bind for searching users to authenticate." msgstr "" "Specifieke LDAP-naam voor het zoeken van gebruikers om te authenticeren." #: /src/schooltool/ldap/interfaces.py:47 msgid "Bind password" msgstr "Wachtwoord voor LDAP-server" #: /src/schooltool/ldap/interfaces.py:48 msgid "Bind DN password." msgstr "Wachtwoord voor LDAP-server" #: /src/schooltool/ldap/interfaces.py:53 msgid "Timeout (in seconds)." msgstr "Time-out (in seconden)." #: /src/schooltool/ldap/interfaces.py:61 #: /src/schooltool/ldap/interfaces.py:138 msgid "User DN queries" msgstr "Gebruikers-DN zoekopdrachten" #: /src/schooltool/ldap/interfaces.py:62 msgid "" "One or more queries to obtain LDAP users, in form of \"login_attribute " "base?scope?filter\" (scope is base/one/sub). Examples: \"uid " "ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)\", \"cn " "ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)\"" msgstr "" "Een of meer zoekopdrachten voor LDAP-gebruikers, in de vorm van " "\"login_attribute base?scope?filter\" (scope is base/one/sub). Voorbeelden: " "\"uid ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)\", \"cn " "ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)\"" #: /src/schooltool/ldap/interfaces.py:72 #: /src/schooltool/ldap/interfaces.py:145 msgid "Group DN queries" msgstr "Groeps-DN zoekopdrachten" #: /src/schooltool/ldap/interfaces.py:73 msgid "" "One or more queries to obtain LDAP groups, in form of \"login_attribute " "base?scope?filter\" (scope is base/one/sub). Examples: " "\"dc=localhost?sub?(objectClass=posixGroup)\", " "\"ou=Groups,dc=school,dc=example,dc=com?one\"" msgstr "" "Een of meer zoekopdrachten voor LDAP-groepen, in de vorm van " "\"login_attribute base?scope?filter\" (scope is base/one/sub). Voorbeelden: " "\"dc=localhost?sub?(objectClass=posixGroup)\", " "\"ou=Groups,dc=school,dc=example,dc=com?one\"" #: /src/schooltool/ldap/interfaces.py:83 msgid "POSIX group counterparts in SchoolTool." msgstr "Tegenhangers POSIX-groep in SchoolTool." #: /src/schooltool/ldap/interfaces.py:84 msgid "" "\"School year\" (optional) \"Group ID\" \"POSIX group ID\". Examples: \"2011-" "2012, teachers, 6001\", \"2012-2013, teachers, 7001\", \", students, 6000\"" msgstr "" "\"Schooljaar\" (optional) \"Groeps-ID\" \"POSIX groeps-ID\". Voorbeelden: " "\"2011-2012, leraren, 6001\", \"2012-2013, leraren, 7001\", \", leerlingen, " "6000\"" #: /src/schooltool/ldap/interfaces.py:97 msgid "Enable TTW editing" msgstr "Via het internet bewerken toestaan" #: /src/schooltool/ldap/interfaces.py:110 msgid "Configured" msgstr "Geconfigureerd" #: /src/schooltool/ldap/interfaces.py:111 msgid "Is this client properly configured." msgstr "Is deze client correct geconfigureerd." #: /src/schooltool/ldap/interfaces.py:140 msgid "login_attribute, query" msgstr "login_attribute, zoekopdracht" #: /src/schooltool/ldap/interfaces.py:150 msgid "POSIX group counterparts." msgstr "Tegenhangers POSIX-groep" #: /src/schooltool/ldap/interfaces.py:152 msgid "Year ID, group ID, posix ID" msgstr "Jaar-ID, Groeps-ID, Posix-ID" schooltool.ldap-1.0.2/src/schooltool/ldap/locales/schooltool.ldap.pot0000644000175000017500000001200612252370706027117 0ustar menesismenesis00000000000000# SchoolTool - common information systems platform for school administration # Copyright (c) 2007 Shuttleworth Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . msgid "" msgstr "" "Project-Id-Version: schooltool.ldap\n" "POT-Creation-Date: 2013-12-12 19:22+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Schooltool Development Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: i18nextract.py\n" #: /src/schooltool/ldap/browser/settings.py:43 msgid "LDAP settings" msgstr "" #: /src/schooltool/ldap/browser/settings.py:67 msgid "Reset to defaults" msgstr "" #: /src/schooltool/ldap/browser/settings.py:100 #: /src/schooltool/ldap/browser/settings.py:103 msgid "Not configured" msgstr "" #: /src/schooltool/ldap/browser/settings.py:106 msgid "Bad configuration" msgstr "" #: /src/schooltool/ldap/browser/settings.py:108 msgid "Bad bind DN or password" msgstr "" #: /src/schooltool/ldap/browser/settings.py:110 msgid "Down" msgstr "" #: /src/schooltool/ldap/browser/settings.py:113 msgid "Active" msgstr "" #: /src/schooltool/ldap/browser/settings.py:124 msgid "No client DN queries configured, LDAP SSO disabled." msgstr "" #: /src/schooltool/ldap/browser/settings.py:133 msgid "Bad DN query(-ies)" msgstr "" #: /src/schooltool/ldap/browser/settings.py:140 msgid "${amount} users in LDAP." msgstr "" #: /src/schooltool/ldap/browser/templates/ldap.pt:11 #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:31 msgid "Server status" msgstr "" #: /src/schooltool/ldap/browser/templates/ldap.pt:15 #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:35 msgid "Users" msgstr "" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:3 msgid "LDAP single sign on" msgstr "" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:7 msgid "Change LDAP settings" msgstr "" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:17 msgid "LDAP support is installed but not configured." msgstr "" #: /src/schooltool/ldap/browser/templates/ldap_overview.pt:27 msgid "URI" msgstr "" #: /src/schooltool/ldap/interfaces.py:32 #: /src/schooltool/ldap/interfaces.py:104 msgid "LDAP server URI" msgstr "" #: /src/schooltool/ldap/interfaces.py:33 #: /src/schooltool/ldap/interfaces.py:105 msgid "Example: ldap://localhost:389" msgstr "" #: /src/schooltool/ldap/interfaces.py:38 msgid "Bind DN" msgstr "" #: /src/schooltool/ldap/interfaces.py:39 msgid "LDAP distinguished name to bind for searching users to authenticate." msgstr "" #: /src/schooltool/ldap/interfaces.py:47 msgid "Bind password" msgstr "" #: /src/schooltool/ldap/interfaces.py:48 msgid "Bind DN password." msgstr "" #: /src/schooltool/ldap/interfaces.py:53 msgid "Timeout (in seconds)." msgstr "" #: /src/schooltool/ldap/interfaces.py:61 #: /src/schooltool/ldap/interfaces.py:138 msgid "User DN queries" msgstr "" #: /src/schooltool/ldap/interfaces.py:62 msgid "One or more queries to obtain LDAP users, in form of \"login_attribute base?scope?filter\" (scope is base/one/sub). Examples: \"uid ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)\", \"cn ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)\"" msgstr "" #: /src/schooltool/ldap/interfaces.py:72 #: /src/schooltool/ldap/interfaces.py:145 msgid "Group DN queries" msgstr "" #: /src/schooltool/ldap/interfaces.py:73 msgid "One or more queries to obtain LDAP groups, in form of \"login_attribute base?scope?filter\" (scope is base/one/sub). Examples: \"dc=localhost?sub?(objectClass=posixGroup)\", \"ou=Groups,dc=school,dc=example,dc=com?one\"" msgstr "" #: /src/schooltool/ldap/interfaces.py:83 msgid "POSIX group counterparts in SchoolTool." msgstr "" #: /src/schooltool/ldap/interfaces.py:84 msgid "\"School year\" (optional) \"Group ID\" \"POSIX group ID\". Examples: \"2011-2012, teachers, 6001\", \"2012-2013, teachers, 7001\", \", students, 6000\"" msgstr "" #: /src/schooltool/ldap/interfaces.py:97 msgid "Enable TTW editing" msgstr "" #: /src/schooltool/ldap/interfaces.py:110 msgid "Configured" msgstr "" #: /src/schooltool/ldap/interfaces.py:111 msgid "Is this client properly configured." msgstr "" #: /src/schooltool/ldap/interfaces.py:140 msgid "login_attribute, query" msgstr "" #: /src/schooltool/ldap/interfaces.py:150 msgid "POSIX group counterparts." msgstr "" #: /src/schooltool/ldap/interfaces.py:152 msgid "Year ID, group ID, posix ID" msgstr "" schooltool.ldap-1.0.2/src/schooltool/ldap/locales/nl/0000755000175000017500000000000012275203725023702 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/locales/nl/LC_MESSAGES/0000755000175000017500000000000012275203725025467 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/locales/nl/LC_MESSAGES/schooltool.ldap.mo0000644000175000017500000001033212275203724031126 0ustar menesismenesis00000000000000)d;&?FL_w  #)MD` -39H'F` r  1 8 B 4`       & 5 < C "L "o  &  H - = O ?i @  ' - N[sw #  )'%$ " &  (!"School year" (optional) "Group ID" "POSIX group ID". Examples: "2011-2012, teachers, 6001", "2012-2013, teachers, 7001", ", students, 6000"${amount} users in LDAP.ActiveApplyBad DN query(-ies)Bad bind DN or passwordBad configurationBind DNBind DN password.Bind passwordCancelChange LDAP settingsConfiguredDoneDownEditEnable TTW editingExample: ldap://localhost:389Group DN queriesIs this client properly configured.LDAP ConfigurationLDAP distinguished name to bind for searching users to authenticate.LDAP server URILDAP settingsLDAP single sign onLDAP support is installed but not configured.No client DN queries configured, LDAP SSO disabled.Not configuredOne or more queries to obtain LDAP groups, in form of "login_attribute base?scope?filter" (scope is base/one/sub). Examples: "dc=localhost?sub?(objectClass=posixGroup)", "ou=Groups,dc=school,dc=example,dc=com?one"One or more queries to obtain LDAP users, in form of "login_attribute base?scope?filter" (scope is base/one/sub). Examples: "uid ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)", "cn ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)"POSIX group counterparts in SchoolTool.POSIX group counterparts.Reset to defaultsServer statusTimeout (in seconds).URIUser DN queriesUsersYear ID, group ID, posix IDlogin_attribute, queryProject-Id-Version: schooltool.ldap Report-Msgid-Bugs-To: FULL NAME POT-Creation-Date: 2012-09-21 14:55+0300 PO-Revision-Date: 2012-10-27 20:19+0000 Last-Translator: rob Language-Team: Dutch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Launchpad-Export-Date: 2013-03-06 06:12+0000 X-Generator: Launchpad (build 16514) "Schooljaar" (optional) "Groeps-ID" "POSIX groeps-ID". Voorbeelden: "2011-2012, leraren, 6001", "2012-2013, leraren, 7001", ", leerlingen, 6000"${amount} gebruikers in LDAP.ActiefToepassenOngeldige DN-zoekopdracht(en)Ongeldige aanmeldnaam of wachtwoord voor LDAP-serverOngeldige configuratieAanmeldnaam voor LDAP-serverWachtwoord voor LDAP-serverWachtwoord voor LDAP-serverAnnulerenLDAP-instellingen wijzigenGeconfigureerdGereedOmlaagBewerkenVia het internet bewerken toestaanBijvoorbeeld: ldap://localhost:389Groeps-DN zoekopdrachtenIs deze client correct geconfigureerd.LDAP-configuratieSpecifieke LDAP-naam voor het zoeken van gebruikers om te authenticeren.URI LDAP-serverLDAP-instellingenLDAP-SSO (single sign on)LDAP-ondersteuning is geïnstalleerd, maar niet geconfigureerd.Geen client-DN zoekopdrachten ingesteld, LDAP-SSO uitgeschakeld.Niet geconfigureerdEen of meer zoekopdrachten voor LDAP-groepen, in de vorm van "login_attribute base?scope?filter" (scope is base/one/sub). Voorbeelden: "dc=localhost?sub?(objectClass=posixGroup)", "ou=Groups,dc=school,dc=example,dc=com?one"Een of meer zoekopdrachten voor LDAP-gebruikers, in de vorm van "login_attribute base?scope?filter" (scope is base/one/sub). Voorbeelden: "uid ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)", "cn ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)"Tegenhangers POSIX-groep in SchoolTool.Tegenhangers POSIX-groepStandaardinstellingen herstellenServerstatusTime-out (in seconden).URIGebruikers-DN zoekopdrachtenGebruikersJaar-ID, Groeps-ID, Posix-IDlogin_attribute, zoekopdrachtschooltool.ldap-1.0.2/src/schooltool/ldap/interfaces.py0000644000175000017500000001211712232251015024332 0ustar menesismenesis00000000000000# # SchoolTool - common information systems platform for school administration # Copyright (c) 2012 Shuttleworth Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # """ SchoolTool LDAP interfaces """ import zope.schema from zope.interface import Interface from schooltool.ldap import SchoolToolLDAPMessage as _ class ILDAPConfig(Interface): uri = zope.schema.TextLine( title=_('LDAP server URI'), description=_('Example: ldap://localhost:389'), required=False, ) bind_dn = zope.schema.TextLine( title=_('Bind DN'), description=_( 'LDAP distinguished name to bind for searching ' 'users to authenticate.' ), default=u"", required=False) bind_password = zope.schema.Password( title=_('Bind password'), description=_('Bind DN password.'), default=u"", required=False) timeout = zope.schema.Int( title=_('Timeout (in seconds).'), required=False, ) class ILDAPPersonsConfig(ILDAPConfig): queries = zope.schema.Text( title=_("User DN queries"), description=_( 'One or more queries to obtain LDAP users, in form of ' '"login_attribute base?scope?filter" (scope is base/one/sub). ' 'Examples: ' '"uid ou=Users,dc=localhost?sub?(objectClass=inetOrgPerson)", ' '"cn ou=Users,dc=school,dc=example,dc=com?one?(objectClass=person)"' ), required=False) groupQueries = zope.schema.Text( title=_("Group DN queries"), description=_( 'One or more queries to obtain LDAP groups, in form of ' '"login_attribute base?scope?filter" (scope is base/one/sub). ' 'Examples: ' '"dc=localhost?sub?(objectClass=posixGroup)", ' '"ou=Groups,dc=school,dc=example,dc=com?one"' ), required=False) posixGroups = zope.schema.Text( title=_("POSIX group counterparts in SchoolTool."), description=_( '"School year" (optional) "Group ID" "POSIX group ID". ' 'Examples: ' '"2011-2012, teachers, 6001", ' '"2012-2013, teachers, 7001", ' '", students, 6000"' ), required=False) class ILDAPAutoConfig(ILDAPPersonsConfig): enable_ttw = zope.schema.Bool( title=_("Enable TTW editing"), required=False) class ILDAPClient(ILDAPConfig): uri = zope.schema.TextLine( title=_('LDAP server URI'), description=_('Example: ldap://localhost:389'), required=False, ) configured = zope.schema.Bool( title=_('Configured'), description=_('Is this client properly configured.'), required=False, ) def connect(dn=None, password=None): """Connect to LDAP (and optionally bind to DN/password).""" def search(query, scope=None, filter=None, **kw): """ Query the LDAP server. Query syntax: "base?scope?filter", where scope is "base"/"one"/"sub". "scope" can be specified to override the query. "filter" can be specified as dict or properly formatted filter string. Other keywords will be passed to ldap.LDAPObject.search_ext_s """ def close(): """Close the connection.""" def ping(uri=None): """Ping the LDAP server at given URI (or self.uri if None is passed).""" class ILDAPPersonsClient(ILDAPClient, ILDAPPersonsConfig): queries = zope.schema.List( title=_("User DN queries"), value_type=zope.schema.List( title=_("login_attribute, query"), value_type=zope.schema.Text(title=u"Entry")) ) groupQueries = zope.schema.List( title=_("Group DN queries"), value_type=zope.schema.Text(title=u"Entry"), ) posixGroups = zope.schema.List( title=_("POSIX group counterparts."), value_type=zope.schema.List( title=_("Year ID, group ID, posix ID"), value_type=zope.schema.Text(title=u"Entry")) ) def login(username, password): """Bind as username/password""" def __iter__(): """Iterate LDAP users from all queries.""" class ISchoolToolLDAPObjectPart(Interface): def update(): """Update the target with info provided by this LDAP class.""" class ISchoolToolLDAPObject(Interface): def update(): """Update the object with information from LDAP.""" schooltool.ldap-1.0.2/src/schooltool/ldap/translations.zcml0000644000175000017500000000044712232251015025250 0ustar menesismenesis00000000000000 schooltool.ldap-1.0.2/src/schooltool/ldap/browser/0000755000175000017500000000000012275203725023332 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/browser/settings.py0000644000175000017500000001214612252370706025547 0ustar menesismenesis00000000000000# # SchoolTool - common information systems platform for school administration # Copyright (c) 2012 Shuttleworth Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # import ldap import z3c.form from zope.annotation.interfaces import IAnnotations from zope.cachedescriptors.property import Lazy from zope.traversing.browser.absoluteurl import absoluteURL from schooltool.app.interfaces import ISchoolToolApplication from schooltool.common import format_message from schooltool.ldap.interfaces import ILDAPPersonsConfig, ILDAPPersonsClient from schooltool.ldap.config import ST_APP_LDAP_KEY from schooltool.ldap.config import decode_ldap_query from schooltool.ldap.security import LDAPServerDown, BadLDAPCredentials from schooltool.skin import flourish from schooltool.ldap import SchoolToolLDAPMessage as _ from schooltool.common import SchoolToolMessage as s_ class LDAPSettingsEdit(flourish.form.Form, z3c.form.form.EditForm): fields = z3c.form.field.Fields(ILDAPPersonsConfig) label = None legend = _('LDAP settings') temp_content = None def getContent(self): if self.temp_content is None: app = ISchoolToolApplication(None) self.temp_content = ILDAPPersonsConfig(app) return self.temp_content def update(self): z3c.form.form.EditForm.update(self) @z3c.form.button.buttonAndHandler(s_('Apply')) def handle_edit_action(self, action): super(LDAPSettingsEdit, self).handleApply.func(self, action) # XXX: hacky sucessful submit check if (self.status == self.successMessage or self.status == self.noChangesMessage): app = ISchoolToolApplication(None) annotations = IAnnotations(app) annotations[ST_APP_LDAP_KEY] = self.temp_content self.request.response.redirect(self.nextURL()) @z3c.form.button.buttonAndHandler(_('Reset to defaults'), name="reset") def handle_reset_to_default(self, action): app = ISchoolToolApplication(None) annotations = IAnnotations(app) annotations[ST_APP_LDAP_KEY] = None self.request.response.redirect( absoluteURL(self, self.request)) @z3c.form.button.buttonAndHandler(s_('Cancel')) def handle_cancel_action(self, action): self.request.response.redirect(self.nextURL()) def nextURL(self): url = absoluteURL(self.context, self.request) + '/settings' return url def updateActions(self): super(LDAPSettingsEdit, self).updateActions() self.actions['apply'].addClass('button-ok') self.actions['reset'].addClass('button-cancel') self.actions['cancel'].addClass('button-cancel') class LDAPOverview(object): @Lazy def config(self): app = ISchoolToolApplication(None) return ILDAPPersonsConfig(app, None) @Lazy def server_status(self): if self.config is None: return _('Not configured') client = ILDAPPersonsClient(self.config, None) if client is None: return _('Not configured') try: client.connect() except ldap.LDAPError: return _('Bad configuration') except BadLDAPCredentials: return _('Bad bind DN or password') except LDAPServerDown: return _('Down') finally: client.close() return _('Active') @Lazy def users_status(self): if self.config is None: return None client = ILDAPPersonsClient(self.config, None) if client is None: return None n_users = 0 if not client.queries: return _('No client DN queries configured, LDAP SSO disabled.') try: for attr, query in client.queries: base, scope, filterstr = decode_ldap_query(query) filterstr = filterstr or '(objectClass=*)' users = client.search(base, scope, filter=filterstr) n_users += len(list(users)) except ldap.LDAPError: return _('Bad DN query(-ies)') except (BadLDAPCredentials, LDAPServerDown): return None finally: client.close() return format_message( _('${amount} users in LDAP.'), mapping={'amount': str(n_users)}) class LDAPSettingsOverview(flourish.page.Content, LDAPOverview): pass class LDAPSettingsView(LDAPSettingsEdit, LDAPOverview): mode = z3c.form.interfaces.DISPLAY_MODE schooltool.ldap-1.0.2/src/schooltool/ldap/browser/__init__.py0000644000175000017500000000002112232251015025420 0ustar menesismenesis00000000000000# Make a package schooltool.ldap-1.0.2/src/schooltool/ldap/browser/configure.zcml0000644000175000017500000000263212232251015026171 0ustar menesismenesis00000000000000 schooltool.ldap-1.0.2/src/schooltool/ldap/browser/templates/0000755000175000017500000000000012275203725025330 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/browser/templates/ldap.pt0000644000175000017500000000134212252370706026614 0ustar menesismenesis00000000000000
Server status
Users

Done

schooltool.ldap-1.0.2/src/schooltool/ldap/browser/templates/ldap_overview.pt0000644000175000017500000000227612252370706030551 0ustar menesismenesis00000000000000

LDAP single sign on Edit

LDAP support is installed but not configured.

URI
Server status
Users
schooltool.ldap-1.0.2/src/schooltool/ldap/security.py0000644000175000017500000005522312275201634024074 0ustar menesismenesis00000000000000# # SchoolTool - common information systems platform for school administration # Copyright (c) 2007 Shuttleworth Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # """ LDAP authentication plugin. """ import datetime import ldap import ldap.filter import pprint import re from zope.authentication.interfaces import ILoginPassword from zope.authentication.interfaces import IAuthenticatedGroup, IEveryoneGroup from zope.component import getUtility, queryUtility, queryAdapter, adapter from zope.interface import implements, implementer from zope.session.interfaces import ISession from zope.security.checker import ProxyFactory from zope.security.proxy import removeSecurityProxy from schooltool.app.interfaces import ISchoolToolApplication from schooltool.app.security import Principal from schooltool.app.security import PersonContainerAuthenticationPlugin from schooltool.contact.interfaces import IContact from schooltool.group.interfaces import IGroupContainer from schooltool.ldap.interfaces import ILDAPClient, ILDAPPersonsClient from schooltool.ldap.interfaces import ILDAPPersonsConfig, ILDAPConfig from schooltool.ldap.interfaces import ISchoolToolLDAPObject from schooltool.ldap.interfaces import ISchoolToolLDAPObjectPart from schooltool.ldap.config import LDAP_SCOPES, decode_ldap_query from schooltool.person.interfaces import IPersonFactory from schooltool.person.interfaces import IPasswordWriter from schooltool.schoolyear.interfaces import ISchoolYearContainer class BadLDAPCredentials(ValueError): pass class LDAPServerDown(Exception): pass class LDAPNotConnected(Exception): pass class LDAPResult(object): __result = None __keys = None dn = None # Distinguished name def __init__(self, result): for k, v in result[1].items(): setattr(self, k, v) self.__result = dict(result[1]) self.__keys = dict([(k.lower(), k) for k in self.__result]) self.dn = result[0] def __getattr__(self, name): iname = name.lower() if iname in self.__keys: return self.__result[self.__keys[iname]] try: return object.__getattribute__(self, name) except AttributeError: return None def __str__(self): return pprint.pformat(self.__result) def __repr__(self): attrs = ('objectclass', 'cn', 'o', 'ou', 'title') values = [getattr(self, a, None) for a in attrs] return "LDAPResult(%s)" % ', '.join( ['%s=%r' % (a, v) for (a, v) in zip(attrs, values) if v]) _bind_default = object() class LDAPClient(object): implements(ILDAPClient) uri = 'ldap://127.0.0.1:389' connection = None bind_dn = None bind_password = None timeout = -1 def __init__(self, uri=None, dn=None, password=None, timeout=10): self.uri = uri and uri.strip() or uri self.bind_dn = dn self.bind_password = password self.timeout = timeout @property def configured(self): return bool(self.uri) def connect(self, dn=_bind_default, password=_bind_default): dn = dn if dn is not _bind_default else self.bind_dn password = password if password is not _bind_default else self.bind_password if not self.uri: raise LDAPServerDown(self.uri) try: new_connection = ldap.initialize(self.uri) new_connection.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3) new_connection.set_option(ldap.OPT_NETWORK_TIMEOUT, self.timeout) except ldap.LDAPError: raise if dn is not None: if isinstance(dn, unicode): dn = dn.encode('UTF-8') try: new_connection.bind_s(who=dn, cred=password) except (ldap.SERVER_DOWN, ldap.TIMEOUT): raise LDAPServerDown(self.uri) except ldap.INVALID_CREDENTIALS: raise BadLDAPCredentials(dn, '*' * len(password)) self.close() self.connection = new_connection def search(self, query, scope=None, filter=None, **kw): """See ldap.LDAPObject.search_ext_s for more keyword options, like timeout. """ if self.connection is None: self.connect() if isinstance(query, unicode): query.encode('UTF-8') base, _scope, _filter = decode_ldap_query(query) scope = scope if scope is not None else _scope scope = LDAP_SCOPES.get(scope, LDAP_SCOPES['sub']) if filter is None: filter = _filter elif (isinstance(filter, dict) and filter): items = sorted(filter.items()) filter = ldap.filter.filter_format('%s=%s', items.pop()) while items: filter = '&(%s)(%s)' % ( ldap.filter.filter_format('%s=%s', items.pop()), filter) if not filter: filter = 'objectClass=*' if not filter.startswith('('): filter = '(%s)' % filter result = self.connection.search_ext_s( base, scope, filterstr=filter, **kw) if result is None: return None result = [LDAPResult(r) for r in result] return result def close(self): if self.connection is None: return self.connection.unbind() self.connection = None def ping(self, uri=None): if uri is None: uri = self.uri now = datetime.datetime.utcnow() if not uri: raise LDAPServerDown(uri) try: test = ldap.initialize(uri) except ldap.LDAPError: raise LDAPServerDown(uri) test.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3) test.set_option(ldap.OPT_NETWORK_TIMEOUT, self.timeout) try: test.whoami_s() except (ldap.SERVER_DOWN, ldap.TIMEOUT): raise LDAPServerDown(uri) test.unbind() return datetime.datetime.utcnow() - now class LDAPPersons(LDAPClient): implements(ILDAPPersonsClient) # List of (username attribute, query) tuples, like: # 'uid', 'dc=localhost?sub?(objectClass=inetOrgPerson') queries = () # List of queries to get groups, like: # 'dc=localhost?sub?(objectClass=posixGroup') groupQueries = () # List of (schooltool year, schooltool group name, posix group id) posixGroups = () def __init__(self, *args, **kw): self.queries = tuple(kw.pop('queries', ())) self.groupQueries = tuple(kw.pop('groupQueries', ())) self.posixGroups = tuple(kw.pop('posixGroups', ())) LDAPClient.__init__(self, *args, **kw) @property def configured(self): configured = super(LDAPPersons, self).configured return configured and bool(self.queries) def find(self, username): username = ldap.filter.escape_filter_chars(username) for attr, query in self.queries: userfilter = ldap.filter.filter_format('%s=%s', (attr, username)) base, scope, filter = decode_ldap_query(query) if filter is None: filter = userfilter else: filter = '&(%s)(%s)' % (filter, userfilter) users = self.search(base, scope, filter=filter) if len(users) == 1: yield users[0] def login(self, username, password): for user in self.find(username): self.connect(user.dn, password) return True return False def __iter__(self): for attr, query in self.queries: users = self.search(query) for user in users: yield user class LDAPAuthenticationPlugin(PersonContainerAuthenticationPlugin): ldap_session_name = 'schooltool.ldap' ldap_params = None def newClient(self, **kw): app = ISchoolToolApplication(None) config = queryAdapter(app, ILDAPConfig, default=None) if config is None: return None client = queryAdapter(config, ILDAPPersonsClient, default=None) return client @property def enabled(self): client = self.newClient() if (client is None or not client.configured): return False if client is not None: try: client.ping() except (LDAPServerDown, ldap.LDAPError): return False return True def checkPlainTextPassword(self, username, password): # XXX: do not allow to log in with invalid schooltool usernames! client = self.newClient() if client is None or not username: return False try: password = password or '' return client.login(username, password) except (BadLDAPCredentials, LDAPServerDown, ldap.LDAPError): return False finally: client.close() return False def authenticate(self, request): """Identify a principal for request. Retrieves the username and password from the session. """ session = ISession(request)[self.session_name] if 'username' in session: self.restorePOSTData(request) principal = None if self.enabled: principal = self.getPrincipal('sb.person.' + session['username']) if principal is None: return PersonContainerAuthenticationPlugin.getPrincipal( self, 'sb.person.' + session['username']) else: return principal # Try HTTP basic too creds = ILoginPassword(request, None) if creds: login = creds.getLogin() password = creds.getPassword() if self.checkPlainTextPassword(login, password): principal = None if self.enabled: principal = self.getPrincipal('sb.person.' + login) if principal is None: return PersonContainerAuthenticationPlugin.getPrincipal( self, 'sb.person.' + session['username']) else: return principal def setCredentials(self, request, username, password): if not self.checkPlainTextPassword(username, password): # Fall-back to default person auth. return PersonContainerAuthenticationPlugin.setCredentials( self, request, username, password) session = ISession(request)[self.session_name] session['username'] = username principal = self.getPrincipal('sb.person.' + username, update_person=True) unproxied_person = removeSecurityProxy(principal._person) if (unproxied_person is not None and not unproxied_person.checkPassword(password)): password_writer = IPasswordWriter(unproxied_person, None) if password_writer is not None: password_writer.setPassword(password) def clearCredentials(self, request): session = ISession(request)[self.session_name] try: del session['username'] except KeyError: pass def getPrincipal(self, id, update_person=False): """Get principal meta-data. Returns principals for groups and persons. """ if not id.startswith(self.person_prefix): return None app = ISchoolToolApplication(None) username = id[len(self.person_prefix):] client = self.newClient() if client is None: return None try: results = list(client.find(username)) except (LDAPServerDown, ldap.LDAPError): return None for result in results: ldap_person = LDAPPerson(result, client) ldap_person.update() if username not in app['persons']: ldap_person.create(username) person = app['persons'][username] principal = Principal(id, person.title, person=ProxyFactory(person)) if update_person: ldap_person.update_groups(person) ldap_person.update_attrs(person) for group in person.groups: group_principal_id = self.group_prefix + group.__name__ principal.groups.append(group_principal_id) authenticated = queryUtility(IAuthenticatedGroup) if authenticated: principal.groups.append(authenticated.id) everyone = queryUtility(IEveryoneGroup) if everyone: principal.groups.append(everyone.id) return principal return None @adapter(ILDAPPersonsConfig) @implementer(ILDAPPersonsClient) def makeLDAPPersonsClient(config): tokenize = re.compile('\s') queries = config.queries or '' queries = [l.strip() for l in queries.splitlines()] queries = tuple([ tuple([token.strip() for token in tokenize.split(line, 1)]) for line in queries if line]) groupQueries = config.groupQueries or '' groupQueries = filter(None, [l.strip() for l in groupQueries.splitlines()]) posixGroups = config.posixGroups or '' groups = [l.strip() for l in posixGroups.strip().splitlines()] groups = tuple([ tuple([i.strip() for i in line.split(',')]) for line in groups if line]) client = LDAPPersons( uri=config.uri, dn=config.bind_dn, password=config.bind_password, queries=queries, groupQueries=groupQueries, posixGroups=groups, timeout=config.timeout) return client @adapter(ILDAPConfig) @implementer(ILDAPClient) def makeLDAPClient(config): client = LDAPClient(uri=config.uri, dn=config.bind_dn, password=config.bind_password) return client class SchoolToolLDAPObjectPart(object): implements(ISchoolToolLDAPObjectPart) target = None data = None def __init__(self, target): self.target = target self.data = target.ldap_result def update(self): pass class SchoolToolLDAPObject(object): implements(ISchoolToolLDAPObject) ldap_result = None client = None def __init__(self, ldap_result, client): self.ldap_result = ldap_result self.client = client def update(self): parts = filter(None, [ queryAdapter(self, ISchoolToolLDAPObjectPart, default=None, name=ldap_class.lower()) for ldap_class in self.ldap_result.objectClass ]) for part in parts: part.update() class LDAPPerson(SchoolToolLDAPObject): person_attrs = None contact_attrs = None cached_groups = None group_member_id = None def update(self): self.person_attrs = {} self.contact_attrs = {} self.cached_groups = None super(LDAPPerson, self).update() def create(self, username): app = ISchoolToolApplication(None) factory = getUtility(IPersonFactory) person = factory( username, self.person_attrs.get('first_name'), self.person_attrs.get('last_name')) app['persons'][username] = person self.update_attrs(person) @property def groups(self): if self.cached_groups is not None: return self.cached_groups if self.group_member_id is None: return () filter_groups = [gid.lower() for _i, _i, gid in self.client.posixGroups] result = [] my_id = self.group_member_id.lower() for query in self.client.groupQueries: candidates = [LDAPGroup(c, self.client) for c in self.client.search(query)] for candidate in candidates: candidate.update() if (not candidate.group_id or candidate.group_id.lower() not in filter_groups): continue members = [m.lower() for m in candidate.member_ids] if my_id in members: result.append(candidate) self.cached_groups = tuple(result) return self.cached_groups def update_attrs(self, person): for k, v in self.person_attrs.items(): if getattr(person, k, None) != v: setattr(person, k, v) contact_info = IContact(person) for k, v in self.contact_attrs.items(): if getattr(contact_info, k, None) != v: setattr(contact_info, k, v) def update_groups(self, person): my_groups = set([group.group_id.lower() for group in self.groups]) by_year = {} for year, st_group, posix_id in self.client.posixGroups: if posix_id.lower() not in my_groups: continue if year not in by_year: by_year[year] = [] by_year[year].append(st_group) app = ISchoolToolApplication(None) syc = ISchoolYearContainer(app) unproxied_person = removeSecurityProxy(person) for year_id, group_ids in by_year.items(): if year_id == '': sy = syc.getActiveSchoolYear() else: sy = syc.get(year_id) if sy is None: continue gc = IGroupContainer(sy) for group_id in group_ids: group = gc.get(group_id) if group is None: continue unproxied_group = removeSecurityProxy(group) if unproxied_group not in unproxied_person.groups: person.groups.add(unproxied_group) class PersonLDAPPersonPart(SchoolToolLDAPObjectPart): all_attrs = ( 'sn', # surname 'cn', # common name 'userPassword', 'telephoneNumber', 'seeAlso', 'description') def __init__(self, *args, **kw): SchoolToolLDAPObjectPart.__init__(self, *args, **kw) def oneline(self, t): if not t: return u'' return u' '.join(s.decode('UTF-8') for s in t).strip() def update(self): super(PersonLDAPPersonPart, self).update() self.target.person_attrs.update({ 'first_name': self.oneline(self.data.cn), 'last_name': self.oneline(self.data.sn), }) self.target.contact_attrs.update({ 'work_phone': self.oneline(self.data.telephoneNumber) or None, }) class PersonLDAPOrganizationalPersonPart(PersonLDAPPersonPart): all_attrs = PersonLDAPPersonPart.all_attrs + ( 'title', 'x121Address', 'registeredAddress', 'destinationIndicator', 'preferredDeliveryMethod', 'telexNumber', 'teletexTerminalIdentifier', 'telephoneNumber', 'internationaliSDNNumber', 'facsimileTelephoneNumber', 'street', 'postOfficeBox', 'postalCode', 'postalAddress', 'physicalDeliveryOfficeName', 'ou', # organizational unit 'st', # state or province 'l', # town or city ) def update(self): super(PersonLDAPOrganizationalPersonPart, self).update() self.target.person_attrs.update({ }) address = ' '.join(self.oneline(self.data.postalAddress).replace('$', ' ').split()) address = address or self.oneline(self.data.street) self.target.person_attrs.update({ 'prefix': self.oneline(self.data.title) or None, }) self.target.contact_attrs.update({ 'state': self.oneline(self.data.st) or None, 'city': self.oneline(self.data.l) or None, 'address_line_1': address, 'postal_code': self.oneline(self.data.postalCode) or None, }) class PersonLDAPInetOrgPersonPart(PersonLDAPOrganizationalPersonPart): all_attrs = PersonLDAPOrganizationalPersonPart.all_attrs + ( 'audio', 'businessCategory', 'carLicense', 'departmentNumber', 'displayName', 'employeeNumber', 'employeeType', 'givenName', 'homePhone', 'homePostalAddress', 'initials', 'jpegPhoto', # we could use this 'labeledURI', 'mail', 'manager', 'mobile', 'o', # organization name 'pager', 'photo', 'roomNumber', 'secretary', 'uid', 'userCertificate', 'x500uniqueIdentifier', 'preferredLanguage', # maybe we can use this 'userSMIMECertificate', 'userPKCS12') def update(self): super(PersonLDAPInetOrgPersonPart, self).update() self.target.person_attrs.update({ 'username': (self.oneline(self.data.uid) or self.target.person_attrs.get('username')), 'first_name': (self.oneline(self.data.givenName) or self.target.person_attrs.get('first_name')), }) address = ' '.join(self.oneline(self.data.postalAddress).replace('$', ' ').split()) address = address or self.oneline(self.data.street) self.target.contact_attrs.update({ 'home_phone': self.oneline(self.data.homePhone) or None, 'mobile_phone': self.oneline(self.data.mobile) or None, 'email': self.oneline(self.data.mail) or None, }) class PersonLDAPPosixAccountPart(SchoolToolLDAPObjectPart): @property def registered_groups(self): groups = dict([ (posix_id, (year_id, group_id)) for posix_id, year_id, group_id in self.target.client.posixGroups]) return groups def update(self): super(PersonLDAPPosixAccountPart, self).update() self.target.group_member_id = self.data.uid and self.data.uid[0] or None class LDAPGroup(SchoolToolLDAPObject): member_ids = None group_id = None def update(self): self.member_ids = [] self.group_id = None super(LDAPGroup, self).update() def __repr__(self): return "%s(%r)" % (self.__class__.__name__, self.group_id) class LDAPPosixGroupPart(SchoolToolLDAPObjectPart): def update(self): super(LDAPPosixGroupPart, self).update() self.target.group_id = self.data.gidNumber[0] if self.data.gidNumber else '' self.target.member_ids += list(self.data.memberUID or ()) schooltool.ldap-1.0.2/src/schooltool/ldap/tests/0000755000175000017500000000000012275203725023011 5ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/tests/__init__.py0000644000175000017500000000000012232251015025074 0ustar menesismenesis00000000000000schooltool.ldap-1.0.2/src/schooltool/ldap/tests/test_security.py0000644000175000017500000000354012275201433026265 0ustar menesismenesis00000000000000# -*- coding: utf-8 -*- # # SchoolTool - common information systems platform for school administration # Copyright (c) 2005 Shuttleworth Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # """ Unit tests for schooltool.ldap.security """ import unittest import doctest from schooltool.ldap.security import PersonLDAPPersonPart from schooltool.ldap.security import LDAPPerson class TestPersonLDAPPersonPart(unittest.TestCase): def setUp(self): person = LDAPPerson(None, None) self.part = PersonLDAPPersonPart(person) def test_oneline(self): line = self.part.oneline(['Bob', 'Marley']) self.assertEqual(line, u'Bob Marley') vejas = [u'Šiaurės', u'Vėjas'] # data from LDAP comes UTF-8 encoded vejas = [s.encode('UTF-8') for s in vejas] line = self.part.oneline(vejas) self.assertEqual(line, u'Šiaurės Vėjas') def test_suite(): return unittest.TestSuite([ unittest.makeSuite(TestPersonLDAPPersonPart), doctest.DocTestSuite(optionflags=doctest.ELLIPSIS), doctest.DocFileSuite('../security.txt', optionflags=doctest.ELLIPSIS), ]) if __name__ == '__main__': unittest.main(defaultTest='test_suite') schooltool.ldap-1.0.2/CHANGES.txt0000644000175000017500000000060112275203710017553 0ustar menesismenesis00000000000000======= CHANGES ======= 1.0.2 (2014-02-07) ------------------ - Support non-ascii characters in data coming from LDAP (https://launchpad.net/bugs/1277518) 1.0.1 (2013-12-12) ------------------ - Fix failure to start when example /etc/ldap.conf exists (https://launchpad.net/bugs/1251181) - Add Dutch and Sinhalese translations. 1.0 (2012-09-21) ---------------- First release. schooltool.ldap-1.0.2/bootstrap.py0000644000175000017500000002443512232251015020336 0ustar menesismenesis00000000000000############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Bootstrap a buildout-based project Simply run this script in a directory containing a buildout.cfg. The script accepts buildout command-line options, so you can use the -c option to specify an alternate configuration file. """ import os, shutil, sys, tempfile, urllib, urllib2, subprocess from optparse import OptionParser if sys.platform == 'win32': def quote(c): if ' ' in c: return '"%s"' % c # work around spawn lamosity on windows else: return c else: quote = str # See zc.buildout.easy_install._has_broken_dash_S for motivation and comments. stdout, stderr = subprocess.Popen( [sys.executable, '-Sc', 'try:\n' ' import ConfigParser\n' 'except ImportError:\n' ' print 1\n' 'else:\n' ' print 0\n'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() has_broken_dash_S = bool(int(stdout.strip())) # In order to be more robust in the face of system Pythons, we want to # run without site-packages loaded. This is somewhat tricky, in # particular because Python 2.6's distutils imports site, so starting # with the -S flag is not sufficient. However, we'll start with that: if not has_broken_dash_S and 'site' in sys.modules: # We will restart with python -S. args = sys.argv[:] args[0:0] = [sys.executable, '-S'] args = map(quote, args) os.execv(sys.executable, args) # Now we are running with -S. We'll get the clean sys.path, import site # because distutils will do it later, and then reset the path and clean # out any namespace packages from site-packages that might have been # loaded by .pth files. clean_path = sys.path[:] import site # imported because of its side effects sys.path[:] = clean_path for k, v in sys.modules.items(): if k in ('setuptools', 'pkg_resources') or ( hasattr(v, '__path__') and len(v.__path__) == 1 and not os.path.exists(os.path.join(v.__path__[0], '__init__.py'))): # This is a namespace package. Remove it. sys.modules.pop(k) is_jython = sys.platform.startswith('java') setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py' distribute_source = 'http://python-distribute.org/distribute_setup.py' # parsing arguments def normalize_to_url(option, opt_str, value, parser): if value: if '://' not in value: # It doesn't smell like a URL. value = 'file://%s' % ( urllib.pathname2url( os.path.abspath(os.path.expanduser(value))),) if opt_str == '--download-base' and not value.endswith('/'): # Download base needs a trailing slash to make the world happy. value += '/' else: value = None name = opt_str[2:].replace('-', '_') setattr(parser.values, name, value) usage = '''\ [DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options] Bootstraps a buildout-based project. Simply run this script in a directory containing a buildout.cfg, using the Python that you want bin/buildout to use. Note that by using --setup-source and --download-base to point to local resources, you can keep this script from going over the network. ''' parser = OptionParser(usage=usage) parser.add_option("-v", "--version", dest="version", help="use a specific zc.buildout version") parser.add_option("-d", "--distribute", action="store_true", dest="use_distribute", default=False, help="Use Distribute rather than Setuptools.") parser.add_option("--setup-source", action="callback", dest="setup_source", callback=normalize_to_url, nargs=1, type="string", help=("Specify a URL or file location for the setup file. " "If you use Setuptools, this will default to " + setuptools_source + "; if you use Distribute, this " "will default to " + distribute_source + ".")) parser.add_option("--download-base", action="callback", dest="download_base", callback=normalize_to_url, nargs=1, type="string", help=("Specify a URL or directory for downloading " "zc.buildout and either Setuptools or Distribute. " "Defaults to PyPI.")) parser.add_option("--eggs", help=("Specify a directory for storing eggs. Defaults to " "a temporary directory that is deleted when the " "bootstrap script completes.")) parser.add_option("-t", "--accept-buildout-test-releases", dest='accept_buildout_test_releases', action="store_true", default=False, help=("Normally, if you do not specify a --version, the " "bootstrap script and buildout gets the newest " "*final* versions of zc.buildout and its recipes and " "extensions for you. If you use this flag, " "bootstrap and buildout will get the newest releases " "even if they are alphas or betas.")) parser.add_option("-c", None, action="store", dest="config_file", help=("Specify the path to the buildout configuration " "file to be used.")) options, args = parser.parse_args() if options.eggs: eggs_dir = os.path.abspath(os.path.expanduser(options.eggs)) else: eggs_dir = tempfile.mkdtemp() if options.setup_source is None: if options.use_distribute: options.setup_source = distribute_source else: options.setup_source = setuptools_source if options.accept_buildout_test_releases: args.insert(0, 'buildout:accept-buildout-test-releases=true') try: import pkg_resources import setuptools # A flag. Sometimes pkg_resources is installed alone. if not hasattr(pkg_resources, '_distribute'): raise ImportError except ImportError: ez_code = urllib2.urlopen( options.setup_source).read().replace('\r\n', '\n') ez = {} exec ez_code in ez setup_args = dict(to_dir=eggs_dir, download_delay=0) if options.download_base: setup_args['download_base'] = options.download_base if options.use_distribute: setup_args['no_fake'] = True if sys.version_info[:2] == (2, 4): setup_args['version'] = '0.6.32' ez['use_setuptools'](**setup_args) if 'pkg_resources' in sys.modules: reload(sys.modules['pkg_resources']) import pkg_resources # This does not (always?) update the default working set. We will # do it. for path in sys.path: if path not in pkg_resources.working_set.entries: pkg_resources.working_set.add_entry(path) cmd = [quote(sys.executable), '-c', quote('from setuptools.command.easy_install import main; main()'), '-mqNxd', quote(eggs_dir)] if not has_broken_dash_S: cmd.insert(1, '-S') find_links = options.download_base if not find_links: find_links = os.environ.get('bootstrap-testing-find-links') if not find_links and options.accept_buildout_test_releases: find_links = 'http://downloads.buildout.org/' if find_links: cmd.extend(['-f', quote(find_links)]) if options.use_distribute: setup_requirement = 'distribute' else: setup_requirement = 'setuptools' ws = pkg_resources.working_set setup_requirement_path = ws.find( pkg_resources.Requirement.parse(setup_requirement)).location env = dict( os.environ, PYTHONPATH=setup_requirement_path) requirement = 'zc.buildout' version = options.version if version is None and not options.accept_buildout_test_releases: # Figure out the most recent final version of zc.buildout. import setuptools.package_index _final_parts = '*final-', '*final' def _final_version(parsed_version): for part in parsed_version: if (part[:1] == '*') and (part not in _final_parts): return False return True index = setuptools.package_index.PackageIndex( search_path=[setup_requirement_path]) if find_links: index.add_find_links((find_links,)) req = pkg_resources.Requirement.parse(requirement) if index.obtain(req) is not None: best = [] bestv = None for dist in index[req.project_name]: distv = dist.parsed_version if distv >= pkg_resources.parse_version('2dev'): continue if _final_version(distv): if bestv is None or distv > bestv: best = [dist] bestv = distv elif distv == bestv: best.append(dist) if best: best.sort() version = best[-1].version if version: requirement += '=='+version else: requirement += '<2dev' cmd.append(requirement) if is_jython: import subprocess exitcode = subprocess.Popen(cmd, env=env).wait() else: # Windows prefers this, apparently; otherwise we would prefer subprocess exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env])) if exitcode != 0: sys.stdout.flush() sys.stderr.flush() print ("An error occurred when trying to install zc.buildout. " "Look above this message for any errors that " "were output by easy_install.") sys.exit(exitcode) ws.add_entry(eggs_dir) ws.require(requirement) import zc.buildout.buildout # If there isn't already a command in the args, add bootstrap if not [a for a in args if '=' not in a]: args.append('bootstrap') # if -c was provided, we push it back into args for buildout's main function if options.config_file is not None: args[0:0] = ['-c', options.config_file] zc.buildout.buildout.main(args) if not options.eggs: # clean up temporary egg directory shutil.rmtree(eggs_dir) schooltool.ldap-1.0.2/Makefile0000755000175000017500000000724612252370732017425 0ustar menesismenesis00000000000000#!/usr/bin/make PACKAGE=schooltool.ldap LOCALES=src/schooltool/ldap/locales TRANSLATIONS_ZCML=schooltool/ldap/translations.zcml DIST=/home/ftp/pub/schooltool/trunk PYTHON=python INSTANCE_TYPE=schooltool BUILDOUT_FLAGS= .PHONY: all all: build .PHONY: build build: .installed.cfg python: rm -rf python virtualenv --no-site-packages -p $(PYTHON) python .PHONY: bootstrap bootstrap bin/buildout: | buildout.cfg python python/bin/python bootstrap.py buildout.cfg: cp deploy.cfg buildout.cfg .PHONY: buildout buildout .installed.cfg: python bin/buildout buildout.cfg base.cfg deploy.cfg setup.py bin/buildout $(BUILDOUT_FLAGS) .PHONY: develop develop bin/coverage: buildout.cfg develop.cfg sed -e 's/base.cfg/develop.cfg/' -i buildout.cfg $(MAKE) buildout .PHONY: update update: bzr up $(MAKE) buildout BUILDOUT_FLAGS=-n instance: | build bin/make-schooltool-instance instance instance_type=$(INSTANCE_TYPE) .PHONY: run run: build instance bin/start-schooltool-instance instance .PHONY: tags tags: build bin/ctags .PHONY: clean clean: rm -rf python rm -rf bin develop-eggs parts .installed.cfg rm -rf build rm -f ID TAGS tags rm -rf coverage find . -name '*.py[co]' -delete find . -name '*.mo' -delete find . -name 'LC_MESSAGES' -exec rmdir -p --ignore-fail-on-non-empty {} + .PHONY: realclean realclean: rm -f buildout.cfg rm -rf eggs rm -rf dist rm -rf instance $(MAKE) clean # Tests .PHONY: test test: build bin/test -u .PHONY: ftest ftest: build bin/test -f .PHONY: testall testall: build bin/test --at-level 2 # Coverage .PHONY: coverage coverage: build rm -rf coverage bin/test --at-level 2 -u --coverage=$(CURDIR)/coverage .PHONY: coverage-reports-html coverage-reports-html coverage/reports: bin/coverage build test -d coverage || $(MAKE) coverage rm -rf coverage/reports mkdir coverage/reports bin/coverage coverage coverage/reports ln -s $(PACKAGE).html coverage/reports/index.html # Translations .PHONY: extract-translations extract-translations: build bin/i18nextract --egg $(PACKAGE) \ --domain $(PACKAGE) \ --zcml $(TRANSLATIONS_ZCML) \ --output-file $(LOCALES)/$(PACKAGE).pot .PHONY: compile-translations compile-translations: for f in $(LOCALES)/*.po; do \ mkdir -p $${f%.po}/LC_MESSAGES; \ msgfmt -o $${f%.po}/LC_MESSAGES/$(PACKAGE).mo $$f;\ done .PHONY: update-translations update-translations: for f in $(LOCALES)/*.po; do \ msgmerge -qUN $$f $(LOCALES)/$(PACKAGE).pot ;\ done $(MAKE) compile-translations # Release .PHONY: release release: compile-translations -cp buildout.cfg buildout.cfg~dev~ cp deploy.cfg buildout.cfg grep -qv 'dev' version.txt.in || echo -n `cat version.txt.in`-r`bzr revno` > version.txt $(PYTHON) setup.py sdist rm -f version.txt -mv buildout.cfg~dev~ buildout.cfg .PHONY: move-release move-release: upload rm -v dist/$(PACKAGE)-*dev-r*.tar.gz .PHONY: upload upload: set -e ;\ VERSION=`cat version.txt.in` ;\ DIST=$(DIST) ;\ grep -qv 'dev' version.txt.in || VERSION=`cat version.txt.in`-r`bzr revno` ;\ grep -qv 'dev' version.txt.in || DIST=$(DIST)/dev ;\ if [ -w $${DIST} ] ; then \ echo cp dist/$(PACKAGE)-$${VERSION}.tar.gz $${DIST} ;\ cp dist/$(PACKAGE)-$${VERSION}.tar.gz $${DIST} ;\ else \ echo scp dist/$(PACKAGE)-$${VERSION}.tar.gz* schooltool.org:$${DIST} ;\ scp dist/$(PACKAGE)-$${VERSION}.tar.gz* schooltool.org:$${DIST} ;\ fi # Helpers .PHONY: ubuntu-environment ubuntu-environment: sudo apt-get install build-essential gettext enscript \ python-dev python-virtualenv \ ttf-ubuntu-font-family ttf-liberation \ libicu-dev libxslt1-dev libfreetype6-dev libjpeg-dev \ libldap2-dev libsasl2-dev libssl-dev schooltool.ldap-1.0.2/GPL.txt0000644000175000017500000004311012232251015017121 0ustar menesismenesis00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. schooltool.ldap-1.0.2/PKG-INFO0000644000175000017500000000377412275203725017063 0ustar menesismenesis00000000000000Metadata-Version: 1.1 Name: schooltool.ldap Version: 1.0.2 Summary: LDAP authentication plugin for SchoolTool Home-page: http://www.schooltool.org Author: SchoolTool Developers Author-email: schooltool-developers@lists.launchpad.net License: GPL Description: Allows users to authenticate to SchoolTool using LDAP. Deployment ---------- Here is what it takes to get this plugin deployed: 1) schooltool.ldap needs to be in the path (whether as an egg or as part of a sandbox) 2) you can configure ldap before first start by adding to schooltool.conf:: %import schooltool.ldap uri ldap://localhost:389 3) or through the web from the Server tab. See http://book.schooltool.org/ldap.html for more information ======= CHANGES ======= 1.0.2 (2014-02-07) ------------------ - Support non-ascii characters in data coming from LDAP (https://launchpad.net/bugs/1277518) 1.0.1 (2013-12-12) ------------------ - Fix failure to start when example /etc/ldap.conf exists (https://launchpad.net/bugs/1251181) - Add Dutch and Sinhalese translations. 1.0 (2012-09-21) ---------------- First release. Platform: any Classifier: Development Status :: 4 - Beta Classifier: Environment :: Web Environment Classifier: Intended Audience :: End Users/Desktop Classifier: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2.5 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Zope Classifier: Topic :: Education schooltool.ldap-1.0.2/setup.cfg0000644000175000017500000000007312275203725017574 0ustar menesismenesis00000000000000[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 schooltool.ldap-1.0.2/deploy.cfg0000644000175000017500000000023312232251015017712 0ustar menesismenesis00000000000000[buildout] extends = base.cfg develop = . [versions] # Unset versions of packages you want to develop schooltool.ldap = [package] eggs = schooltool.ldap schooltool.ldap-1.0.2/README.txt0000644000175000017500000000100612232251015017432 0ustar menesismenesis00000000000000Allows users to authenticate to SchoolTool using LDAP. Deployment ---------- Here is what it takes to get this plugin deployed: 1) schooltool.ldap needs to be in the path (whether as an egg or as part of a sandbox) 2) you can configure ldap before first start by adding to schooltool.conf:: %import schooltool.ldap uri ldap://localhost:389 3) or through the web from the Server tab. See http://book.schooltool.org/ldap.html for more information schooltool.ldap-1.0.2/setup.py0000755000175000017500000000520512252372645017475 0ustar menesismenesis00000000000000#!/usr/bin/env python # # SchoolTool - common information systems platform for school administration # Copyright (c) 2007-2012 Shuttleworth Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # """ SchoolTool LDAP plugin setup script. """ import os from setuptools import setup, find_packages if os.path.exists("version.txt"): version = open("version.txt").read().strip() else: version = open("version.txt.in").read().strip() def read(*rnames): text = open(os.path.join(os.path.dirname(__file__), *rnames)).read() return text setup( name="schooltool.ldap", description="LDAP authentication plugin for SchoolTool", long_description=( read('README.txt') + '\n\n' + read('CHANGES.txt') ), version=version, url='http://www.schooltool.org', license="GPL", maintainer="SchoolTool Developers", maintainer_email="schooltool-developers@lists.launchpad.net", platforms=["any"], classifiers=["Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Zope", "Topic :: Education"], package_dir={'': 'src'}, namespace_packages=["schooltool"], packages=find_packages('src'), install_requires=['schooltool', 'python-ldap', 'zope.authentication', 'zope.component', 'zope.session', 'zope.security', 'setuptools'], entry_points = """ [schooltool.plugin_configuration] schooltool.ldap = schooltool.ldap [z3c.autoinclude.plugin] target = schooltool """, include_package_data=True, zip_safe=False ) schooltool.ldap-1.0.2/MANIFEST.in0000644000175000017500000000060412232251015017475 0ustar menesismenesis00000000000000recursive-include src *.zcml recursive-include src *.pt recursive-include src *.pot recursive-include src *.po recursive-include src *.mo recursive-include src *.txt recursive-include src *.xml include version.txt include version.txt.in include CHANGES.txt include GPL.txt include Makefile include base.cfg include buildout.cfg include deploy.cfg include develop.cfg include bootstrap.py schooltool.ldap-1.0.2/version.txt.in0000644000175000017500000000000612275203700020573 0ustar menesismenesis000000000000001.0.2