Esempio n. 1
0
        public void Auth(
            string user,
            string pass
            )
        {
            string passhash = SHA512String(user + pass);

            sql(SPrintF.sprintf("set @auth='%s';", passhash));

            if (checkAuth() == false)
            {
                throw new AuthenticationException(SPrintF.sprintf("Unable to authenticate user %s.", user));
            }
            else
            {
                Log.FormatWarn("Sucessfully Authenticated as %s!", user);
            }
        }
Esempio n. 2
0
        public static DataHandle getHandle(string connect_string)
        {
            if (DH_cache.ContainsKey(connect_string))
            {
                return(DH_cache[connect_string]);
            }

            DataHandle self = new DataHandle();

            self.auth = false;

            self.DBH = new MySqlConnection(connect_string);
            self.DBH.Open();
            self.sql(SPrintF.sprintf("set @auth='%s';", "unset"));
            Log.Debug("Dataserver connection sucessful");
            //do other stuff maybe?

            return(self);
        }
Esempio n. 3
0
 public static void FormatFatal(string format, params Object[] args)
 {
     instance.Fatal(SPrintF.sprintf(format, args));
 }
Esempio n. 4
0
 public static void FormatError(string format, params Object[] args)
 {
     instance.Error(SPrintF.sprintf(format, args));
 }
Esempio n. 5
0
 public static void FormatDebug(string format, params Object[] args)
 {
     instance.Debug(SPrintF.sprintf(format, args));
 }
Esempio n. 6
0
 public static void FormatTrace(string format, params Object[] args)
 {
     instance.Trace(SPrintF.sprintf(format, args));
 }