| 58 |
FPassword: string; |
FPassword: string; |
| 59 |
FProxyAddress: string; |
FProxyAddress: string; |
| 60 |
FClientUA: string; |
FClientUA: string; |
| 61 |
|
FDolibURL: string; |
| 62 |
function GetSessionID: string; |
function GetSessionID: string; |
| 63 |
function GetVersion: string; |
function GetVersion: string; |
| 64 |
function GetUserAgent: string; |
function GetUserAgent: string; |
| 66 |
function GetErrorMsg: string; |
function GetErrorMsg: string; |
| 67 |
procedure MakeError(Session: TDolibSession; Error: DWORD); |
procedure MakeError(Session: TDolibSession; Error: DWORD); |
| 68 |
procedure DOLIB_LOGIN(Proxy: string; Port: Integer; ID: string; Pass: string); |
procedure DOLIB_LOGIN(Proxy: string; Port: Integer; ID: string; Pass: string); |
| 69 |
procedure ForcedDOLIB_LOGIN(Proxy: string; Port: Integer; ID: string; Pass: string); |
procedure ForcedDOLIB_LOGIN(Proxy: string; Port: Integer; ID: string; Pass: string); |
| 70 |
public |
public |
| 71 |
constructor Create; |
constructor Create; |
| 72 |
destructor Destroy; override; |
destructor Destroy; override; |
| 73 |
function Connect: boolean; |
function Connect: boolean; |
| 74 |
function ForcedConnect: boolean; //SSL障害用強制ログイン |
function ForcedConnect: boolean; //SSL障害用強制ログイン |
| 75 |
function Disconnect: boolean; |
function Disconnect: boolean; |
| 76 |
property ProxyAddress: string read FProxyAddress write FProxyAddress; |
property ProxyAddress: string read FProxyAddress write FProxyAddress; |
| 77 |
property ProxyPort: integer read FProxyPort write FProxyPort; |
property ProxyPort: integer read FProxyPort write FProxyPort; |
| 84 |
property UserAgent: string read GetUserAgent; |
property UserAgent: string read GetUserAgent; |
| 85 |
property ErrorCode: integer read GetErrorCode; |
property ErrorCode: integer read GetErrorCode; |
| 86 |
property ErrorMsg: string read GetErrorMsg; |
property ErrorMsg: string read GetErrorMsg; |
| 87 |
|
property DolibURL: string read FDolibURL write FDolibURL; |
| 88 |
end; |
end; |
| 89 |
|
|
| 90 |
implementation |
implementation |
| 92 |
DOLIB_VERSION = $10000; |
DOLIB_VERSION = $10000; |
| 93 |
DOLIB_LOGIN_UA = 'DOLIB/1.00'; |
DOLIB_LOGIN_UA = 'DOLIB/1.00'; |
| 94 |
DOLIB_LOGIN_HOST = 'tiger2.he.net'; |
DOLIB_LOGIN_HOST = 'tiger2.he.net'; |
| 95 |
DOLIB_LOGIN_URL = '/~tora3n2c/futen.cgi'; |
// DOLIB_LOGIN_URL = '/~tora3n2c/futen.cgi'; |
| 96 |
DOLIB_2CH_UA = 'X-2ch-UA:'; |
DOLIB_2CH_UA = 'X-2ch-UA:'; |
| 97 |
// DOLIB_2CH_UA = 'X-2ch-UA: gikoNavi/1.00'#13#10; |
// DOLIB_2CH_UA = 'X-2ch-UA: gikoNavi/1.00'#13#10; |
| 98 |
DOLIB_ENOMEM_STRING = 'メモリが足りません。'; |
DOLIB_ENOMEM_STRING = 'メモリが足りません。'; |
| 249 |
if not Assigned(hConnect) then |
if not Assigned(hConnect) then |
| 250 |
MakeError(FSession, GetLastError()) |
MakeError(FSession, GetLastError()) |
| 251 |
else begin |
else begin |
| 252 |
hRequest := HttpOpenRequest(hConnect, 'POST', DOLIB_LOGIN_URL, |
hRequest := HttpOpenRequest(hConnect, 'POST', PChar(FDolibURL), |
| 253 |
nil, nil, nil, |
nil, nil, nil, |
| 254 |
INTERNET_FLAG_NO_CACHE_WRITE or INTERNET_FLAG_NO_COOKIES or |
INTERNET_FLAG_NO_CACHE_WRITE or INTERNET_FLAG_NO_COOKIES or |
| 255 |
INTERNET_FLAG_NO_UI or INTERNET_FLAG_SECURE, 0); |
INTERNET_FLAG_NO_UI or INTERNET_FLAG_SECURE, 0); |
| 319 |
if not Assigned(hConnect) then |
if not Assigned(hConnect) then |
| 320 |
MakeError(FSession, GetLastError()) |
MakeError(FSession, GetLastError()) |
| 321 |
else begin |
else begin |
| 322 |
hRequest := HttpOpenRequest(hConnect, 'POST', DOLIB_LOGIN_URL, |
hRequest := HttpOpenRequest(hConnect, 'POST', PChar(FDolibURL), |
| 323 |
nil, nil, nil, |
nil, nil, nil, |
| 324 |
INTERNET_FLAG_NO_CACHE_WRITE or INTERNET_FLAG_NO_COOKIES or |
INTERNET_FLAG_NO_CACHE_WRITE or INTERNET_FLAG_NO_COOKIES or |
| 325 |
INTERNET_FLAG_NO_UI or INTERNET_FLAG_SECURE, 0); |
INTERNET_FLAG_NO_UI or INTERNET_FLAG_SECURE, 0); |