Log message for revision 113642: Avoid a dependency on "App"
Changed: U Zope/trunk/src/AccessControl/users.py -=- Modified: Zope/trunk/src/AccessControl/users.py =================================================================== --- Zope/trunk/src/AccessControl/users.py 2010-06-19 13:26:13 UTC (rev 113641) +++ Zope/trunk/src/AccessControl/users.py 2010-06-19 13:31:13 UTC (rev 113642) @@ -354,11 +354,13 @@ '''Reads an access file from the instance home. Returns name, password, domains, remote_user_mode. ''' - # TODO dependencies - import App.config - cfg = App.config.getConfiguration() + environ = os.environ + instancehome = environ.get('INSTANCE_HOME', None) + if not instancehome: + return None + try: - f = open(os.path.join(cfg.instancehome, filename), 'r') + f = open(os.path.join(instancehome, filename), 'r') line = f.readline() f.close() except IOError: @@ -367,8 +369,10 @@ if line: data = line.strip().split(':') remote_user_mode = not data[1] - try: ds = data[2].split(' ') - except: ds = [] + try: + ds = data[2].split(' ') + except: + ds = [] return data[0], data[1], ds, remote_user_mode else: return None _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins