Commit d6b4df68 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix typos, sorry.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40381 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a0a9321f
...@@ -48,25 +48,25 @@ from Products.ERP5Security.ERP5UserManager import ERP5UserManager,\ ...@@ -48,25 +48,25 @@ from Products.ERP5Security.ERP5UserManager import ERP5UserManager,\
SUPER_USER, _AuthenticationFailure SUPER_USER, _AuthenticationFailure
#Form for new plugin in ZMI #Form for new plugin in ZMI
manage_addERP5ExternalAuthicationPluginForm = PageTemplateFile( manage_addERP5ExternalAuthenticationPluginForm = PageTemplateFile(
'www/ERP5Security_addERP5ExternalAuthicationPlugin', globals(), 'www/ERP5Security_addERP5ExternalAuthenticationPlugin', globals(),
__name__='manage_addERP5ExternalAuthicationPluginForm') __name__='manage_addERP5ExternalAuthenticationPluginForm')
def addERP5ExternalAuthicationPlugin(dispatcher, id, title=None, user_id_key='', def addERP5ExternalAuthenticationPlugin(dispatcher, id, title=None, user_id_key='',
REQUEST=None): REQUEST=None):
""" Add a ERP5ExternalAuthicationPlugin to a Pluggable Auth Service. """ """ Add a ERP5ExternalAuthenticationPlugin to a Pluggable Auth Service. """
plugin = ERP5ExternalAuthicationPlugin( id, title, user_id_key) plugin = ERP5ExternalAuthenticationPlugin( id, title, user_id_key)
dispatcher._setObject(plugin.getId(), plugin) dispatcher._setObject(plugin.getId(), plugin)
if REQUEST is not None: if REQUEST is not None:
REQUEST['RESPONSE'].redirect( REQUEST['RESPONSE'].redirect(
'%s/manage_workspace' '%s/manage_workspace'
'?manage_tabs_message=' '?manage_tabs_message='
'ERP5ExternalAuthicationPlugin+added.' 'ERP5ExternalAuthenticationPlugin+added.'
% dispatcher.absolute_url()) % dispatcher.absolute_url())
class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper): class ERP5ExternalAuthenticationPlugin(ERP5UserManager, CookieAuthHelper):
""" """
External authentification PAS plugin which extracts the user id from HTTP External authentification PAS plugin which extracts the user id from HTTP
request header, like REMOTE_USER, openAMid, etc. request header, like REMOTE_USER, openAMid, etc.
...@@ -77,7 +77,7 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper): ...@@ -77,7 +77,7 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper):
user_id_key = '' user_id_key = ''
manage_options = (({'label': 'Edit', manage_options = (({'label': 'Edit',
'action': 'manage_editERP5ExternalAuthicationPluginForm',}, 'action': 'manage_editERP5ExternalAuthenticationPluginForm',},
) )
+ BasePlugin.manage_options[:] + BasePlugin.manage_options[:]
) )
...@@ -162,7 +162,7 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper): ...@@ -162,7 +162,7 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper):
#Cache Method for best performance #Cache Method for best performance
_authenticateCredentials = CachingMethod( _authenticateCredentials = CachingMethod(
_authenticateCredentials, _authenticateCredentials,
id='ERP5ExternalAuthicationPlugin_authenticateCredentials', id='ERP5ExternalAuthenticationPlugin_authenticateCredentials',
cache_factory='erp5_content_short') cache_factory='erp5_content_short')
try: try:
return _authenticateCredentials(login=login) return _authenticateCredentials(login=login)
...@@ -170,7 +170,7 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper): ...@@ -170,7 +170,7 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper):
return None return None
except StandardError,e: except StandardError,e:
#Log standard error #Log standard error
LOG('ERP5ExternalAuthicationPlugin.authenticateCredentials', PROBLEM, str(e)) LOG('ERP5ExternalAuthenticationPlugin.authenticateCredentials', PROBLEM, str(e))
return None return None
################################ ################################
...@@ -178,10 +178,10 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper): ...@@ -178,10 +178,10 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper):
################################ ################################
#'Edit' option form #'Edit' option form
manage_editERP5ExternalAuthicationPluginForm = PageTemplateFile( manage_editERP5ExternalAuthenticationPluginForm = PageTemplateFile(
'www/ERP5Security_editERP5ExternalAuthicationPlugin', 'www/ERP5Security_editERP5ExternalAuthenticationPlugin',
globals(), globals(),
__name__='manage_editERP5ExternalAuthicationPluginForm' ) __name__='manage_editERP5ExternalAuthenticationPluginForm' )
security.declareProtected( ManageUsers, 'manage_editERP5ExternalAuthenticationPlugin' ) security.declareProtected( ManageUsers, 'manage_editERP5ExternalAuthenticationPlugin' )
def manage_editERP5ExternalAuthenticationPlugin(self, user_id_key, RESPONSE=None): def manage_editERP5ExternalAuthenticationPlugin(self, user_id_key, RESPONSE=None):
...@@ -198,17 +198,17 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper): ...@@ -198,17 +198,17 @@ class ERP5ExternalAuthicationPlugin(ERP5UserManager, CookieAuthHelper):
if RESPONSE is not None: if RESPONSE is not None:
if error_message != '': if error_message != '':
self.REQUEST.form['manage_tabs_message'] = error_message self.REQUEST.form['manage_tabs_message'] = error_message
return self.manage_editERP5ExternalAuthicationPluginForm(RESPONSE) return self.manage_editERP5ExternalAuthenticationPluginForm(RESPONSE)
else: else:
message = "Updated" message = "Updated"
RESPONSE.redirect('%s/manage_editERP5ExternalAuthicationPluginForm' RESPONSE.redirect('%s/manage_editERP5ExternalAuthenticationPluginForm'
'?manage_tabs_message=%s' '?manage_tabs_message=%s'
% ( self.absolute_url(), message ) % ( self.absolute_url(), message )
) )
#List implementation of class #List implementation of class
classImplements(ERP5ExternalAuthicationPlugin, classImplements(ERP5ExternalAuthenticationPlugin,
plugins.IAuthenticationPlugin, plugins.IAuthenticationPlugin,
plugins.ILoginPasswordHostExtractionPlugin) plugins.ILoginPasswordHostExtractionPlugin)
InitializeClass(ERP5ExternalAuthicationPlugin) InitializeClass(ERP5ExternalAuthenticationPlugin)
...@@ -26,7 +26,7 @@ import ERP5GroupManager ...@@ -26,7 +26,7 @@ import ERP5GroupManager
import ERP5RoleManager import ERP5RoleManager
import ERP5UserFactory import ERP5UserFactory
import ERP5KeyAuthPlugin import ERP5KeyAuthPlugin
import ERP5ExternalAuthicationPlugin import ERP5ExternalAuthenticationPlugin
def mergedLocalRoles(object): def mergedLocalRoles(object):
"""Returns a merging of object and its ancestors' """Returns a merging of object and its ancestors'
...@@ -61,7 +61,7 @@ registerMultiPlugin(ERP5GroupManager.ERP5GroupManager.meta_type) ...@@ -61,7 +61,7 @@ registerMultiPlugin(ERP5GroupManager.ERP5GroupManager.meta_type)
registerMultiPlugin(ERP5RoleManager.ERP5RoleManager.meta_type) registerMultiPlugin(ERP5RoleManager.ERP5RoleManager.meta_type)
registerMultiPlugin(ERP5UserFactory.ERP5UserFactory.meta_type) registerMultiPlugin(ERP5UserFactory.ERP5UserFactory.meta_type)
registerMultiPlugin(ERP5KeyAuthPlugin.ERP5KeyAuthPlugin.meta_type) registerMultiPlugin(ERP5KeyAuthPlugin.ERP5KeyAuthPlugin.meta_type)
registerMultiPlugin(ERP5ExternalAuthicationPlugin.ERP5ExternalAuthicationPlugin.meta_type) registerMultiPlugin(ERP5ExternalAuthenticationPlugin.ERP5ExternalAuthenticationPlugin.meta_type)
def initialize(context): def initialize(context):
...@@ -110,11 +110,11 @@ def initialize(context): ...@@ -110,11 +110,11 @@ def initialize(context):
, icon='www/portal.gif' , icon='www/portal.gif'
) )
context.registerClass( ERP5ExternalAuthicationPlugin.ERP5ExternalAuthicationPlugin context.registerClass( ERP5ExternalAuthenticationPlugin.ERP5ExternalAuthenticationPlugin
, permission=ManageUsers , permission=ManageUsers
, constructors=( , constructors=(
ERP5ExternalAuthicationPlugin.manage_addERP5ExternalAuthicationPluginForm, ERP5ExternalAuthenticationPlugin.manage_addERP5ExternalAuthenticationPluginForm,
ERP5ExternalAuthicationPlugin.addERP5ExternalAuthicationPlugin, ) ERP5ExternalAuthenticationPlugin.addERP5ExternalAuthenticationPlugin, )
, visibility=None , visibility=None
, icon='www/portal.gif' , icon='www/portal.gif'
) )
......
...@@ -723,7 +723,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase): ...@@ -723,7 +723,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
self.assertEqual(response.getStatus(), 200) self.assertEqual(response.getStatus(), 200)
self.assertTrue(reference in response.getBody()) self.assertTrue(reference in response.getBody())
def testERP5ExternalAuthicationPlugin(self): def testERP5ExternalAuthenticationPlugin(self):
""" """
Make sure that we can grant security using a ERP5 External Authentication Plugin. Make sure that we can grant security using a ERP5 External Authentication Plugin.
""" """
...@@ -731,7 +731,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase): ...@@ -731,7 +731,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
# add key authentication PAS plugin # add key authentication PAS plugin
portal = self.portal portal = self.portal
uf = portal.acl_users uf = portal.acl_users
uf.manage_addProduct['ERP5Security'].addERP5ExternalAuthicationPlugin( uf.manage_addProduct['ERP5Security'].addERP5ExternalAuthenticationPlugin(
id='erp5_external_authentication_plugin', \ id='erp5_external_authentication_plugin', \
title='ERP5 External Authentication Plugin',\ title='ERP5 External Authentication Plugin',\
user_id_key=user_id_key,) user_id_key=user_id_key,)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<p class="form-help">Please input the configuration</p> <p class="form-help">Please input the configuration</p>
<form action="addERP5ExternalAuthicationPlugin" method="POST"> <form action="addERP5ExternalAuthenticationPlugin" method="POST">
<table cellspacing="0" cellpadding="2" border="0"> <table cellspacing="0" cellpadding="2" border="0">
<tr> <tr>
<td align="left" valign="top"> <td align="left" valign="top">
......
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