[Zope] DTML Doc : publishing problem

Aseem Mohanty aseem@neurobehavioralsystems.com
Tue, 04 Jun 2002 23:59:42 -0700


Hi all,

I have the following function:

user_login__roles__ = None
    def user_login (Self, REQUEST, RESPONSE, username, password):
        # Create authorization variable
        login_goto_path = "/members"
        login_failure = "/failed"
        ac = encodestring('%s:%s' % (username, password))
        auth = 'Basic %s' % ac
        user = Self.validate(REQUEST, auth)
        if user:
            return RESPONSE.redirect(login_goto_path)
        else:
            return RESPONSE.redirect(login_failure)

and when I call it in a form in a DTML document this is the error I get:

Debugging Notice

Zope has encountered a problem publishing your object.

The object at http://kandinsky:8080/test_folder/acl_users/user_login has 
an empty or missing docstring. Objects must have a docstring to be 
published.

I have a similar function for logout :

user_logout__roles__ = ['MySQLUserRole']
    def user_logout (Self, REQUEST,RESPONSE):
        realm=RESPONSE.realm
      
        RESPONSE.expireCookie('_NBS_Login',path='/')
        RESPONSE.setCookie('_NBS_Logout',1,path='/')

        RESPONSE.setStatus(401)
        RESPONSE.setHeader('WWW-Authenticate', 'basic realm="%s"' % 
realm, 1)
        RESPONSE.setBody("""<html><meta http-equiv="refresh"
            content="0; URL=/test_folder/logged_out">
            <head><title>Logout</title></head>
            <body><p>Logging you out.</p>
            </body></html>""")
       
        return

which I call in a similar fashion and which works fine (logs user out 
and redirect because of the http-redirect).

Where am I going wrong.

TIA.
AM


-- 
==================================================================
 Aseem Mohanty							   
 Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 
 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231		  	
==================================================================								  	
 "I saw `cout' being shifted "Hello world" times to the left and  
  stopped right there!!"                        -- Steve Gonedes  
==================================================================