Commit b2e47b34 authored by 's avatar

Added better error messages to handle lack of or incorrectly formatted

access file problems.
parent df2032fa
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Access control package""" """Access control package"""
__version__='$Revision: 1.76 $'[11:-2] __version__='$Revision: 1.77 $'[11:-2]
import Globals, App.Undo, socket, regex import Globals, App.Undo, socket, regex
from Globals import HTMLFile, MessageDialog, Persistent, PersistentMapping from Globals import HTMLFile, MessageDialog, Persistent, PersistentMapping
...@@ -283,6 +283,11 @@ class Super(User): ...@@ -283,6 +283,11 @@ class Super(User):
_remote_user_mode=0 _remote_user_mode=0
try: try:
f=open('%s/access' % INSTANCE_HOME, 'r') f=open('%s/access' % INSTANCE_HOME, 'r')
except IOError:
raise 'InstallError', (
'No access file found at %s - see INSTALL.txt' % INSTANCE_HOME
)
try:
data=split(strip(f.readline()),':') data=split(strip(f.readline()),':')
f.close() f.close()
_remote_user_mode=not data[1] _remote_user_mode=not data[1]
...@@ -291,7 +296,7 @@ try: ...@@ -291,7 +296,7 @@ try:
super=Super(data[0],data[1],('manage',), ds) super=Super(data[0],data[1],('manage',), ds)
del data del data
except: except:
raise 'InstallError', 'No access file found - see INSTALL.txt' raise 'InstallError', 'Invalid format for access file - see INSTALL.txt'
nobody=User('Anonymous User','',('Anonymous',), []) nobody=User('Anonymous User','',('Anonymous',), [])
...@@ -594,7 +599,9 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager, ...@@ -594,7 +599,9 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
# Copy/Paste support # Copy/Paste support
def _notifyOfCopyTo(self, container, op=0): def _notifyOfCopyTo(self, container, op=0):
if hasattr(container, '__allow_groups__'): if hasattr(container, 'aq_base'):
container=container.aq_base
if hasattr(container, 'acl_users'):
raise TypeError, ( raise TypeError, (
'Target already contains a UserFolder.') 'Target already contains a UserFolder.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment