diff options
Diffstat (limited to 'modules-available/dozmod/pages/users.inc.php')
-rw-r--r-- | modules-available/dozmod/pages/users.inc.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules-available/dozmod/pages/users.inc.php b/modules-available/dozmod/pages/users.inc.php index 50f0f763..fe00a71b 100644 --- a/modules-available/dozmod/pages/users.inc.php +++ b/modules-available/dozmod/pages/users.inc.php @@ -42,7 +42,7 @@ class SubPage . ' LEFT JOIN sat.organization USING (organizationid)' . ' ORDER BY lastname ASC, firstname ASC'); $rows = array(); - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + foreach ($res as $row) { settype($row['lastlogin'], 'int'); $row['canlogin'] = self::checked($row['canlogin']); $row['issuperuser'] = self::checked($row['issuperuser']); @@ -63,14 +63,14 @@ class SubPage $res = Database::simpleQuery('SELECT organizationid, displayname, canlogin FROM sat.organization' . ' ORDER BY displayname ASC'); $rows = array(); - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - $row['canlogin'] = self::checked($row['canlogin']); + foreach ($res as $row) { + $row['canlogin'] = self::checked((bool)$row['canlogin']); $rows[] = $row; } Render::addTemplate('orglist', array('organizations' => $rows)); } - private static function checked($val) + private static function checked(bool $val): string { if ($val) return 'checked="checked"'; |