From fc26441d78582cfb3bb23dd2f37f058a7788962b Mon Sep 17 00:00:00 2001 From: makkalot Date: Mon, 4 Aug 2008 23:10:56 +0300 Subject: i dont want to install everytime funcweb when work on it --- funcweb/funcweb/identity/pam.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'funcweb') 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 -- cgit