ayenz / Sharif-Judge

A free and open source online judge system for programming courses
https://github.com/mjnaderi/Sharif-Judge/tree/docs
GNU General Public License v3.0
1 stars 2 forks source link

1 Akun hanya dapat login satu waktu #1

Closed ayenz closed 6 years ago

ayenz commented 6 years ago

Jika suatu akun sedang login, tidak ada lagi yang bisa login akun tersebut

pascalalfadian commented 6 years ago

Untuk langkah awal:

  1. Buat tabel shj_logins, isinya login_id (int autoincrement), timestamp, username, ip_address varchar, last_24h_login_id
  2. Untuk setiap login yang sukses:
    • Bersihkan shj_logins yang timestamp nya lebih dari 30x24 jam.
    • Cari entri login terakhir untuk username ini yang IP address nya tidak sama.
    • Tambahkan entri baru, dengan last_24h_login_id diisi dengan login_id jika timestamp pada langkah sebelumnya < 24 jam.
  3. Buat halaman baru dan tabel dari login ini.
pascalalfadian commented 6 years ago

Based from last commit cd32ffa5509e0359b226f4a9a6270e92528b8ccf:

Use this table to detect account lendings between students in a pre-seated exam environment. In a pre-seated environment, student should have logged in from only one IP address within the exam time period. Whenever a user logs in from different IP address in the past 24 hours, last column of this table will show link to the previous login that happened. In such case, proctor can analyse from those two logins, whether the same login has been used in different devices (meaning the account had been lent).

ayenz commented 6 years ago

Commited cd32ffa & Done :thumbsup: