Skip to content

Commit

Permalink
Two-factor auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxx53 committed Dec 25, 2015
1 parent d54c671 commit 386bbc2
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 59 deletions.
65 changes: 47 additions & 18 deletions scr/SCMBot/Dialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions scr/SCMBot/Dialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ public string GuardDesc
set { guardBox.Text = value; }
}

public string capchaText
public string CapchaText
{
get { return capchaBox.Text; }
set { capchaBox.Text = value; }
}

public string TwoFactorCode
{
get { return factorTextBox.Text; }
set { factorTextBox.Text = value; }
}

public bool codgroupEnab
{
get { return codgroupBox.Enabled; }
Expand All @@ -36,7 +42,13 @@ public bool capchgroupEnab
set { capchgroupBox.Visible = value; }
}

public PictureBox capchImg
public bool factorgroupEnab
{
get { return twoFactorGroup.Enabled; }
set { twoFactorGroup.Visible = value; }
}

public PictureBox capchImg
{
get { return capchapicBox; }
set { capchapicBox = value; }
Expand Down
173 changes: 148 additions & 25 deletions scr/SCMBot/Dialog.resx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,78 @@
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>codgroupBox</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>codgroupBox</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;guardBox.Name" xml:space="preserve">
<value>guardBox</value>
</data>
<data name="&gt;&gt;guardBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;guardBox.Parent" xml:space="preserve">
<value>codgroupBox</value>
</data>
<data name="&gt;&gt;guardBox.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;mailcodeBox.Name" xml:space="preserve">
<value>mailcodeBox</value>
</data>
<data name="&gt;&gt;mailcodeBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;mailcodeBox.Parent" xml:space="preserve">
<value>codgroupBox</value>
</data>
<data name="&gt;&gt;mailcodeBox.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="codgroupBox.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 12</value>
</data>
<data name="codgroupBox.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 77</value>
</data>
<data name="codgroupBox.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="codgroupBox.Text" xml:space="preserve">
<value>Enter access code</value>
</data>
<data name="&gt;&gt;codgroupBox.Name" xml:space="preserve">
<value>codgroupBox</value>
</data>
<data name="&gt;&gt;codgroupBox.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;codgroupBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;codgroupBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
Expand Down Expand Up @@ -242,30 +314,6 @@
<data name="&gt;&gt;mailcodeBox.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="codgroupBox.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 12</value>
</data>
<data name="codgroupBox.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 77</value>
</data>
<data name="codgroupBox.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="codgroupBox.Text" xml:space="preserve">
<value>Enter access code</value>
</data>
<data name="&gt;&gt;codgroupBox.Name" xml:space="preserve">
<value>codgroupBox</value>
</data>
<data name="&gt;&gt;codgroupBox.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;codgroupBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;codgroupBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
Expand Down Expand Up @@ -359,6 +407,82 @@
<data name="&gt;&gt;capchgroupBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label5.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>7, 45</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>88, 13</value>
</data>
<data name="label5.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="label5.Text" xml:space="preserve">
<value>Mobile App Code</value>
</data>
<data name="&gt;&gt;label5.Name" xml:space="preserve">
<value>label5</value>
</data>
<data name="&gt;&gt;label5.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label5.Parent" xml:space="preserve">
<value>twoFactorGroup</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="factorTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>101, 42</value>
</data>
<data name="factorTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>118, 20</value>
</data>
<data name="factorTextBox.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;factorTextBox.Name" xml:space="preserve">
<value>factorTextBox</value>
</data>
<data name="&gt;&gt;factorTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;factorTextBox.Parent" xml:space="preserve">
<value>twoFactorGroup</value>
</data>
<data name="&gt;&gt;factorTextBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="twoFactorGroup.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 12</value>
</data>
<data name="twoFactorGroup.Size" type="System.Drawing.Size, System.Drawing">
<value>227, 93</value>
</data>
<data name="twoFactorGroup.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
</data>
<data name="twoFactorGroup.Text" xml:space="preserve">
<value>Two Factor Auth Required</value>
</data>
<data name="&gt;&gt;twoFactorGroup.Name" xml:space="preserve">
<value>twoFactorGroup</value>
</data>
<data name="&gt;&gt;twoFactorGroup.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;twoFactorGroup.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;twoFactorGroup.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand All @@ -368,7 +492,6 @@
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>252, 147</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
</data>
Expand Down
11 changes: 10 additions & 1 deletion scr/SCMBot/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -592,13 +592,22 @@ public void Event_Message(object sender, object data, int searchId, flag myflag,
AddtoLog(Strings.AlreadyLogged);
StatusLabel1.Text = Strings.AlreadyLogged;
GetAccInfo((StrParam)data);

if (relog)
scanItems.UpdateCock(steam_srch.cookieCont);
relog = false;

break;

case flag.Login_success:
relog = false;
AddtoLog(Strings.LoginSucc);
StatusLabel1.Text = Strings.LoginSucc;
GetAccInfo((StrParam)data);

if (relog)
scanItems.UpdateCock(steam_srch.cookieCont);
relog = false;

break;

case flag.Login_cancel:
Expand Down
Loading

0 comments on commit 386bbc2

Please sign in to comment.