Commit 69aa89da authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

rename ERP5ExternalAuthPlugin -> ERP5ExternalAuthenticationPlugin.

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