mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-03-13 08:00:15 +00:00
Better use of getent to extract user fullname.
This commit is contained in:
parent
34a82968a8
commit
026c719251
@ -67,7 +67,8 @@ function SQUID_PAM_check($username, $password ){
|
||||
}
|
||||
else {
|
||||
dbg_error_log( "PAM", "user %s doesn't exist in local DB, we need to create it",$username );
|
||||
$fullname = trim( exec("getent passwd | grep ^" . $username ." | cut -d \":\" -f5"), ' ,' );
|
||||
$fullname = exec('getent passwd "'.$username.'"' );
|
||||
$fullname = preg_replace( '{^[^:]+:[^:]+:\d+:\d+:([^:,]+)(,[^:]*):}', '$1', $fullname );
|
||||
$usr = (object) array(
|
||||
'user_no' => 0,
|
||||
'username' => $username,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user