Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
plone.app.portlets.portlets.login.Renderer Class Reference
Inheritance diagram for plone.app.portlets.portlets.login.Renderer:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.portlets.login.Renderer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def show
def available
def login_form
def mail_password_form
def login_name
def login_password
def join_action
def can_register
def can_request_password
def auth
def update
def render

Public Attributes

 membership
 context_state
 portal_state
 pas_info
 context
 request
 view
 manager
 data

Static Public Attributes

tuple render = ViewPageTemplateFile('login.pt')

Detailed Description

Definition at line 27 of file login.py.


Constructor & Destructor Documentation

def plone.app.portlets.portlets.login.Renderer.__init__ (   self,
  context,
  request,
  view,
  manager,
  data 
)

Reimplemented from plone.app.portlets.portlets.base.Renderer.

Definition at line 29 of file login.py.

00029 
00030     def __init__(self, context, request, view, manager, data):
00031         base.Renderer.__init__(self, context, request, view, manager, data)
00032         
00033         self.membership = getToolByName(self.context, 'portal_membership')
00034         
00035         self.context_state = getMultiAdapter((context, request), name=u'plone_context_state')
00036         self.portal_state = getMultiAdapter((context, request), name=u'plone_portal_state')
00037         self.pas_info = getMultiAdapter((context, request), name=u'pas_info')

Here is the caller graph for this function:


Member Function Documentation

def plone.app.portlets.portlets.login.Renderer.auth (   self,
  _marker = [] 
)

Definition at line 91 of file login.py.

00091 
00092     def auth(self, _marker=[]):
00093         acl_users = getToolByName(self.context, 'acl_users')
00094         return getattr(acl_users, 'credentials_cookie_auth', None)

Here is the call graph for this function:

Here is the caller graph for this function:

By default, portlets are available

Reimplemented from plone.app.portlets.portlets.base.Renderer.

Definition at line 47 of file login.py.

00047 
00048     def available(self):
00049         return self.auth() is not None and self.show()

Here is the call graph for this function:

Definition at line 82 of file login.py.

00082 
00083     def can_register(self):
00084         if getToolByName(self.context, 'portal_registration', None) is None:
00085             return False
00086         return self.membership.checkPermission('Add portal member', self.context)

Here is the call graph for this function:

Definition at line 87 of file login.py.

00087 
00088     def can_request_password(self):
00089         return self.membership.checkPermission('Mail forgotten password', self.context)

Definition at line 74 of file login.py.

00074 
00075     def join_action(self):
00076         userActions = self.context_state.actions()['user']
00077         joinAction = [a['url'] for a in userActions if a['id'] == 'join']
00078         if len(joinAction) > 0:
00079             return joinAction.pop()
00080         else:
00081             return None

Definition at line 50 of file login.py.

00050 
00051     def login_form(self):
00052         return '%s/login_form' % self.portal_state.portal_url()

Definition at line 56 of file login.py.

00056 
00057     def login_name(self):
00058         auth = self.auth()
00059         name = None
00060         if auth is not None:
00061             name = getattr(auth, 'name_cookie', None)
00062         if not name:
00063             name = '__ac_name'
00064         return name

Here is the call graph for this function:

Definition at line 65 of file login.py.

00065 
00066     def login_password(self):
00067         auth = self.auth()
00068         passwd = None
00069         if auth is not None:
00070             passwd = getattr(auth, 'pw_cookie', None)
00071         if not passwd:
00072             passwd = '__ac_password'
00073         return passwd

Here is the call graph for this function:

Definition at line 53 of file login.py.

00053 
00054     def mail_password_form(self):
00055         return '%s/mail_password_form' % self.portal_state.portal_url()

Reimplemented in plone.app.portlets.portlets.navigation.Renderer, plone.app.portlets.portlets.base.DeferredRenderer, plone.app.portlets.portlets.calendar.Renderer, plone.app.portlets.portlets.events.Renderer, plone.app.portlets.portlets.recent.Renderer, and plone.app.portlets.portlets.news.Renderer.

Definition at line 85 of file base.py.

00085 
00086     def render(self):
00087         raise NotImplementedError("You must implement 'render' as a method "
00088                                   "or page template file attribute")

Definition at line 38 of file login.py.

00038 
00039     def show(self):
00040         if not self.portal_state.anonymous():
00041             return False
00042         if not self.pas_info.hasLoginPasswordExtractor():
00043             return False
00044         page = self.request.get('URL', '').split('/')[-1]
00045         return page not in ('login_form', 'join_form')

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from plone.app.portlets.portlets.base.Renderer.

Definition at line 95 of file login.py.

00095 
00096     def update(self):
00097         pass

Here is the caller graph for this function:


Member Data Documentation

Reimplemented in plone.app.portlets.portlets.classic.Renderer.

Definition at line 75 of file base.py.

Definition at line 34 of file login.py.

Reimplemented in plone.app.portlets.portlets.classic.Renderer.

Definition at line 80 of file base.py.

Definition at line 79 of file base.py.

Definition at line 32 of file login.py.

Definition at line 36 of file login.py.

Definition at line 35 of file login.py.

tuple plone.app.portlets.portlets.login.Renderer.render = ViewPageTemplateFile('login.pt') [static]

Definition at line 98 of file login.py.

Definition at line 76 of file base.py.

Definition at line 77 of file base.py.


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