Back to index

moin  1.9.0~rc2
Public Member Functions | Static Public Attributes
MoinMoin.auth.MoinAuth Class Reference
Inheritance diagram for MoinMoin.auth.MoinAuth:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.auth.MoinAuth:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def login
def login_hint
def request
def logout

Static Public Attributes

list login_inputs = ['username', 'password']
string name = 'moin'
 logout_possible = True

Detailed Description

handle login from moin login form 

Definition at line 216 of file __init__.py.


Constructor & Destructor Documentation

Reimplemented from MoinMoin.auth.BaseAuth.

Definition at line 218 of file __init__.py.

00218 
00219     def __init__(self):
00220         BaseAuth.__init__(self)


Member Function Documentation

def MoinMoin.auth.MoinAuth.login (   self,
  request,
  user_obj,
  kw 
)

Reimplemented from MoinMoin.auth.BaseAuth.

Definition at line 225 of file __init__.py.

00225 
00226     def login(self, request, user_obj, **kw):
00227         username = kw.get('username')
00228         password = kw.get('password')
00229 
00230         # simply continue if something else already logged in successfully
00231         if user_obj and user_obj.valid:
00232             return ContinueLogin(user_obj)
00233 
00234         if not username and not password:
00235             return ContinueLogin(user_obj)
00236 
00237         _ = request.getText
00238 
00239         logging.debug("%s: performing login action" % self.name)
00240 
00241         if username and not password:
00242             return ContinueLogin(user_obj, _('Missing password. Please enter user name and password.'))
00243 
00244         u = user.User(request, name=username, password=password, auth_method=self.name)
00245         if u.valid:
00246             logging.debug("%s: successfully authenticated user %r (valid)" % (self.name, u.name))
00247             return ContinueLogin(u)
00248         else:
00249             logging.debug("%s: could not authenticate user %r (not valid)" % (self.name, username))
00250             return ContinueLogin(user_obj, _("Invalid username or password."))

def MoinMoin.auth.MoinAuth.login_hint (   self,
  request 
)

Reimplemented from MoinMoin.auth.BaseAuth.

Definition at line 251 of file __init__.py.

00251 
00252     def login_hint(self, request):
00253         _ = request.getText
00254         #if request.cfg.openidrp_registration_url:
00255         #    userprefslink = request.cfg.openidrp_registration_url
00256         #else:
00257         userprefslink = request.page.url(request, querystr={'action': 'newaccount'})
00258         sendmypasswordlink = request.page.url(request, querystr={'action': 'recoverpass'})
00259 
00260         msg = ''
00261         #if request.cfg.openidrp_allow_registration:
00262         msg = _('If you do not have an account, <a href="%(userprefslink)s">you can create one now</a>. ') % {
00263               'userprefslink': userprefslink}
00264         msg += _('<a href="%(sendmypasswordlink)s">Forgot your password?</a>') % {
00265                'sendmypasswordlink': sendmypasswordlink}
00266         return msg
00267 
00268         #return _('If you do not have an account, <a href="%(userprefslink)s">you can create one now</a>. '
00269         #         '<a href="%(sendmypasswordlink)s">Forgot your password?</a>') % {
00270         #       'userprefslink': userprefslink,
00271         #       'sendmypasswordlink': sendmypasswordlink}
00272 

def MoinMoin.auth.BaseAuth.logout (   self,
  request,
  user_obj,
  kw 
) [inherited]

Reimplemented in MoinMoin.auth.cas.CASAuth, MoinMoin.auth.smb_mount.SMBMount, and MoinMoin.auth.log.AuthLog.

Definition at line 208 of file __init__.py.

00208 
00209     def logout(self, request, user_obj, **kw):
00210         if self.name and user_obj and user_obj.auth_method == self.name:
00211             logging.debug("%s: logout - invalidating user %r" % (self.name, user_obj.name))
00212             user_obj.valid = False
        return user_obj, True
def MoinMoin.auth.BaseAuth.request (   self,
  request,
  user_obj,
  kw 
) [inherited]

Member Data Documentation

list MoinMoin.auth.MoinAuth.login_inputs = ['username', 'password'] [static]

Reimplemented from MoinMoin.auth.BaseAuth.

Definition at line 221 of file __init__.py.

Reimplemented from MoinMoin.auth.BaseAuth.

Definition at line 223 of file __init__.py.

string MoinMoin.auth.MoinAuth.name = 'moin' [static]

Reimplemented from MoinMoin.auth.BaseAuth.

Definition at line 222 of file __init__.py.


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