owner = user, working now
This commit is contained in:
parent
cceb2cc7ee
commit
7ef66a0b3d
@ -16,7 +16,7 @@ public partial class AppController
|
|||||||
public static void NewEntrySave(string name, string usernameurl, string email, string password, string note)
|
public static void NewEntrySave(string name, string usernameurl, string email, string password, string note)
|
||||||
{
|
{
|
||||||
string hashedPassword = ShaHash.HashPassword(password);
|
string hashedPassword = ShaHash.HashPassword(password);
|
||||||
string ownerUsername = "user";
|
string ownerUsername = _currentUser;
|
||||||
SQLite.SaveEntry(name, hashedPassword, email, note, ownerUsername);
|
SQLite.SaveEntry(name, hashedPassword, email, note, ownerUsername);
|
||||||
//string name, string pass, string mailUsername, string? note, string ownerUsername
|
//string name, string pass, string mailUsername, string? note, string ownerUsername
|
||||||
}
|
}
|
||||||
@ -29,4 +29,14 @@ public partial class AppController
|
|||||||
var savedPassword = SQLite.GetLogin(Username);
|
var savedPassword = SQLite.GetLogin(Username);
|
||||||
return hashedPassword == savedPassword;
|
return hashedPassword == savedPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//the currently logged in user
|
||||||
|
private static string _currentUser;
|
||||||
|
|
||||||
|
public static void SetCurrentUser(string currentUser)
|
||||||
|
{
|
||||||
|
_currentUser = currentUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ public partial class LoginPage : UserControl
|
|||||||
if (allowLogin)
|
if (allowLogin)
|
||||||
{
|
{
|
||||||
//show menuview
|
//show menuview
|
||||||
|
AppController.SetCurrentUser(loginName);
|
||||||
newMenuView.Show();
|
newMenuView.Show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -14,6 +14,7 @@ public partial class NewLogin : Window
|
|||||||
public NewLogin()
|
public NewLogin()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
_controller = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
public NewLogin(AppController controller)
|
public NewLogin(AppController controller)
|
||||||
@ -31,6 +32,7 @@ public partial class NewLogin : Window
|
|||||||
bool masterLoginPasswordBool = InputSanitizer.MasterLoginPasswordBool(password);
|
bool masterLoginPasswordBool = InputSanitizer.MasterLoginPasswordBool(password);
|
||||||
bool masterLoginEmailBool = InputSanitizer.MasterLoginEmailBool(email);
|
bool masterLoginEmailBool = InputSanitizer.MasterLoginEmailBool(email);
|
||||||
bool masterLoginNameBool = InputSanitizer.MasterLoginNameBool(username);
|
bool masterLoginNameBool = InputSanitizer.MasterLoginNameBool(username);
|
||||||
|
|
||||||
//give strings to appcontroller and keep working on them there
|
//give strings to appcontroller and keep working on them there
|
||||||
if (masterLoginPasswordBool && masterLoginEmailBool && masterLoginNameBool)
|
if (masterLoginPasswordBool && masterLoginEmailBool && masterLoginNameBool)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user