Create a report of users last login
- In the SIL Manager create a new file called userLoginReport.sil
Paste the following code into the file:
struct login { string userName; date loginDate; } string sql = "SELECT cu.user_name, " + "li.successdate " + "FROM logininfo li " + "JOIN user_mapping um ON um.user_key = li.username " + "JOIN cwd_user cu ON um.username = cu.user_name " + "JOIN cwd_directory cd ON cu.directory_id = cd.id " + "ORDER BY successdate"; login [] logins = sql("confluence_DB", sql); return logins;
- Save the file
- Create a new page for the user report
- Add the SIL Table macro to the page
- Edit the macro
- Enter userLastLogin.sil for the script setting
- Enter "Username, Last Login Date" for the columns setting
- Save the changes to the macro
You should now see a user login report when you view the page similar to the report below.