eggification
[GroupUserFolder.git] / Products / GroupUserFolder / global_symbols.py
1 # -*- coding: utf-8 -*-
2 ## GroupUserFolder
3 ## Copyright (C)2006 Ingeniweb
4
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2 of the License, or
8 ## (at your option) any later version.
9
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
14
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; see the file COPYING. If not, write to the
17 ## Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 """
19
20 """
21 __version__ = "$Revision: $"
22 # $Source: $
23 # $Id: global_symbols.py 32384 2006-10-27 10:00:55Z encolpe $
24 __docformat__ = 'restructuredtext'
25
26 import os
27 import string
28
29 # Check if we have to be in debug mode
30 import Log
31 if os.path.isfile(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'debug.txt')):
32 Log.LOG_LEVEL = Log.LOG_DEBUG
33 DEBUG_MODE = 1
34 else:
35 Log.LOG_LEVEL = Log.LOG_NOTICE
36 DEBUG_MODE = 0
37
38 from Log import *
39
40 # Retreive version
41 if os.path.isfile(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'version.txt')):
42 __version_file_ = open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'version.txt'), 'r', )
43 version__ = __version_file_.read()[:-1]
44 __version_file_.close()
45 else:
46 version__ = "(UNKNOWN)"
47
48 # Check if we are in preview mode
49 PREVIEW_PLONE21_IN_PLONE20_ = 0
50 splitdir = os.path.split(os.path.abspath(os.path.dirname(__file__)))
51 products = os.path.join(*splitdir[:-1])
52 version_file = os.path.join(products, 'CMFPlone', 'version.txt')
53 if os.path.isfile(version_file):
54 # We check if we have Plone 2.0
55 f = open(version_file, "r")
56 v = f.read()
57 f.close()
58 if string.find(v, "2.0.") != -1:
59 PREVIEW_PLONE21_IN_PLONE20_ = 1
60
61
62 # Group prefix
63 GROUP_PREFIX = "group_"
64 GROUP_PREFIX_LEN = len(GROUP_PREFIX)
65
66 # Batching range for ZMI pages
67 MAX_USERS_PER_PAGE = 100
68
69 # Max allowrd users or groups to enable tree view
70 MAX_TREE_USERS_AND_GROUPS = 100
71
72 # Users/groups tree cache time (in seconds)
73 # This is used in management screens only
74 TREE_CACHE_TIME = 10
75
76 # List of user names that are likely not to be valid user names.
77 # This list is for performance reasons in ZMI views. If some actual user names
78 # are inside this list, management screens won't work for them but they
79 # will still be able to authenticate.
80 INVALID_USER_NAMES = [
81 'BASEPATH1', 'BASEPATH2', 'BASEPATH3', 'a_', 'URL', 'acl_users', 'misc_',
82 'management_view', 'management_page_charset', 'REQUEST', 'RESPONSE',
83 'MANAGE_TABS_NO_BANNER', 'tree-item-url', 'SCRIPT_NAME', 'n_', 'help_topic',
84 'Zope-Version', 'target',
85 ]
86
87 # LDAPUserFolder-specific stuff
88 LDAPUF_METHOD = "manage_addLDAPSchemaItem" # sample method to determine if a uf is an ldapuf
89 LDAP_GROUP_RDN = "cn" # rdn attribute for groups
90
91 LOCALROLE_BLOCK_PROPERTY = "__ac_local_roles_block__" # Property used for lr blocking