Esempio n. 1
0
        public void SetAuthorizationAsInvalid(Guid authCode)
        {
            var auth = AuthorizationLog.FindByAuthCode(authCode + "");

            if (auth != null)
            {
                auth.IsValid = false;
                auth.Save();
            }
        }
Esempio n. 2
0
        public void UpdateAuthorization(Guid authCode, DateTime expires, String lastIp)
        {
            var auth = AuthorizationLog.FindByAuthCode(authCode + "");

            if (auth != null)
            {
                auth.Expires = expires;
                auth.LastIp  = lastIp;
                auth.Save();
            }
        }
Esempio n. 3
0
        public Token GetToken(Guid authCode)
        {
            var auth = AuthorizationLog.FindByAuthCode(authCode + "");

            if (auth == null)
            {
                return(null);
            }

            var user = auth.User;

            return(new Token(auth.AuthCode, auth.UserID, user.Name, user.NickName, user.IsAdmin, auth.Expires)
            {
                LastIp = auth.LastIp
            });
        }