Skip to content

Commit

Permalink
more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasbaur committed Oct 9, 2024
1 parent 9693a76 commit 5d4704c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Database/DatabaseAdminDBMeta.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public DatabaseAdminDBMeta(ref DatabaseDBMeta db)
}

catch(Exception ex) {
Console.Write(ex.Message);
Console.Write("Internal: " + ex.Message);

}

Expand Down
5 changes: 4 additions & 1 deletion Database/DatabaseAdminManageDBWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ private void AddDB_Click(object sender, RoutedEventArgs e)
MessageBox.Show("Only Server Admins can use this feature");
return;
}


MessageBox.Show("Checked auth");
DatabaseDBMeta meta = new DatabaseDBMeta();
DatabaseAdminDBMeta dialog = new DatabaseAdminDBMeta(ref meta);
dialog.ShowDialog();
Expand All @@ -184,7 +187,7 @@ private void AddDB_Click(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
MessageBox.Show("Menu: " + ex.Message);
}
}

Expand Down
6 changes: 4 additions & 2 deletions Database/DatabaseHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ static public int CheckAuthentication(string user, string db)
int auth = 0;
try
{

var adminDB = client.GetDatabase("admin");
var cmd = new BsonDocument("usersInfo", user);
var queryResult = adminDB.RunCommand<BsonDocument>(cmd);
Expand All @@ -299,8 +300,9 @@ static public int CheckAuthentication(string user, string db)
else if ((roles[i]["role"].ToString() == "readAnyDatabase") && auth <= 1) { auth = 1; }
}
}
catch
{ }
catch (Exception e)
{ MessageBox.Show("Auth check: " + e.Message);
}

return auth;
}
Expand Down
Binary file modified bin/nova.exe
Binary file not shown.

0 comments on commit 5d4704c

Please sign in to comment.