Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> Fixed login bug
  • Loading branch information
NaysKutzu committed Sep 24, 2023
1 parent 0a75cd0 commit 19e9d1a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 278 deletions.
5 changes: 4 additions & 1 deletion ConsoleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ public static void CheckInstall()
{
if (!File.Exists(Application.StartupPath+ @"\PteroConsole.exe"))
{
MessageBox.Show("Sorry but it looks like the app is missing");

} else
{

}
}
}
57 changes: 0 additions & 57 deletions Form1.Designer.cs

This file was deleted.

87 changes: 0 additions & 87 deletions Form1.cs

This file was deleted.

120 changes: 0 additions & 120 deletions Form1.resx

This file was deleted.

32 changes: 23 additions & 9 deletions FrmLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,27 @@ private void CheckSession()
try
{
var account = new ConfigParser(Program.AppAccountInfo);
string panelUrl = Decrypt(account.GetValue("LOGIN", "panel_url"));
string panelAPI = Decrypt(account.GetValue("LOGIN", "api_key"));
string panelPass = Decrypt(account.GetValue("LOGIN", "panel_pwd"));
txtpanelurl.Text = panelUrl;
txtpanelapikey.Text = panelAPI;
txtpanelpwd.Text = panelPass;
btnlogin.PerformClick();
var EpanelUrl = account.GetValue("LOGIN", "panel_url");
var EpanelApi = account.GetValue("LOGIN", "api_key");
var EpanelPass = account.GetValue("LOGIN", "panel_pwd");
if (EpanelApi == null || EpanelPass == null || EpanelApi == null)
{

}
else
{
string panelUrl = Decrypt(EpanelUrl);
string panelAPI = Decrypt(EpanelApi);
string panelPass = Decrypt(EpanelPass);
txtpanelurl.Text = panelUrl;
txtpanelapikey.Text = panelAPI;
txtpanelpwd.Text = panelPass;
btnlogin.PerformClick();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
MessageBox.Show("Failed to check for sessions: \n'" + ex.Message+"'");
}
}

Expand Down Expand Up @@ -118,6 +128,10 @@ private async void btnlogin_Click(object sender, EventArgs e)
{
string apiKey = txtpanelapikey.Text;
string panelUrl = txtpanelurl.Text;
if (txtpanelpwd.Text == "")
{
MessageBox.Show("You did not provide any password for the connection! The SFTP module will be disabled");
}
#pragma warning disable
if (!Uri.TryCreate(panelUrl, UriKind.Absolute, out Uri panelUri))
{
Expand All @@ -143,7 +157,7 @@ private async void btnlogin_Click(object sender, EventArgs e)
}
else
{
MessageBox.Show("Faild to get your data please check the panel url");
MessageBox.Show("Failed to get your data please check the panel url");
}
}
#pragma warning restore
Expand Down
2 changes: 1 addition & 1 deletion FrmServerSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private void serverListBox_SelectedIndexChanged(object sender, EventArgs e)
}
catch (Exception ex)
{
MessageBox.Show("We are sorry but we can't load the servers");
MessageBox.Show("We are sorry but we can't load the servers:\n"+ex.Message);
}
}
}
3 changes: 0 additions & 3 deletions PteroController.csproj.user
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Compile Update="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmLogin.cs">
<SubType>Form</SubType>
</Compile>
Expand Down

0 comments on commit 19e9d1a

Please sign in to comment.