Browse Source

Use api function for limit.

Fix #459
nwp90-nwp90-allsessionsreport
Dan Marsden 4 years ago
parent
commit
542819a17f
  1. 4
      attendance.php

4
attendance.php

@ -59,8 +59,8 @@ if ($attforsession->rotateqrcode == 1) {
} else { } else {
// Check password. // Check password.
$sql = 'SELECT * FROM {attendance_rotate_passwords}'. $sql = 'SELECT * FROM {attendance_rotate_passwords}'.
' WHERE attendanceid = ? AND expirytime > ? ORDER BY expirytime ASC LIMIT 2'; ' WHERE attendanceid = ? AND expirytime > ? ORDER BY expirytime ASC';
$qrpassdatabase = $DB->get_records_sql($sql, ['attendanceid' => $id, time() - $attconfig->rotateqrcodeexpirymargin]); $qrpassdatabase = $DB->get_records_sql($sql, ['attendanceid' => $id, time() - $attconfig->rotateqrcodeexpirymargin], 0, 2);
foreach ($qrpassdatabase as $qrpasselement) { foreach ($qrpassdatabase as $qrpasselement) {
if ($qrpass == $qrpasselement->password) { if ($qrpass == $qrpasselement->password) {

Loading…
Cancel
Save