Commit a20b4e4b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Vincent Pelletier

use getIdOrUserName() instead of getUserName().

parent 0eed9896
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from Products.ERP5Type.JSONEncoder import encodeInJson as dumps from Products.ERP5Type.JSONEncoder import encodeInJson as dumps
portal = context.getPortalObject() portal = context.getPortalObject()
reference = portal.portal_membership.getAuthenticatedMember().getUserName() reference = portal.portal_membership.getAuthenticatedMember().getIdOrUserName()
processing = None processing = None
if reference == "Anonymous User": if reference == "Anonymous User":
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
portal = context.getPortalObject() portal = context.getPortalObject()
member = portal.portal_membership.getAuthenticatedMember() member = portal.portal_membership.getAuthenticatedMember()
reference = member.getUserName() reference = member.getIdOrUserName()
if reference == "Anonymous User": if reference == "Anonymous User":
return context.WebSection_viewUploadFileDialog() return context.WebSection_viewUploadFileDialog()
else: else:
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<pagetemplate startframe='content' id='FirstPage'> <pagetemplate startframe='content' id='FirstPage'>
<static> <static>
<infostring align="left" x="1cm" y= "29cm" size="8" font="Helvetica" color="(0,0,0)" <infostring align="left" x="1cm" y= "29cm" size="8" font="Helvetica" color="(0,0,0)"
tal:content="python: here.Base_translateString('ui', 'Printed by %(user)s at %(date)s') % {'user':user.getUserName(), 'date':DateTime()}" >Printed by</infostring> tal:content="python: here.Base_translateString('ui', 'Printed by %(user)s at %(date)s') % {'user':user.getIdOrUserName(), 'date':DateTime()}" >Printed by</infostring>
<infostring align="left" x="18cm" y= "0.5cm" size="10" font="Helvetica" color="(0,0,0)" >Page %(page)s</infostring> <infostring align="left" x="18cm" y= "0.5cm" size="10" font="Helvetica" color="(0,0,0)" >Page %(page)s</infostring>
</static> </static>
<frame showBoundary='0' leftpadding='0.1cm' height='23.94cm' width='17.59cm' rightpadding='0.1cm' y='2cm' x='2cm' nextid='content' toppadding='0.2cm' id='content' bottompadding='0.5cm'/> <frame showBoundary='0' leftpadding='0.1cm' height='23.94cm' width='17.59cm' rightpadding='0.1cm' y='2cm' x='2cm' nextid='content' toppadding='0.2cm' id='content' bottompadding='0.5cm'/>
......
...@@ -207,7 +207,7 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin): ...@@ -207,7 +207,7 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
""" Check if Knowledge Pad is configured correctly """ """ Check if Knowledge Pad is configured correctly """
self.portal.ERP5Site_createDefaultKnowledgePadListForUser() self.portal.ERP5Site_createDefaultKnowledgePadListForUser()
self.tic() self.tic()
current_user = self.portal.portal_membership.getAuthenticatedMember().getUserName() current_user = self.portal.portal_membership.getAuthenticatedMember().getIdOrUserName()
pad = self.portal.portal_catalog.getResultValue(portal_type="Knowledge Pad", pad = self.portal.portal_catalog.getResultValue(portal_type="Knowledge Pad",
owner=current_user) owner=current_user)
gadget_uid = self.portal.portal_gadgets.test_wizard_gadget.getUid() gadget_uid = self.portal.portal_gadgets.test_wizard_gadget.getUid()
......
portal = context.getPortalObject() portal = context.getPortalObject()
user_name = context.portal_membership.getAuthenticatedMember().getUserName() user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
person_or_organisation_list = portal.portal_catalog(\ person_or_organisation_list = portal.portal_catalog(\
portal_type=['Organisation', 'Person'], portal_type=['Organisation', 'Person'],
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
document_type_list = context.EGov_getAllowedFormTypeList() document_type_list = context.EGov_getAllowedFormTypeList()
portal = context.getPortalObject() portal = context.getPortalObject()
user_name = context.portal_membership.getAuthenticatedMember().getUserName() user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
form_list = portal.portal_catalog(\ form_list = portal.portal_catalog(\
portal_type=document_type_list, portal_type=document_type_list,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
document_type_list = context.EGov_getAllowedFormTypeList() document_type_list = context.EGov_getAllowedFormTypeList()
portal = context.getPortalObject() portal = context.getPortalObject()
user_name = context.portal_membership.getAuthenticatedMember().getUserName() user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
form_list = portal.portal_catalog(\ form_list = portal.portal_catalog(\
portal_type=document_type_list, portal_type=document_type_list,
......
...@@ -3,7 +3,7 @@ portal_type_list = context.EGov_getAllowedFormTypeList() ...@@ -3,7 +3,7 @@ portal_type_list = context.EGov_getAllowedFormTypeList()
validation_state_list=['archived',] validation_state_list=['archived',]
# get user name # get user name
user_name = context.portal_membership.getAuthenticatedMember().getUserName() user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
if not kw.has_key('portal_type'): if not kw.has_key('portal_type'):
kw['portal_type'] = portal_type_list kw['portal_type'] = portal_type_list
......
# get user name # get user name
user_name = context.portal_membership.getAuthenticatedMember().getUserName() user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
if not kw.has_key('portal_type'): if not kw.has_key('portal_type'):
kw['portal_type'] = context.getPortalDocumentTypeList() kw['portal_type'] = context.getPortalDocumentTypeList()
......
...@@ -4,7 +4,7 @@ if portal_type_list == (): ...@@ -4,7 +4,7 @@ if portal_type_list == ():
return [] return []
# get portal_type_listuser name # get portal_type_listuser name
user_name = context.portal_membership.getAuthenticatedMember().getUserName() user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
if not kw.has_key('portal_type'): if not kw.has_key('portal_type'):
kw['portal_type'] = portal_type_list kw['portal_type'] = portal_type_list
......
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:((\'owner\', here.portal_membership.getAuthenticatedMember().getUserName()), (\'validation_state\', ()), (\'all_versions\', 1))</string> </value> <value> <string>python:((\'owner\', here.portal_membership.getAuthenticatedMember().getIdOrUserName()), (\'validation_state\', ()), (\'all_versions\', 1))</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -8,7 +8,7 @@ expire_timeout_days = 90 ...@@ -8,7 +8,7 @@ expire_timeout_days = 90
session_id = request.get('session_id', None) session_id = request.get('session_id', None)
if session_id is None: if session_id is None:
## first call so generate session_id and send back via cookie ## first call so generate session_id and send back via cookie
session_id = 'erp5runmydocs_' + context.REQUEST.other['AUTHENTICATED_USER'].getUserName() session_id = 'erp5runmydocs_' + context.REQUEST.other['AUTHENTICATED_USER'].getIdOrUserName()
request.RESPONSE.setCookie('erp5_session_id', request.RESPONSE.setCookie('erp5_session_id',
session_id, session_id,
expires=(now +expire_timeout_days).fCommon(), path='/') expires=(now +expire_timeout_days).fCommon(), path='/')
......
...@@ -4,7 +4,7 @@ expire_timeout_days = 1 ...@@ -4,7 +4,7 @@ expire_timeout_days = 1
session_id = request.get('session_id', None) session_id = request.get('session_id', None)
if session_id is None or not session_id.startswith("erp5zuite"): if session_id is None or not session_id.startswith("erp5zuite"):
## first call so generate session_id and send back via cookie ## first call so generate session_id and send back via cookie
session_id = 'erp5zuite_' + context.REQUEST.other['AUTHENTICATED_USER'].getUserName() session_id = 'erp5zuite_' + context.REQUEST.other['AUTHENTICATED_USER'].getIdOrUserName()
request.RESPONSE.setCookie('erp5_session_id', session_id, expires=(now +expire_timeout_days).fCommon(), path='/') request.RESPONSE.setCookie('erp5_session_id', session_id, expires=(now +expire_timeout_days).fCommon(), path='/')
session = context.portal_sessions[session_id] session = context.portal_sessions[session_id]
......
...@@ -5,7 +5,7 @@ if module_id_list is None: ...@@ -5,7 +5,7 @@ if module_id_list is None:
module_id_list = context.WebSection_getDefaultToolbarModuleItemList() module_id_list = context.WebSection_getDefaultToolbarModuleItemList()
portal = context.getPortalObject() portal = context.getPortalObject()
user = portal.portal_membership.getAuthenticatedMember().getUserName() user = portal.portal_membership.getAuthenticatedMember().getIdOrUserName()
web_site_id = getattr(context, 'getWebSiteValue', None) is not None and \ web_site_id = getattr(context, 'getWebSiteValue', None) is not None and \
context.getWebSiteValue().getId() context.getWebSiteValue().getId()
......
...@@ -3,7 +3,7 @@ from Products.ERP5Type.Cache import CachingMethod ...@@ -3,7 +3,7 @@ from Products.ERP5Type.Cache import CachingMethod
navigation_box_render = context.ERP5Site_navigationBox navigation_box_render = context.ERP5Site_navigationBox
navigation_box_render = CachingMethod(navigation_box_render, navigation_box_render = CachingMethod(navigation_box_render,
("ERP5Site_renderCachedNavigationBox", ("ERP5Site_renderCachedNavigationBox",
context.portal_membership.getAuthenticatedMember().getUserName(), context.portal_membership.getAuthenticatedMember().getIdOrUserName(),
context.Localizer.get_selected_language(), context.Localizer.get_selected_language(),
context.portal_url(), context.portal_url(),
),cache_factory='erp5_ui_short') ),cache_factory='erp5_ui_short')
......
...@@ -14,7 +14,7 @@ def getCachedPageTemplate(self, id=None, REQUEST=None): ...@@ -14,7 +14,7 @@ def getCachedPageTemplate(self, id=None, REQUEST=None):
# Get the user id and request # Get the user id and request
if not REQUEST: if not REQUEST:
REQUEST = get_request() REQUEST = get_request()
user_id = self.portal_membership.getAuthenticatedMember().getUserName() user_id = self.portal_membership.getAuthenticatedMember().getIdOrUserName()
key = (user_id, id) key = (user_id, id)
# lookup the cache for time # lookup the cache for time
now = time.time() now = time.time()
......
from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.Cache import CachingMethod
portal = context.getPortalObject() portal = context.getPortalObject()
user = portal.portal_membership.getAuthenticatedMember().getUserName() user = portal.portal_membership.getAuthenticatedMember().getIdOrUserName()
def getModuleItemList(user=None): def getModuleItemList(user=None):
gettext = portal.Localizer.erp5_ui.gettext gettext = portal.Localizer.erp5_ui.gettext
......
...@@ -2,7 +2,7 @@ from Products.ERP5Type.Cache import CachingMethod ...@@ -2,7 +2,7 @@ from Products.ERP5Type.Cache import CachingMethod
navigation_box_render = context.navigation_box_render navigation_box_render = context.navigation_box_render
navigation_box_render = CachingMethod(navigation_box_render, navigation_box_render = CachingMethod(navigation_box_render,
("ERP5Site_renderCachedNavigationBox", ("ERP5Site_renderCachedNavigationBox",
context.portal_membership.getAuthenticatedMember().getUserName(), context.portal_membership.getAuthenticatedMember().getIdOrUserName(),
context.Localizer.get_selected_language(), context.Localizer.get_selected_language(),
context.portal_url(), context.portal_url(),
),cache_factory='erp5_ui_short') ),cache_factory='erp5_ui_short')
......
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