Commit ec3e3267 authored by Nicolas Delaby's avatar Nicolas Delaby

Update user management, remove useless LOGs

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15754 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 037b246e
......@@ -1037,7 +1037,7 @@ class Subscription(Folder, SyncCode):
if callable(gid_gen):
o_gid = gid_gen(object)
else:
raise ValueError, "The conduit "+conduit_name+"seems to no have a \
raise ValueError, "The conduit "+conduit_name+"seems to not have a \
getGidFromObject method and it must"
# elif getattr(o_base, gid_gen, None) is not None:
# generator = getattr(object, gid_gen)
......
......@@ -31,6 +31,7 @@ from Subscription import Subscription,Signature
from XMLSyncUtils import XMLSyncUtils, Parse
import commands
from Conduit.ERP5Conduit import ERP5Conduit
from AccessControl import getSecurityManager
from DateTime import DateTime
from zLOG import LOG, DEBUG, INFO
......@@ -46,8 +47,7 @@ class SubscriptionSynchronization(XMLSyncUtils):
subscription.initLastMessageId()
#save the actual user to use it in all the session:
user = self.portal_membership.getAuthenticatedMember().getUserName()
LOG('SubSyncInit, user saved :',DEBUG, user)
user = getSecurityManager().getUser()
subscription.setZopeUser(user)
subscription.setAuthenticated(True)
......
......@@ -979,13 +979,11 @@ class SynchronizationTool( SubscriptionSynchronization,
This will try to synchronize every subscription
"""
message_list = self.portal_activities.getMessageList()
LOG('sync, message_list:', DEBUG, message_list)
LOG('sync, len(message_list):', DEBUG, len(message_list))
if len(message_list) == 0:
for subscription in self.getSubscriptionList():
user = subscription.getZopeUser()
LOG('sync, user :',DEBUG, user)
newSecurityManager(None, user)
LOG('sync, type(subcription):', DEBUG, type(subscription))
self.activate(activity='RAMQueue').SubSync(subscription.getPath())
security.declarePublic('readResponse')
......
......@@ -798,7 +798,7 @@ class XMLSyncUtilsMixin(SyncCode):
local_gid_list = map(lambda x: domain.getGidFromObject(x),object_list)
# Objects to remove
LOG('remove object to remove ...', DEBUG, '')
LOG('getSyncMLData remove object to remove ...', DEBUG, '')
object_gid_deleted = []
for object_gid in subscriber.getGidList():
if object_gid not in local_gid_list:
......@@ -827,6 +827,7 @@ class XMLSyncUtilsMixin(SyncCode):
if max is not None and loop >= max:
result['finished'] = 0
break
LOG('getSyncMLData object_path', DEBUG, object_path)
object = self.unrestrictedTraverse(object_path)
status = self.SENT
object_gid = domain.getGidFromObject(object)
......@@ -1521,7 +1522,7 @@ class XMLSyncUtils(XMLSyncUtilsMixin):
domain=domain,
content_type=domain.getSyncContentType())
if syncml_data == '':
LOG('this is the end of the synchronisation session !!!', DEBUG, '')
LOG('this is the end of the synchronisation session !!!', INFO, '')
subscriber.setAuthenticated(False)
domain.setAuthenticated(False)
has_response = 1
......
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