This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
plugins:remotebridge [2014/01/29 10:53] thecry |
plugins:remotebridge [2014/08/06 11:58] (current) thecry [RemoteBridge URL] |
||
---|---|---|---|
Line 18: | Line 18: | ||
==== RemoteBridge URL ==== | ==== RemoteBridge URL ==== | ||
- | * http://adminurl.tld/remotebridge.php | + | <code>http(s)://admin.myserver.tld/remotebridge.php</code> |
- | or | + | |
- | * http://adminurl.tld/remotebridge.php | + | |
==== How to send data to the remote bridge (example) ==== | ==== How to send data to the remote bridge (example) ==== | ||
- | https://github.com/i-MSCP/plugins/tree/master/RemoteBridge#how-to-send-data-to-the-remote-bridge-example | + | <code>function dataEncryption($dataToEncrypt, $ResellerUsername) { |
+ | return strtr(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($ResellerUsername), serialize($dataToEncrypt), MCRYPT_MODE_CBC, md5(md5($ResellerUsername)))), '+/=', '-_,'); | ||
+ | } | ||
+ | $bridgeKey = ''; | ||
+ | $ResellerUsername = ''; | ||
+ | $dataToEncrypt = array( | ||
+ | 'action' => '', | ||
+ | 'reseller_username' => $ResellerUsername, | ||
+ | 'reseller_password' => '', | ||
+ | 'bridge_key' => $bridgeKey, | ||
+ | 'hosting_plan' => '', | ||
+ | 'admin_pass' => '', | ||
+ | 'email' => '', | ||
+ | 'domain' => '' | ||
+ | ); | ||
+ | |||
+ | $ch = curl_init('http(s)://admin.myserver.tld/remotebrigde.php'); | ||
+ | curl_setopt($ch, CURLOPT_POST, 1); | ||
+ | curl_setopt($ch, CURLOPT_POSTFIELDS, 'key='.$bridgeKey.'&data='.dataEncryption($dataToEncrypt, $ResellerUsername)); | ||
+ | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | ||
+ | |||
+ | $httpResponse = curl_exec($ch); | ||
+ | echo $httpResponse; | ||
+ | curl_close($ch);</code> | ||
==== Post data variables which are available / required ==== | ==== Post data variables which are available / required ==== | ||
=== key (required) === | === key (required) === |