add columns for hidden and disabled

This commit is contained in:
Uwe Steinmann 2020-08-27 08:52:35 +02:00
parent 76ed086f5d
commit fc2682f5de

View File

@ -33,12 +33,12 @@ class SeedDMS_Controller_UserListCsv extends SeedDMS_Controller_Common {
$m = max($m, count($u->getGroups()));
}
$fp = fopen("php://temp/maxmemory", 'r+');
$header = array('login', 'passenc', 'name', 'email', 'comment', 'role', 'quota', 'homefolder');
$header = array('login', 'passenc', 'name', 'email', 'comment', 'role', 'quota', 'homefolder', 'hidden', 'disabled');
for($i=1; $i<=$m; $i++)
$header[] = 'group_'.$i;
fputcsv($fp, $header, ';');
foreach($allUsers as $u) {
$data = array($u->getLogin(), $u->getPwd(), $u->getFullName(), $u->getEmail(), $u->getComment(), $u->isAdmin() ? 'admin' : ($u->isGuest() ? 'guest' : 'user'), $u->getQuota(), $u->getHomeFolder() ? $u->getHomeFolder() : '');
$data = array($u->getLogin(), $u->getPwd(), $u->getFullName(), $u->getEmail(), $u->getComment(), $u->isAdmin() ? 'admin' : ($u->isGuest() ? 'guest' : 'user'), $u->getQuota(), $u->getHomeFolder() ? $u->getHomeFolder() : '', $u->isHidden() ? '1' : 0, $u->isDisabled() ? '1' : '0');
foreach($u->getGroups() as $g)
$data[] = $g->getName();
fputcsv($fp, $data, ';');