accountmanagementengine

accountmanagementengine Commit Details


Date:2013-01-29 21:26:00 (11 years 10 months ago)
Author:Natalie Adams
Branch:default
Commit:f4922397f624
Parents: 0d1994274e3e
Message:Adding support to ignore SSL certificate trusted issues (this is NOT the default)

Changes:
MAccountManagementEngine/AccountManagementEngine.cs (3 diffs)
MAccountManagementEngine/Engines/FacebookEngine.cs (1 diff)
MAccountManagementEngine/Engines/SMFEngine.cs (1 diff)
MAccountManagementEngine/Engines/TwitterEngine.cs (1 diff)

File differences

AccountManagementEngine/AccountManagementEngine.cs
55
66
77
8
89
910
1011
......
1920
2021
2122
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
2341
2442
2543
......
3149
3250
3351
34
52
3553
3654
37
55
3856
3957
4058
using System.Net;
using System.Text.RegularExpressions;
using AccountManagement.Engines;
using System.Net.Security;
namespace AccountManagement
{
public class AccountManagementEngine : IDisposable
{
public Dictionary<string, string> options = new Dictionary<string,string>();
// This is an option of do-what-I-say-I-know-what-I'm-doing
public static void ignoreSSL()
{
try
{
//Change SSL checks so that all checks pass
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback(
delegate
{ return true; }
);
}
catch (Exception)
{
}
}
public void AddData(string key, string val)
{
this.options[key] = val;
switch (engine)
{
case Engine.FACEBOOK:
eng = new FacebookEngine();
eng = new FacebookEngine(options);
break;
case Engine.TWITTER:
eng = new TwitterEngine();
eng = new TwitterEngine(options);
break;
case Engine.SMF:
// Options:
AccountManagementEngine/Engines/FacebookEngine.cs
99
1010
1111
12
13
14
15
16
17
18
19
1220
1321
1422
internal class FacebookEngine : IEngine, IDisposable
{
private WebEngine web;
public FacebookEngine(Dictionary<string, string> options)
{
//We don't need to store the options
if (options.Keys.Contains("ignoressl") && options["ignoressl"] == "true")
{
AccountManagementEngine.ignoreSSL();
}
}
public bool ChangePassword(string username, string oldpass, string newpass)
{
web = new WebEngine("Nokia 7110/1.0");
AccountManagementEngine/Engines/SMFEngine.cs
1414
1515
1616
17
18
19
20
21
1722
1823
1924
{
this.web = new WebEngine();
this.options = options;
if (options.Keys.Contains("ignoressl") && options["ignoressl"] == "true")
{
AccountManagementEngine.ignoreSSL();
}
}
public bool ChangePassword(string username, string oldpass, string newpass)
{
AccountManagementEngine/Engines/TwitterEngine.cs
33
44
55
6
67
78
89
910
1011
1112
12
13
1314
14
15
16
17
18
19
1520
1621
1722
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using AccountManagement;
namespace AccountManagement.Engines
{
class TwitterEngine : IEngine, IDisposable
{
private WebEngine web;
public TwitterEngine()
public TwitterEngine(Dictionary<string, string> options)
{
//We don't need to store the options
if (options.Keys.Contains("ignoressl") && options["ignoressl"] == "true")
{
AccountManagementEngine.ignoreSSL();
}
}
public void Dispose()
{

Archive Download the corresponding diff file

Branches

Tags

Page rendered in 0.43310s using 14 queries.