Back to index

plone3  3.1.7
global_symbols.py
Go to the documentation of this file.
00001 # -*- coding: utf-8 -*-
00002 ## GroupUserFolder
00003 ## Copyright (C)2006 Ingeniweb
00004 
00005 ## This program is free software; you can redistribute it and/or modify
00006 ## it under the terms of the GNU General Public License as published by
00007 ## the Free Software Foundation; either version 2 of the License, or
00008 ## (at your option) any later version.
00009 
00010 ## This program is distributed in the hope that it will be useful,
00011 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 ## GNU General Public License for more details.
00014 
00015 ## You should have received a copy of the GNU General Public License
00016 ## along with this program; see the file COPYING. If not, write to the
00017 ## Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 """
00019 
00020 """
00021 __version__ = "$Revision:  $"
00022 # $Source:  $
00023 # $Id: global_symbols.py 32384 2006-10-27 10:00:55Z encolpe $
00024 __docformat__ = 'restructuredtext'
00025 
00026 import os
00027 import string
00028 
00029 # Check if we have to be in debug mode
00030 import Log
00031 if os.path.isfile(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'debug.txt')):
00032     Log.LOG_LEVEL = Log.LOG_DEBUG
00033     DEBUG_MODE = 1
00034 else:
00035     Log.LOG_LEVEL = Log.LOG_NOTICE
00036     DEBUG_MODE = 0
00037 
00038 from Log import *
00039 
00040 # Retreive version
00041 if os.path.isfile(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'version.txt')):
00042     __version_file_ = open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'version.txt'), 'r', )
00043     version__ = __version_file_.read()[:-1]
00044     __version_file_.close()
00045 else:
00046     version__ = "(UNKNOWN)"
00047 
00048 # Check if we are in preview mode
00049 PREVIEW_PLONE21_IN_PLONE20_ = 0
00050 splitdir = os.path.split(os.path.abspath(os.path.dirname(__file__)))
00051 products = os.path.join(*splitdir[:-1])
00052 version_file = os.path.join(products, 'CMFPlone', 'version.txt')
00053 if os.path.isfile(version_file):
00054     # We check if we have Plone 2.0
00055     f = open(version_file, "r")
00056     v = f.read()
00057     f.close()
00058     if string.find(v, "2.0.") != -1:
00059         PREVIEW_PLONE21_IN_PLONE20_ = 1
00060 
00061 
00062 # Group prefix
00063 GROUP_PREFIX = "group_"
00064 GROUP_PREFIX_LEN = len(GROUP_PREFIX)
00065 
00066 # Batching range for ZMI pages
00067 MAX_USERS_PER_PAGE = 100
00068 
00069 # Max allowrd users or groups to enable tree view
00070 MAX_TREE_USERS_AND_GROUPS = 100
00071 
00072 # Users/groups tree cache time (in seconds)
00073 # This is used in management screens only
00074 TREE_CACHE_TIME = 10
00075 
00076 # List of user names that are likely not to be valid user names.
00077 # This list is for performance reasons in ZMI views. If some actual user names
00078 # are inside this list, management screens won't work for them but they
00079 # will still be able to authenticate.
00080 INVALID_USER_NAMES = [
00081     'BASEPATH1', 'BASEPATH2', 'BASEPATH3', 'a_', 'URL', 'acl_users', 'misc_',
00082     'management_view', 'management_page_charset', 'REQUEST', 'RESPONSE',
00083     'MANAGE_TABS_NO_BANNER', 'tree-item-url', 'SCRIPT_NAME', 'n_', 'help_topic',
00084     'Zope-Version', 'target',
00085     ]
00086 
00087 # LDAPUserFolder-specific stuff
00088 LDAPUF_METHOD = "manage_addLDAPSchemaItem"      # sample method to determine if a uf is an ldapuf
00089 LDAP_GROUP_RDN = "cn"                           # rdn attribute for groups
00090 
00091 LOCALROLE_BLOCK_PROPERTY = "__ac_local_roles_block__"           # Property used for lr blocking