User Tools

Site Tools


plugins:remotebridge

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
plugins:remotebridge [2014/01/29 10:53]
thecry
plugins:remotebridge [2014/01/29 10:59]
thecry [How to send data to the remote bridge (example)]
Line 23: Line 23:
  
 ==== 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) ===
/var/www/virtual/i-mscp.net/wiki/htdocs/data/pages/plugins/remotebridge.txt · Last modified: 2014/08/06 11:58 by thecry