mirror of
https://github.com/islehorse/HISP.git
synced 2025-06-06 11:01:27 +12:00
Add VSIX Installer project
This commit is contained in:
parent
567b848eea
commit
6891561263
37 changed files with 2517 additions and 859 deletions
|
@ -73,7 +73,7 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows|ARM'">
|
||||
<RuntimeIdentifier>win-arm</RuntimeIdentifier>
|
||||
<Optimize>true</Optimize>
|
||||
<PlatformTarget>ARM32</PlatformTarget>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<DefineConstants>OS_WINDOWS;ARCH_ARM</DefineConstants>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
|
@ -90,7 +90,7 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Android|ARM'">
|
||||
<RuntimeIdentifier>android-arm</RuntimeIdentifier>
|
||||
<Optimize>true</Optimize>
|
||||
<PlatformTarget>ARM32</PlatformTarget>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<DefineConstants>OS_ANDROID;ARCH_ARM</DefineConstants>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<NoWarn>1701;1702;2026</NoWarn>
|
||||
|
@ -156,7 +156,7 @@
|
|||
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<PlatformTarget>ARM32</PlatformTarget>
|
||||
<PlatformTarget>ARM</PlatformTarget>
|
||||
<Optimize>False</Optimize>
|
||||
<DefineConstants>DEBUG;TRACE;OS_DEBUG;ARCH_ARM</DefineConstants>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
|
|
|
@ -48,10 +48,10 @@ namespace HISP.Server
|
|||
|
||||
public static void OpenDatabase()
|
||||
{
|
||||
if (!ConfigReader.SqlLite)
|
||||
ConnectionString = "server=" + ConfigReader.DatabaseIP + ";user=" + ConfigReader.DatabaseUsername + ";password=" + ConfigReader.DatabasePassword + ";database=" + ConfigReader.DatabaseName;
|
||||
else
|
||||
ConnectionString = "Data Source=./" + ConfigReader.DatabaseName + ".db;";
|
||||
if (!ConfigReader.SqlLite)
|
||||
ConnectionString = "server=" + ConfigReader.DatabaseIP + ";user=" + ConfigReader.DatabaseUsername + ";password=" + ConfigReader.DatabasePassword + ";database=" + ConfigReader.DatabaseName;
|
||||
else
|
||||
ConnectionString = "Data Source=\"" + ConfigReader.DatabaseName + ".db\";";
|
||||
|
||||
Logger.InfoPrint(ConnectionString);
|
||||
|
||||
|
@ -6146,6 +6146,26 @@ namespace HISP.Server
|
|||
}
|
||||
}
|
||||
}
|
||||
public static void SetPasswordHash(string username, string passhash)
|
||||
{
|
||||
using (DbConnection db = connectDb())
|
||||
{
|
||||
db.Open();
|
||||
if (CheckUserExist(username))
|
||||
{
|
||||
DbCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Users SET PassHash=@hash WHERE Username=@name";
|
||||
addWithValue(sqlCommand, "@hash", passhash);
|
||||
addWithValue(sqlCommand, "@name", username);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new KeyNotFoundException("Username " + username + " not found in database.");
|
||||
}
|
||||
}
|
||||
}
|
||||
public static byte[] GetPasswordHash(string username)
|
||||
{
|
||||
using (DbConnection db = connectDb())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue