[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/Authentication - DictionaryAuthentication.py:1.1.2.3 IAuthentication.py:1.1.2.4 IUser.py:1.1.2.2 SimpleUser.py:1.1.2.2 UnixAuthentication.py:1.1.2.2 __init__.py:1.1.2.2

Shane Hathaway shane@cvs.zope.org
Thu, 4 Apr 2002 13:46:25 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Server/Authentication
In directory cvs.zope.org:/tmp/cvs-serv17993/Authentication

Modified Files:
      Tag: Zope3-Server-Branch
	DictionaryAuthentication.py IAuthentication.py IUser.py 
	SimpleUser.py UnixAuthentication.py __init__.py 
Log Message:
Just fixed line endings.  No carriage returns.


=== Zope3/lib/python/Zope/Server/Authentication/DictionaryAuthentication.py 1.1.2.2 => 1.1.2.3 ===
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-# 
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-# 
-##############################################################################
-"""
-
-$Id$
-"""
-
-from IAuthentication import IAuthentication
-
-
-class DictionaryAuthentication:
-    """ """
-
-    __implements__ = IAuthentication
-
-
-    def __init__(self, user_dict):
-        self.user_dict = user_dict
-
-    ############################################################
-    # Implementation methods for interface
-    # Zope.Server.Authentication.IAuthentication.
-
-    def authenticate(self, username, password):
-        'See Zope.Server.Authentication.IAuthentication.IAuthentication'
-
-        if username not in self.user_dict.keys():
-            return 0, 'No such user.'
-        elif password == self.user_dict[username]:
-            return 1, 'Login successful.'
-        else:
-            return 0, 'Password invalid.'
-
-    #
-    ############################################################
-
-
-    def __repr__ (self):
-        return '<standard dictionary authorizer>'
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+
+from IAuthentication import IAuthentication
+
+
+class DictionaryAuthentication:
+    """ """
+
+    __implements__ = IAuthentication
+
+
+    def __init__(self, user_dict):
+        self.user_dict = user_dict
+
+    ############################################################
+    # Implementation methods for interface
+    # Zope.Server.Authentication.IAuthentication.
+
+    def authenticate(self, username, password):
+        'See Zope.Server.Authentication.IAuthentication.IAuthentication'
+
+        if username not in self.user_dict.keys():
+            return 0, 'No such user.'
+        elif password == self.user_dict[username]:
+            return 1, 'Login successful.'
+        else:
+            return 0, 'Password invalid.'
+
+    #
+    ############################################################
+
+
+    def __repr__ (self):
+        return '<standard dictionary authorizer>'


=== Zope3/lib/python/Zope/Server/Authentication/IAuthentication.py 1.1.2.3 => 1.1.2.4 ===
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-# 
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-# 
-##############################################################################
-"""
-
-$Id$
-"""
-
-
-from Interface import Interface
-from Interface.Attribute import Attribute
-
-class IAuthentication(Interface):
-    """Authentica
-    """
-
-    def authenticate(username, password):
-        """
-        """
-
-        return Boolean, str("Message")
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+
+
+from Interface import Interface
+from Interface.Attribute import Attribute
+
+class IAuthentication(Interface):
+    """Authentica
+    """
+
+    def authenticate(username, password):
+        """
+        """
+
+        return Boolean, str("Message")


=== Zope3/lib/python/Zope/Server/Authentication/IUser.py 1.1.2.1 => 1.1.2.2 ===
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-# 
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-# 
-##############################################################################
-"""
-
-$Id$
-"""
-
-
-from Interface import Interface
-from Interface.Attribute import Attribute
-
-class IUser(Interface):
-    """In order to have a uniform return type in the authentication model,
-       a simple user is defined.
-
-       Note: This user can become very complex, supporting groups, permissions,
-       a personal data storage and so on.
-    """
-
-    username = Attribute("The username of the user")
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+
+
+from Interface import Interface
+from Interface.Attribute import Attribute
+
+class IUser(Interface):
+    """In order to have a uniform return type in the authentication model,
+       a simple user is defined.
+
+       Note: This user can become very complex, supporting groups, permissions,
+       a personal data storage and so on.
+    """
+
+    username = Attribute("The username of the user")


=== Zope3/lib/python/Zope/Server/Authentication/SimpleUser.py 1.1.2.1 => 1.1.2.2 ===
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-# 
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-# 
-##############################################################################
-"""
-
-$Id$
-"""
-
-from IUser import IUser
-
-
-class SimpleUser:
-    """A simple user implementation."""
-
-    __implements__ = IUser
-
-    username = None
-
-    def __init__(self, username):
-
-        self.username = username
-
-
-
-AnonymousUser = SimpleUser('anonymous')
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+
+from IUser import IUser
+
+
+class SimpleUser:
+    """A simple user implementation."""
+
+    __implements__ = IUser
+
+    username = None
+
+    def __init__(self, username):
+
+        self.username = username
+
+
+
+AnonymousUser = SimpleUser('anonymous')


=== Zope3/lib/python/Zope/Server/Authentication/UnixAuthentication.py 1.1.2.1 => 1.1.2.2 ===
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-# 
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-# 
-##############################################################################
-"""
-
-$Id$
-"""
-import crypt
-import pwd
-
-from IAuthentication import IAuthentication
-
-
-class UnixAuthentication:
-    """ """
-
-    __implements__ = IAuthentication
-
-
-    ############################################################
-    # Implementation methods for interface
-    # Zope.Server.Authentication.IAuthentication.
-
-    def authenticate(self, username, password):
-        'See Zope.Server.Authentication.IAuthentication.IAuthentication'
-        try:
-            info = pwd.getpwnam(username)
-        except KeyError:
-            return 0, 'No such user.'
-
-        mangled = info[1]
-
-        print mangled
-        print password
-        print crypt.crypt(password, mangled[:2])
-        
-        if crypt.crypt(password, mangled[:2]) == mangled:
-            return 1, 'Login successful.'
-        else:
-            return 0, 'Password invalid.'                
-
-    #
-    ############################################################
-
-
-    def __repr__ (self):
-        return '<standard unix authorizer>'
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+import crypt
+import pwd
+
+from IAuthentication import IAuthentication
+
+
+class UnixAuthentication:
+    """ """
+
+    __implements__ = IAuthentication
+
+
+    ############################################################
+    # Implementation methods for interface
+    # Zope.Server.Authentication.IAuthentication.
+
+    def authenticate(self, username, password):
+        'See Zope.Server.Authentication.IAuthentication.IAuthentication'
+        try:
+            info = pwd.getpwnam(username)
+        except KeyError:
+            return 0, 'No such user.'
+
+        mangled = info[1]
+
+        print mangled
+        print password
+        print crypt.crypt(password, mangled[:2])
+
+        if crypt.crypt(password, mangled[:2]) == mangled:
+            return 1, 'Login successful.'
+        else:
+            return 0, 'Password invalid.'
+
+    #
+    ############################################################
+
+
+    def __repr__ (self):
+        return '<standard unix authorizer>'


=== Zope3/lib/python/Zope/Server/Authentication/__init__.py 1.1.2.1 => 1.1.2.2 ===
-#
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
-# All Rights Reserved.
-# 
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-# 
-##############################################################################
-"""
-
-$Id$
-"""
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""