On 9 Sty, 22:16, Kevin Baker <[EMAIL PROTECTED]> wrote:
> I am on Pylons 0.9.6.1. I see that there have been changes for the
> usage of the response object in the controller.
The simple pylons .9.6.1 controller with authkit  test can look like
this:
import logging

from authtest.lib.base import *

log = logging.getLogger(__name__)

class MyTestController(BaseController):

    def index(self):
        return h.redirect_to(action="private")

    def private(self):
        if request.environ.get("REMOTE_USER"):
            html = " You are authenticated! <br>"
            html += h.link_to('logout', h.url_for(action='logout',
title=None))
            return html
        else:
            response.status = "401 Not
authenticated"
            abort(401)

    def logout(self):
        html = "Successfully signed out!<br>"
        html += h.link_to('index', h.url_for(action='index',
title=None))
        return html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to