Commit 9083a528 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

literal changes only.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40386 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 84a999ea
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
# Francois-Xavier Algrain <fxalgrain@tiolive.com>
# #
# WARNING: This program as such is intended to be used by professional # WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential # programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs # consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial # End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software # guarantees and support are strongly adviced to contract a Free Software
# Service Company # Service Company
# #
# This program is Free Software; you can redistribute it and/or # This program is Free Software; you can redistribute it and/or
...@@ -55,7 +54,7 @@ def addERP5ExternalAuthenticationPlugin(dispatcher, id, title=None, user_id_key= ...@@ -55,7 +54,7 @@ def addERP5ExternalAuthenticationPlugin(dispatcher, id, title=None, user_id_key=
REQUEST=None): REQUEST=None):
""" Add a ERP5ExternalAuthenticationPlugin to a Pluggable Auth Service. """ """ Add a ERP5ExternalAuthenticationPlugin to a Pluggable Auth Service. """
plugin = ERP5ExternalAuthenticationPlugin( 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:
...@@ -121,7 +120,7 @@ class ERP5ExternalAuthenticationPlugin(ERP5UserManager): ...@@ -121,7 +120,7 @@ class ERP5ExternalAuthenticationPlugin(ERP5UserManager):
# IAuthenticationPlugin # # IAuthenticationPlugin #
################################ ################################
security.declarePrivate('authenticateCredentials') security.declarePrivate('authenticateCredentials')
def authenticateCredentials( self, credentials ): def authenticateCredentials(self, credentials):
"""Authentificate with credentials""" """Authentificate with credentials"""
login = credentials.get('external_login', None) login = credentials.get('external_login', None)
# Forbidden the usage of the super user. # Forbidden the usage of the super user.
...@@ -189,9 +188,9 @@ class ERP5ExternalAuthenticationPlugin(ERP5UserManager): ...@@ -189,9 +188,9 @@ class ERP5ExternalAuthenticationPlugin(ERP5UserManager):
manage_editERP5ExternalAuthenticationPluginForm = PageTemplateFile( manage_editERP5ExternalAuthenticationPluginForm = PageTemplateFile(
'www/ERP5Security_editERP5ExternalAuthenticationPlugin', 'www/ERP5Security_editERP5ExternalAuthenticationPlugin',
globals(), globals(),
__name__='manage_editERP5ExternalAuthenticationPluginForm' ) __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):
"""Edit the object""" """Edit the object"""
error_message = '' error_message = ''
...@@ -211,7 +210,7 @@ class ERP5ExternalAuthenticationPlugin(ERP5UserManager): ...@@ -211,7 +210,7 @@ class ERP5ExternalAuthenticationPlugin(ERP5UserManager):
message = "Updated" message = "Updated"
RESPONSE.redirect('%s/manage_editERP5ExternalAuthenticationPluginForm' 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
......
...@@ -270,7 +270,7 @@ class TestUserManagement(ERP5TypeTestCase): ...@@ -270,7 +270,7 @@ class TestUserManagement(ERP5TypeTestCase):
def test_MultiplePersonReferenceConcurrentTransaction(self): def test_MultiplePersonReferenceConcurrentTransaction(self):
""" """
Tests that it's refused to create two Persons with same reference. Tests that it's refused to create two Persons with same reference.
Check if both persons are created in 2 concurrent transactions. Check if both persons are created in 2 concurrent transactions.
For now, just verify that serialize is called on person_module. For now, just verify that serialize is called on person_module.
""" """
class DummyTestException(Exception): class DummyTestException(Exception):
...@@ -705,7 +705,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase): ...@@ -705,7 +705,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
assignment.open() assignment.open()
self.stepTic() self.stepTic()
# encrypt & decrypt works # encrypt & decrypt works
key = erp5_auth_key_plugin.encrypt(reference) key = erp5_auth_key_plugin.encrypt(reference)
self.assertNotEquals(reference, key) self.assertNotEquals(reference, key)
self.assertEquals(reference, erp5_auth_key_plugin.decrypt(key)) self.assertEquals(reference, erp5_auth_key_plugin.decrypt(key))
...@@ -717,7 +717,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase): ...@@ -717,7 +717,7 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
self.assertEqual(response.getStatus(), 302) self.assertEqual(response.getStatus(), 302)
self.assertTrue('location' in response.headers.keys()) self.assertTrue('location' in response.headers.keys())
self.assertTrue(response.headers['location'].endswith('login_form')) self.assertTrue(response.headers['location'].endswith('login_form'))
# view front page we should be logged in if we use authentication key # view front page we should be logged in if we use authentication key
response = self.publish('%s?__ac_key=%s' %(base_url, key)) response = self.publish('%s?__ac_key=%s' %(base_url, key))
self.assertEqual(response.getStatus(), 200) self.assertEqual(response.getStatus(), 200)
......
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