From 5195b668cdf00c8ae03b182fde24e1ddaa082995 Mon Sep 17 00:00:00 2001
From: scientes <instigatorirc@gmail.com>
Date: Sun, 21 Dec 2008 07:45:30 -0800
Subject: [PATCH] if no auth file checks if that user has log in capabilities against pam on server machine
 requires gem at http://atlee.ca/software/pam/

---
 deluge/core/authmanager.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/deluge/core/authmanager.py b/deluge/core/authmanager.py
index 6b6347e..1b4eeb7 100644
--- a/deluge/core/authmanager.py
+++ b/deluge/core/authmanager.py
@@ -25,6 +25,7 @@
 import os.path
 import random
 import stat
+from pam import authenticate as pam_authenticate
 
 import deluge.component as component
 import deluge.configmanager as configmanager
@@ -58,7 +59,11 @@ class AuthManager(component.Component):
             # Let's try to re-load the file.. Maybe it's been updated
             self.__load_auth_file()
             if username not in self.auth:
-                return False
+                if username == os.getlogin():
+                    if pam_authenticate(os.getlogin(), password, service='login'):
+                        return True
+                else:
+                    return False
 
         if self.auth[username] == password:
             return True
-- 
1.5.6.3

