Commit d740c9e4 authored by Fabien Morin's avatar Fabien Morin

- put an authentication type and format by default (if nothing is enter)

- remove useless method


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15652 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b315fcc0
...@@ -165,8 +165,8 @@ class Publication(Subscription): ...@@ -165,8 +165,8 @@ class Publication(Subscription):
self.setConduit(conduit) self.setConduit(conduit)
Folder.__init__(self, id) Folder.__init__(self, id)
self.title = title self.title = title
self.authentication_format = authentication_format self.setAuthenticationFormat(authentication_format)
self.authentication_type = authentication_type self.setAuthenticationType(authentication_type)
self.setSyncContentType(sync_content_type) self.setSyncContentType(sync_content_type)
self.setSynchronizeWithERP5Sites(synchronize_with_erp5_sites) self.setSynchronizeWithERP5Sites(synchronize_with_erp5_sites)
...@@ -189,30 +189,6 @@ class Publication(Subscription): ...@@ -189,30 +189,6 @@ class Publication(Subscription):
""" """
self.publication_url = publication_url self.publication_url = publication_url
def getAuthenticationFormat(self):
"""
return the format of authentication
"""
return getattr(self, 'authentication_format', '')
def getAuthenticationType(self):
"""
return the type of authentication
"""
return getattr(self, 'authentication_type', '')
def setAuthenticationFormat(self, authentication_format):
"""
set the format of authentication
"""
self.authentication_format = authentication_format
def setAuthenticationType(self, authentication_type):
"""
set the type of authentication
"""
self.authentication_type = authentication_type
def addSubscriber(self, subscriber): def addSubscriber(self, subscriber):
""" """
Add a new subscriber to the publication Add a new subscriber to the publication
......
...@@ -1015,12 +1015,18 @@ class Subscription(Folder, SyncCode): ...@@ -1015,12 +1015,18 @@ class Subscription(Folder, SyncCode):
""" """
set the format of authentication set the format of authentication
""" """
self.authentication_format = authentication_format if authentication_format in (None, ''):
self.authentication_format = 'b64'
else:
self.authentication_format=authentication_format
def setAuthenticationType(self, authentication_type): def setAuthenticationType(self, authentication_type):
""" """
set the type of authentication set the type of authentication
""" """
if authentication_type in (None, ''):
self.authentication_type = 'syncml:auth-basic'
else:
self.authentication_type = authentication_type self.authentication_type = authentication_type
def getGidFromObject(self, object): def getGidFromObject(self, object):
......
...@@ -179,8 +179,9 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -179,8 +179,9 @@ class SynchronizationTool( SubscriptionSynchronization,
destination_path, source_uri, query, xml_mapping, destination_path, source_uri, query, xml_mapping,
conduit, gpg_key, conduit, gpg_key,
synchronization_id_generator=None, gid_generator=None, synchronization_id_generator=None, gid_generator=None,
media_type=None, authentication_format='', media_type=None, authentication_format='b64',
authentication_type='', RESPONSE=None, activity_enabled = False, authentication_type='syncml:auth-basic',
RESPONSE=None, activity_enabled = False,
sync_content_type='application/vnd.syncml+xml', sync_content_type='application/vnd.syncml+xml',
synchronize_with_erp5_sites=True): synchronize_with_erp5_sites=True):
""" """
...@@ -195,7 +196,8 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -195,7 +196,8 @@ class SynchronizationTool( SubscriptionSynchronization,
destination_path, source_uri, query, xml_mapping, destination_path, source_uri, query, xml_mapping,
conduit, gpg_key, synchronization_id_generator, conduit, gpg_key, synchronization_id_generator,
gid_generator, media_type, gid_generator, media_type,
authentication_format, authentication_type, authentication_format,
authentication_type,
activity_enabled, synchronize_with_erp5_sites, activity_enabled, synchronize_with_erp5_sites,
sync_content_type) sync_content_type)
folder._setObject( new_id, pub ) folder._setObject( new_id, pub )
...@@ -244,7 +246,8 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -244,7 +246,8 @@ class SynchronizationTool( SubscriptionSynchronization,
destination_path, source_uri, query, xml_mapping, destination_path, source_uri, query, xml_mapping,
conduit, gpg_key, synchronization_id_generator, conduit, gpg_key, synchronization_id_generator,
gid_generator, media_type=None, gid_generator, media_type=None,
authentication_format='', authentication_type='', authentication_format='b64',
authentication_type='syncml:auth-basic',
RESPONSE=None, activity_enabled=False, RESPONSE=None, activity_enabled=False,
sync_content_type='application/vnd.syncml+xml', sync_content_type='application/vnd.syncml+xml',
synchronize_with_erp5_sites=False): synchronize_with_erp5_sites=False):
......
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