mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-03-13 08:00:15 +00:00
Decruftify, and allow the squid pam to use 'path' instead of 'script' in it's config.
This commit is contained in:
parent
d78620398c
commit
7e0b88ed77
@ -25,15 +25,6 @@ class pwauthPamDrivers
|
||||
/**#@-*/
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param string $config path where pwauth is
|
||||
*/
|
||||
function pwauthPamDrivers($config){
|
||||
$this->__construct($config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*
|
||||
|
||||
@ -22,22 +22,12 @@ class squidPamDrivers
|
||||
/**#@-*/
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param string $config path where /usr/lib/squid/pam_auth is
|
||||
*/
|
||||
function squidPamDrivers($config){
|
||||
$this->__construct($config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*
|
||||
* @param string $config path where /usr/lib/squid/pam_auth is
|
||||
*/
|
||||
function __construct($config)
|
||||
{
|
||||
function __construct($config) {
|
||||
global $c;
|
||||
if (! file_exists($config)){
|
||||
$c->messages[] = sprintf(i18n( 'drivers_squid_pam : Unable to find %s file'), $config );
|
||||
@ -54,8 +44,10 @@ class squidPamDrivers
|
||||
function SQUID_PAM_check($username, $password ){
|
||||
global $c;
|
||||
|
||||
$script = $c->authenticate_hook['config']['script'];
|
||||
if ( empty($script) ) $script = $c->authenticate_hook['config']['path'];
|
||||
$cmd = sprintf( 'echo %s %s | %s -n common-auth', escapeshellarg($username), escapeshellarg($password),
|
||||
$c->authenticate_hook['config']['script']);
|
||||
$script);
|
||||
$auth_result = exec($cmd);
|
||||
if ( $auth_result == "OK") {
|
||||
dbg_error_log('pwauth', 'User %s successfully authenticated', $username);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user