Daniel Poelzleithner avatar Daniel Poelzleithner committed b28f73f

only log last login if enabled in config

this was requested by review, because it's a sensitive information

Comments (0)

Files changed (2)

app/main/index/_action/login.lua

 
 if member then
   app.session.member = member
-  db:query{ "UPDATE member SET last_login = now() WHERE id = ?", member.id }
+  if config.log_last_login then
+    db:query{ "UPDATE member SET last_login = now() WHERE id = ?", member.id }
+  end
   app.session:save()
   slot.select("notice", function()
     ui.tag{ content = _'Login successful!' }

config/default.lua

 
 config.feature_rss_enabled = false -- feature is broken
 
+config.log_last_login = false -- log the last login time
+
 -- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED!
 config.auth_openid_enabled = false
 config.auth_openid_https_as_default = true
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.