public int ReportUserTotalPosts(string adminUsername, string adminPassword, string username)
{
try
{
log.Info("got request to report total posts of user " + username);
if (securityManager.AuthenticateAdmin(adminUsername, adminPassword) == Result.OK)
return dataManager.GetAllPosts().Where(post => post.Key.Username.Equals(username)).Count();
return -1;
}
catch (Exception e)
{
log.Error("failed to report total posts of user " + username, e);
throw e;
}
}