Example #1
0
        /// <summary>
        /// Gets all login records within a time range, ordered by Date descending.  Session must have admin privilege.
        /// </summary>
        /// <returns></returns>
        public ActionResult GetLoginRecordsGlobal()
        {
            if (!session.IsAdminValid)
            {
                return(ApiError("Not Authorized"));
            }

            LoginRecordsGlobalRequest request = ApiRequestBase.ParseRequest <LoginRecordsGlobalRequest>(this);

            using (GlobalDb db = new GlobalDb())
                return(Json(new LoginRecordsResponse()
                {
                    records = db.GetLoginRecordsGlobal(request.startDate, request.endDate)
                }));
        }