Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b9feb0

Browse files
authored
Merge pull request#10 from membersuite/upgrade-to-php8
Upgrade to php8 compatability
2 parents9f289cb +063a8c5 commit5b9feb0

File tree

66 files changed

+519
-73072
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+519
-73072
lines changed

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor/
2+
.DS_Store
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
<?php
2-
/*
3-
This class contains user global information
4-
Created Date: 21/March/2013
5-
Created By: SmartdataInc.
6-
7-
*/
2+
83
class Userconfig{
9-
4+
105
publicstaticfunctionread($name){
11-
6+
127
$config =array('AccessKeyId' =>'AAAAAPIA/UObVXfWokrswA',
138
'AssociationId' =>'2537d8c3-0004-4ddb-b7e4-a6d76c09d3f9',
149
'SecretAccessKey' =>'PislBM1IXpWjshA/IQagSzrJ/FiXbuJu80zaKctvLO/CzHcZXYC9F8MbatI2jtFY4TZRU3TsmYflg3HsSYdWOQ==',
1510
'SigningcertificateId' =>'AAAAAPMAnESfVm9oock2Kw',
1611
'SigningcertificatePath' =>'bin/signingcertificate.xml',
1712
'PortalUrl' =>'https://customer14517d3f9.portal.production.membersuite.com/'
1813
);
19-
20-
return$config[$name];
21-
22-
}
23-
14+
15+
return$config[$name];
16+
17+
}
18+
2419
}
2520

2621
?>
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
<?php
2-
/*
3-
This class contains user global information
4-
Created Date: 14/April/2013
5-
Created By: SmartdataInc.
6-
7-
*/
2+
83
class Userconfig{
9-
4+
105
publicstaticfunctionread($name){
11-
6+
127
$config =array('AccessKeyId' =>'AAAAAPIA/UObVXfWokrswA',
138
'AssociationId' =>'2537d8c3-0004-4ddb-b7e4-a6d76c09d3f9',
149
'SecretAccessKey' =>'PislBM1IXpWjshA/IQagSzrJ/FiXbuJu80zaKctvLO/CzHcZXYC9F8MbatI2jtFY4TZRU3TsmYflg3HsSYdWOQ==',
1510
'SigningcertificateId' =>'AAAAAPMAnESfVm9oock2Kw',
1611
'SigningcertificatePath' =>'bin/signingcertificate.xml',
1712
'PortalUrl' =>'https://customer14517d3f9.portal.production.membersuite.com/'
1813
);
19-
20-
return$config[$name];
21-
22-
}
23-
14+
15+
return$config[$name];
16+
17+
}
18+
2419
}
2520

2621
?>
Lines changed: 64 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<?php
2-
/*
3-
This class contains all the cryptography alogorithm.
4-
Created Date: 28/March/2013
5-
Created By: SmartdataInc.
6-
*/
2+
73
define('base_path',dirname(__FILE__));
84
include_once('phpseclib/Crypt/RSA_XML.php');
95

@@ -12,69 +8,69 @@ class ConciergeApiHelper{
128
var$accesskeyId;
139
var$associationId;
1410
var$messagesignature;
15-
var$portalusername;
11+
var$portalusername;
1612
var$signingcertificateId;
1713
var$secretaccessId;
1814
var$digitalsignature;
1915
var$error;
2016
var$debug;
2117

2218
publicfunction__construct(){
23-
19+
2420
$this->accesskeyId =null;
2521
$this->associationId =null;
2622
$this->messagesignature =null;
27-
$this->portalusername =null;
23+
$this->portalusername =null;
2824
$this->signingcertificateId =null;
2925
$this->secretaccessId =null;
3026
$this->digitalsignature =null;
3127
$this->error =null;
3228
$this->debug =null;
33-
29+
3430
}
35-
36-
31+
32+
3733
// This function is to create token request
3834
publicfunctionCreatePortalSecurityToken(){
39-
40-
// Get file content
35+
36+
// Get file content
4137
$filepath ="bin/CreatePortalSecurityTokenRequest.xml";
42-
43-
if(!file_exists($filepath)){
38+
39+
if(!file_exists($filepath)){
4440
$error ='Error';
45-
return$error;
41+
return$error;
4642
}
47-
43+
4844
$filecontent =file_get_contents($filepath);
49-
45+
5046
if($filecontent =='Error'){
5147
$errormsg ='API Request can not be generated';
5248
returnfalse;
5349
}
54-
50+
5551
$action ="http://membersuite.com/contracts/IConciergeAPIService/CreatePortalSecurityToken";
56-
57-
// Values that needs to be changed
52+
53+
// Values that needs to be changed
5854
$replacearr =array('<To></To>',
5955
'<Action></Action>',
6056
'<AccessKeyId></AccessKeyId>',
6157
'<AssociationId></AssociationId>',
6258
'<Signature></Signature>',
6359
);
64-
60+
6561
// By these values
6662
$replacevalue =array('<To>https://api.membersuite.com</To>',
6763
'<Action>'.$action.'</Action>',
6864
'<AccessKeyId>'.$this->accesskeyId.'</AccessKeyId>',
6965
'<AssociationId>'.$this->associationId.'</AssociationId>',
7066
'<Signature>'.$this->messagesignature.'</Signature>',
7167
);
72-
73-
// Replace strings
74-
$apiheaderrequest =str_replace($replacearr,$replacevalue,$filecontent);
75-
76-
77-
// Construct Body
68+
69+
// Replace strings
70+
$apiheaderrequest =str_replace($replacearr,$replacevalue,$filecontent);
71+
72+
73+
// Construct Body
7874
$body ='<s:Body>
7975
<CreatePortalSecurityToken xmlns="http://membersuite.com/contracts">
8076
<portalUserName>'.$this->portalusername.'</portalUserName>
@@ -83,74 +79,74 @@ public function CreatePortalSecurityToken(){
8379
</CreatePortalSecurityToken>
8480
</s:Body>
8581
';
86-
87-
// Replace strings
88-
$apirequest =str_replace('<s:Body></s:Body>',$body,$apiheaderrequest);
89-
82+
83+
// Replace strings
84+
$apirequest =str_replace('<s:Body></s:Body>',$body,$apiheaderrequest);
85+
9086
$url ='https://api.membersuite.com';
9187
$header =array (
9288
"SOAPAction:http://membersuite.com/contracts/IConciergeAPIService/CreatePortalSecurityToken",
9389
'Content-Type: text/xml; charset=utf-8',
94-
);
90+
);
9591
$postdata =$apirequest;
96-
92+
9793
$result =$this->curl($url,$header,$postdata);
98-
99-
return$result;
100-
101-
}
102-
103-
94+
95+
return$result;
96+
97+
}
98+
99+
104100
publicstaticfunctionDigitalSignature($portalUsername,$rsaXML){
105-
101+
106102
$xmlrsa =newCrypt_RSA_XML();
107103
$xmlrsa->loadKeyfromXML($rsaXML);
108104
$signature =$xmlrsa->sign($portalUsername);
109-
105+
110106
returnbase64_encode($signature);
111-
112-
}
113-
107+
108+
}
109+
114110
publicstaticfunctionMessageSignature($method,$SecretAccessKey,$AssociationId,$SessionId =""){
115-
111+
116112
$call ="http://membersuite.com/contracts/IConciergeAPIService/$method";
117-
113+
118114
$secret =base64_decode($SecretAccessKey);
119115
$data ="$call$AssociationId$SessionId";
120-
116+
121117
returnbase64_encode(hash_hmac('sha1',$data,$secret,True));
122-
118+
123119
}
124-
120+
125121
publicfunctioncurl($url,$header,$postdata){
126-
127-
// cURL initilization
122+
123+
// cURL initilization
128124
$curl =curl_init();
129-
130-
// setting up the cURL URL
131-
curl_setopt ($curl,CURLOPT_URL,$url);
125+
126+
// setting up the cURL URL
127+
curl_setopt ($curl,CURLOPT_URL,$url);
132128
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
133-
134-
// setting up the cURL Header
135-
curl_setopt($curl,CURLOPT_HTTPHEADER,$header);
136-
curl_setopt ($curl,CURLOPT_POST,true);
137-
138-
// setting the postdata in the cURL that needs to be posted
139-
curl_setopt ($curl,CURLOPT_POSTFIELDS,$postdata);
140-
129+
130+
// setting up the cURL Header
131+
curl_setopt($curl,CURLOPT_HTTPHEADER,$header);
132+
curl_setopt ($curl,CURLOPT_POST,true);
133+
134+
// setting the postdata in the cURL that needs to be posted
135+
curl_setopt ($curl,CURLOPT_POSTFIELDS,$postdata);
136+
141137
$result =curl_exec($curl);
142-
138+
143139
// Show curl errors
144140
if($this->debug){
145141
$response =curl_error($curl);
146142
return$response;
147143
}
148-
144+
149145
curl_close ($curl);
150-
146+
151147
return$result;
152-
148+
153149
}
154150
}
155151

156-
?>
152+
?>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp