summaryrefslogtreecommitdiffstats
path: root/funcweb
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-08-04 23:10:56 +0300
committermakkalot <makkalot@gmail.com>2008-08-04 23:10:56 +0300
commitfc26441d78582cfb3bb23dd2f37f058a7788962b (patch)
tree5f9c99b402220a98aa05b23b295460d243d4da4c /funcweb
parent8c3b84ba9794a0088d0d89e45b8cd8df0ebdea5e (diff)
downloadfunc-fc26441d78582cfb3bb23dd2f37f058a7788962b.tar.gz
func-fc26441d78582cfb3bb23dd2f37f058a7788962b.tar.xz
func-fc26441d78582cfb3bb23dd2f37f058a7788962b.zip
i dont want to install everytime funcweb when work on it
Diffstat (limited to 'funcweb')
-rw-r--r--funcweb/funcweb/identity/pam.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/funcweb/funcweb/identity/pam.py b/funcweb/funcweb/identity/pam.py
index 503ba0b..0e45353 100644
--- a/funcweb/funcweb/identity/pam.py
+++ b/funcweb/funcweb/identity/pam.py
@@ -14,6 +14,8 @@ __all__ = ['authenticate']
from ctypes import CDLL, POINTER, Structure, CFUNCTYPE, cast, pointer, sizeof
from ctypes import c_void_p, c_uint, c_char_p, c_char, c_int
+#funcweb specific part
+from funcweb.commands import PRODUCTION_ENV
LIBPAM = CDLL("libpam.so.0")
LIBC = CDLL("libc.so.6")
@@ -82,7 +84,7 @@ PAM_AUTHENTICATE = LIBPAM.pam_authenticate
PAM_AUTHENTICATE.restype = c_int
PAM_AUTHENTICATE.argtypes = [PamHandle, c_int]
-def authenticate(username, password, service='funcweb'):
+def authenticate(username, password, service=None):
"""Returns True if the given username and password authenticate for the
given service. Returns False otherwise
@@ -92,6 +94,13 @@ def authenticate(username, password, service='funcweb'):
``service``: the PAM service to authenticate against.
Defaults to 'login'"""
+ #we make that control because we dont want to install ti everytime on system
+ #while working on funcweb ...
+ if PRODUCTION_ENV:
+ service = "funcweb"
+ else:
+ service = "login"
+
@CONV_FUNC
def my_conv(n_messages, messages, p_response, app_data):
"""Simple conversation function that responds to any