Beispiel #1
0
 static internal bool CheckPasswordMatch(UserDataFetcher UDF, string password)
 {
     if (UDF.IsCorrectPassword(password))
     {
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 static public bool CheckEmailNotTaken(UserDataFetcher UDF, System.Net.Mail.MailAddress mail)
 {
     if (UDF.IsEmailTaken(mail))
     {
         return(false);
     }
     return(true);
 }
Beispiel #3
0
 static public bool CheckUsernameNotTaken(UserDataFetcher UDF, string username)
 {
     if (UDF.IsUsernameTaken(username))
     {
         return(false);
     }
     return(true);
 }
Beispiel #4
0
        static internal void UpdateUserSession(UserDataFetcher UDF, long unix, string hashedUnix)
        {
            int userId = UDF.GetId();

            if (!InputValidator.ValidateId(userId))
            {
                throw new Exception();  //#change to exception invalid user //default
            }
            staticSource.Update(MysqlHandler.tblUsers +
                                $" SET lastActivity = '{unix}', loggedInHash = '{hashedUnix}'" +
                                $" WHERE ID = '{userId}'");
        }