output real names in libnss-extrausers passwd file, fixes #659
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -24,7 +24,7 @@ class Extrausers
|
|||||||
{
|
{
|
||||||
// passwd
|
// passwd
|
||||||
$passwd = '/var/lib/extrausers/passwd';
|
$passwd = '/var/lib/extrausers/passwd';
|
||||||
$sql = "SELECT username,'x' as password,uid,gid,'Froxlor User' as comment,homedir,shell, login_enabled FROM ftp_users ORDER BY uid ASC";
|
$sql = "SELECT customerid,username,'x' as password,uid,gid,'Froxlor User' as comment,homedir,shell, login_enabled FROM ftp_users ORDER BY uid ASC";
|
||||||
self::generateFile($passwd, $sql, $cronlog);
|
self::generateFile($passwd, $sql, $cronlog);
|
||||||
|
|
||||||
// group
|
// group
|
||||||
@@ -61,6 +61,13 @@ class Extrausers
|
|||||||
while ($u = $data_sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
while ($u = $data_sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'passwd':
|
case 'passwd':
|
||||||
|
// get user real name
|
||||||
|
$salutation_array = array(
|
||||||
|
'firstname' => \Froxlor\Customer\Customer::getCustomerDetail($u['customerid'], 'firstname'),
|
||||||
|
'name' => \Froxlor\Customer\Customer::getCustomerDetail($u['customerid'], 'name'),
|
||||||
|
'company' => \Froxlor\Customer\Customer::getCustomerDetail($u['customerid'], 'company')
|
||||||
|
);
|
||||||
|
$u['comment'] = \Froxlor\User::getCorrectUserSalutation($salutation_array);
|
||||||
if ($u['login_enabled'] != 'Y') {
|
if ($u['login_enabled'] != 'Y') {
|
||||||
$u['password'] = '*';
|
$u['password'] = '*';
|
||||||
$u['shell'] = '/bin/false';
|
$u['shell'] = '/bin/false';
|
||||||
|
|||||||
Reference in New Issue
Block a user