This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Save the last login in object
#3
(29.04.2022, 11:15)admin Wrote: Create a scheduled script that runs as often as you want this data to be updated. Object type should be 250 byte string. Users are referenced by their login.

Code:
items = db:getall([[
  SELECT login, MAX(created) accessed
  FROM user_logs
  WHERE failed IS NULL or failed=0
  GROUP BY login
]])

logs = {}

for _, item in ipairs(items) do
  logs[ item.login ] = os.date('%c', item.accessed)
end

grp.checkupdate('1/1/1', logs.admin)
grp.checkupdate('1/1/2', logs.some_other_user)
grp.checkupdate('1/1/3', logs.another_user)
Your support is just amazing guys, 

THANKS A MILLION  Big Grin
Reply


Messages In This Thread
Save the last login in object - by Fahd - 28.04.2022, 08:37
RE: Save the last login in object - by admin - 29.04.2022, 11:15
RE: Save the last login in object - by Fahd - 29.04.2022, 12:24

Forum Jump: