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); } }
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); }
public static void FormatFatal(string format, params Object[] args) { instance.Fatal(SPrintF.sprintf(format, args)); }
public static void FormatError(string format, params Object[] args) { instance.Error(SPrintF.sprintf(format, args)); }
public static void FormatDebug(string format, params Object[] args) { instance.Debug(SPrintF.sprintf(format, args)); }
public static void FormatTrace(string format, params Object[] args) { instance.Trace(SPrintF.sprintf(format, args)); }