Create a report of users last login

  1. In the SIL Manager create a new file called userLoginReport.sil
  2. 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;


  3. Save the file
  4. Create a new page for the user report
  5. Add the SIL Table macro to the page
  6. Edit the macro
  7. Enter userLastLogin.sil for the script setting
  8. Enter "Username, Last Login Date" for the columns setting
  9. Save the changes to the macro

You should now see a user login report when you view the page similar to the report below.