""" Configuration module """

__version__ = "$Revision: 1.35 $"
# $Source: /home/vladap/src/mysqlUserFolder/RCS/cfg.py,v $
#
# $Author: vladap $
# $Date: 2004/05/15 18:25:16 $


# --------------------------------------------------------------------- */
# Parameters

# Debug can be: 0, 1, 2
DEBUG = 0

# This is not used for Zope 2.7 (and later)
REQUEST_RADDR_FIELD="REMOTE_ADDR"

COOKIE_MIN_EXPIRE=7200		# 2 hours
							# This parameter defines minimum expiry
							# time mysql user folder will send to browsers.

AUTO_CREATE_ROLES=0
	# This is usefull for GRUF. If it is 1, mysqlUserFolder will automatically
	# add roles specified in User.change_user_roles ()
								
# --------------------------------------------------------------------- */
# Validation parameters

VALIDATE_ALWAYS_SUPER = 0
VALIDATE_ONLY_ANONYMOUS = 0

VALIDATE_IGNORE_ROLES = []

# --------------------------------------------------------------------- */
# Cashing parameters
# LIFE parameters are in seconds.

CACHE_SESSIONS = 1
CACHE_SESSIONS_LIFE = 600
CACHE_USERS = 1
CACHE_USERS_LIFE = 60
CACHE_TOKENS = 1
CACHE_TOKENS_LIFE = 60

# --------------------------------------------------------------------- */
# Field sizes

FSIZE_USERNAME = 60
FSIZE_EMAIL = 60
FSIZE_REALNAME = 50
FSIZE_PASSWORD = 32
FSIZE_ROLENAME = 20
FSIZE_DOMAINS = 160

# --------------------------------------------------------------------- */
# Internal constants

ZOPE_ANONYMOUS_ROLE = 'Anonymous'
ZOPE_AUTHENTICATED_ROLE = 'Authenticated'
ZOPE_MANAGER_ROLE = 'Manager'

ZOPE_SYSTEM_ROLES = ['Anonymous', 'Authenticated', 'mysqlRole']

MYSQL_USER_ROLE = 'mysqlRole'

MYSQL_USER_EDIT_PERMISSION = 'Edit MySQL User Data'

MYSQL_ACT_METHODS = ['actChangeOther', 'actChangePassword', 'actCreateUser']

VDB_INVALID_ID = -1					# Invalid id for users and sessions.
VDB_INVALID_PASSWORD_TYPE = -1		# Invalid password type - locked password.

TOKEN_RNDSTR_LEN=30

COOKIE_MONTH_NAMES=['Jan', 'Feb', 'Mar', 'Apr', 'May', 
							'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
COOKIE_DAY_NAMES=['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']

MISC_DATA_EMPTY = (0, "")



