#NEWLINE# def logout( request , next_page = None , template_name = 'splunkdj:auth/registration/login.html' , redirect_field_name = REDIRECT_FIELD_NAME , current_app = None , extra_context = None ) : #NEWLINE# #INDENT# "\n    Logs out the user and displays 'You are logged out' message.\n    " #NEWLINE# if settings . SPLUNK_WEB_INTEGRATED : #NEWLINE# #INDENT# return HttpResponseRedirect ( settings . LOGOUT_URL ) #NEWLINE# #UNINDENT# userName = getattr ( request , 'user' , '-' ) #NEWLINE# auth_logout ( request ) #NEWLINE# redirect_to = request . REQUEST . get ( redirect_field_name , '' ) #NEWLINE# if redirect_to : #NEWLINE# #INDENT# netloc = urlparse . urlparse ( redirect_to ) [ 1 ] #NEWLINE# if ( not ( netloc and ( netloc != request . get_host ( ) ) ) ) : #NEWLINE# #INDENT# response = HttpResponseRedirect ( redirect_to ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# response = HttpResponseRedirect ( settings . LOGIN_URL ) #NEWLINE# #UNINDENT# logout_user ( request . COOKIES , userName ) #NEWLINE# response . delete_cookie ( ( 'session_id_%s' % settings . SPLUNK_WEB_PORT ) ) #NEWLINE# response . delete_cookie ( 'cval' ) #NEWLINE# response . delete_cookie ( 'uid' ) #NEWLINE# return response