public static bool check(string user, string passwd) { user = user.ToLower(); User user1 = UserDb.lookup(user); return(user1 != null && (user1.passwd == passwd || user == "anonymous" || (SimpleHash.test_hash(passwd, user1.passwd) || UserDb.digest_passwd(user, passwd) == user1.passwd) || UserDb.decode_passwd(user, user1.passwd) == passwd)); }
public static string get_pass(string user) { User user1 = UserDb.lookup(user); return(user1 == null ? "" : UserDb.decode_passwd(user, user1.passwd)); }