#NEWLINE# def post( self ) : #NEWLINE# #INDENT# next_url = self . request . arguments . get ( 'next' , [ None ] ) [ 0 ] #NEWLINE# username = self . request . arguments . get ( 'username' , [ None ] ) [ 0 ] #NEWLINE# password = self . request . arguments . get ( 'password' , [ None ] ) [ 0 ] #NEWLINE# if self . current_user : #NEWLINE# #INDENT# return self . redirect ( ( next_url or '/' ) ) #NEWLINE# #UNINDENT# if ( Settings [ 'login_strategy' ] == 'ldap' ) : #NEWLINE# #INDENT# if ( ( not username ) or ( not password ) ) : #NEWLINE# #INDENT# return self . render ( 'login.html' , page_title = 'Login' , next_url = next_url , errors = 'Please enter both a username and a password.' ) #NEWLINE# #UNINDENT# if ( not authenticate_ldap ( username , password ) ) : #NEWLINE# #INDENT# return self . render ( 'login.html' , page_title = 'Login' , next_url = next_url , errors = 'Invalid username or password specified.' ) #NEWLINE# #UNINDENT# return login ( self , username , next_url ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( Settings [ 'login_strategy' ] == 'saml' ) : #NEWLINE# #INDENT# return self . _saml_login ( ) #NEWLINE# #UNINDENT# #UNINDENT# return self . render ( 'login.html' , page_title = 'Login' , next_url = next_url , errors = 'No login strategy currently configured.' )