1
##############################################################################
3
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE
13
##############################################################################
15
from zope.authentication.loginpassword import LoginPassword
16
from zope.component import adapts
17
from zope.publisher.interfaces.ftp import IFTPCredentials
20
class FTPAuth(LoginPassword):
21
"""ILoginPassword adapter for handling common FTP authentication."""
23
adapts(IFTPCredentials)
25
def __init__(self, request):
26
self.__request = request
27
lpw = request._authUserPW()
29
login, password = None, None
32
super(FTPAuth, self).__init__(login, password)
34
def needLogin(self, realm):
35
self.__request.unauthorized("Did not work")