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 @@
from Products.ERP5Type.JSONEncoder import encodeInJson as dumps
portal = context.getPortalObject()
reference = portal.portal_membership.getAuthenticatedMember().getUserName()
reference = portal.portal_membership.getAuthenticatedMember().getIdOrUserName()
processing = None
if reference == "Anonymous User":
......
......@@ -2,7 +2,7 @@
portal = context.getPortalObject()
member = portal.portal_membership.getAuthenticatedMember()
reference = member.getUserName()
reference = member.getIdOrUserName()
if reference == "Anonymous User":
return context.WebSection_viewUploadFileDialog()
else:
......
......@@ -6,7 +6,7 @@
<pagetemplate startframe='content' id='FirstPage'>
<static>
<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>
</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'/>
......
......@@ -207,7 +207,7 @@ class TestRunMyDocsConfiguratorWorkflowMixin(TestLiveConfiguratorWorkflowMixin):
""" Check if Knowledge Pad is configured correctly """
self.portal.ERP5Site_createDefaultKnowledgePadListForUser()
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",
owner=current_user)
gadget_uid = self.portal.portal_gadgets.test_wizard_gadget.getUid()
......
portal = context.getPortalObject()
user_name = context.portal_membership.getAuthenticatedMember().getUserName()
user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
person_or_organisation_list = portal.portal_catalog(\
portal_type=['Organisation', 'Person'],
......
......@@ -5,7 +5,7 @@
document_type_list = context.EGov_getAllowedFormTypeList()
portal = context.getPortalObject()
user_name = context.portal_membership.getAuthenticatedMember().getUserName()
user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
form_list = portal.portal_catalog(\
portal_type=document_type_list,
......
......@@ -5,7 +5,7 @@
document_type_list = context.EGov_getAllowedFormTypeList()
portal = context.getPortalObject()
user_name = context.portal_membership.getAuthenticatedMember().getUserName()
user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
form_list = portal.portal_catalog(\
portal_type=document_type_list,
......
......@@ -3,7 +3,7 @@ portal_type_list = context.EGov_getAllowedFormTypeList()
validation_state_list=['archived',]
# get user name
user_name = context.portal_membership.getAuthenticatedMember().getUserName()
user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
if not kw.has_key('portal_type'):
kw['portal_type'] = portal_type_list
......
# get user name
user_name = context.portal_membership.getAuthenticatedMember().getUserName()
user_name = context.portal_membership.getAuthenticatedMember().getIdOrUserName()
if not kw.has_key('portal_type'):
kw['portal_type'] = context.getPortalDocumentTypeList()
......
......@@ -4,7 +4,7 @@ if portal_type_list == ():
return []
# 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'):
kw['portal_type'] = portal_type_list
......
......@@ -165,7 +165,7 @@
<dictionary>
<item>
<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>
</dictionary>
</pickle>
......
......@@ -8,7 +8,7 @@ expire_timeout_days = 90
session_id = request.get('session_id', None)
if session_id is None:
## 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',
session_id,
expires=(now +expire_timeout_days).fCommon(), path='/')
......
......@@ -4,7 +4,7 @@ expire_timeout_days = 1
session_id = request.get('session_id', None)
if session_id is None or not session_id.startswith("erp5zuite"):
## 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='/')
session = context.portal_sessions[session_id]
......
......@@ -5,7 +5,7 @@ if module_id_list is None:
module_id_list = context.WebSection_getDefaultToolbarModuleItemList()
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 \
context.getWebSiteValue().getId()
......
......@@ -3,7 +3,7 @@ from Products.ERP5Type.Cache import CachingMethod
navigation_box_render = context.ERP5Site_navigationBox
navigation_box_render = CachingMethod(navigation_box_render,
("ERP5Site_renderCachedNavigationBox",
context.portal_membership.getAuthenticatedMember().getUserName(),
context.portal_membership.getAuthenticatedMember().getIdOrUserName(),
context.Localizer.get_selected_language(),
context.portal_url(),
),cache_factory='erp5_ui_short')
......
......@@ -14,7 +14,7 @@ def getCachedPageTemplate(self, id=None, REQUEST=None):
# Get the user id and request
if not REQUEST:
REQUEST = get_request()
user_id = self.portal_membership.getAuthenticatedMember().getUserName()
user_id = self.portal_membership.getAuthenticatedMember().getIdOrUserName()
key = (user_id, id)
# lookup the cache for time
now = time.time()
......
from Products.ERP5Type.Cache import CachingMethod
portal = context.getPortalObject()
user = portal.portal_membership.getAuthenticatedMember().getUserName()
user = portal.portal_membership.getAuthenticatedMember().getIdOrUserName()
def getModuleItemList(user=None):
gettext = portal.Localizer.erp5_ui.gettext
......
......@@ -2,7 +2,7 @@ from Products.ERP5Type.Cache import CachingMethod
navigation_box_render = context.navigation_box_render
navigation_box_render = CachingMethod(navigation_box_render,
("ERP5Site_renderCachedNavigationBox",
context.portal_membership.getAuthenticatedMember().getUserName(),
context.portal_membership.getAuthenticatedMember().getIdOrUserName(),
context.Localizer.get_selected_language(),
context.portal_url(),
),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