Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
PlonePAS.plugins.cookie_handler.ExtendedCookieAuthHelper Class Reference
Inheritance diagram for PlonePAS.plugins.cookie_handler.ExtendedCookieAuthHelper:
Inheritance graph
[legend]
Collaboration diagram for PlonePAS.plugins.cookie_handler.ExtendedCookieAuthHelper:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def updateCredentials
def login

Static Public Attributes

string meta_type = 'Extended Cookie Auth Helper'
tuple security = ClassSecurityInfo()

Detailed Description

Multi-plugin which adds ability to override the updating of cookie via
a setAuthCookie method/script.

Definition at line 44 of file cookie_handler.py.


Member Function Documentation

Set a cookie and redirect to the url that we tried to
authenticate against originally.

Override standard login method to avoid calling
'return response.redirect(came_from)' as there is additional
processing to ignore known bad come_from templates at
login_next.cpy script.

Definition at line 66 of file cookie_handler.py.

00066 
00067     def login(self):
00068         """Set a cookie and redirect to the url that we tried to
00069         authenticate against originally.
00070 
00071         Override standard login method to avoid calling
00072         'return response.redirect(came_from)' as there is additional
00073         processing to ignore known bad come_from templates at
00074         login_next.cpy script.
00075         """
00076         request = self.REQUEST
00077         response = request['RESPONSE']
00078 
00079         login = request.get('__ac_name', '')
00080         password = request.get('__ac_password', '')
00081 
00082         user = getSecurityManager().getUser()
00083         user_pas = aq_parent(user)
00084 
00085         if IPluggableAuthService.providedBy(user_pas):
00086             # Delegate to the users own PAS if possible
00087             user_pas.updateCredentials(request, response, login, password)
00088         else:
00089             # User does not originate from a PAS user folder, so lets try
00090             # to do our own thing.
00091             # XXX Perhaps we should do nothing here; test with pure User Folder!
00092             pas_instance = self._getPAS()
00093             if pas_instance is not None:
00094                 pas_instance.updateCredentials(request, response, login, password)
00095 
00096 
00097 classImplements(ExtendedCookieAuthHelper,
00098                 ILoginPasswordHostExtractionPlugin,
00099                 IChallengePlugin,
00100                 ICredentialsUpdatePlugin,
00101                 ICredentialsResetPlugin,
00102                )
00103 
00104 InitializeClass(ExtendedCookieAuthHelper)

Here is the call graph for this function:

def PlonePAS.plugins.cookie_handler.ExtendedCookieAuthHelper.updateCredentials (   self,
  request,
  response,
  login,
  new_password 
)
Override standard updateCredentials method

Definition at line 53 of file cookie_handler.py.

00053 
00054     def updateCredentials(self, request, response, login, new_password):
00055         """Override standard updateCredentials method
00056         """
00057 
00058         setAuthCookie = getattr(self, 'setAuthCookie', None)
00059         if setAuthCookie:
00060             cookie_val = encodestring('%s:%s' % (login, new_password))
00061             cookie_val = cookie_val.rstrip()
00062             setAuthCookie(response, self.cookie_name, quote(cookie_val))
00063         else:
00064             BasePlugin.updateCredentials(self, request, response, login, new_password)


Member Data Documentation

string PlonePAS.plugins.cookie_handler.ExtendedCookieAuthHelper.meta_type = 'Extended Cookie Auth Helper' [static]

Definition at line 49 of file cookie_handler.py.

Definition at line 50 of file cookie_handler.py.


The documentation for this class was generated from the following file: