Revision 4a778ba9
Added by A FL about 5 years ago
src/etc/inc/voucher.inc | ||
---|---|---|
100 | 100 |
return $resp; |
101 | 101 |
} |
102 | 102 |
|
103 |
function xmlrpc_sync_voucher_disconnect($dbent, $syncip, $port, $password, $username, $term_cause = 1, $stop_time = null) { |
|
104 |
global $cpzone; |
|
105 |
require_once("xmlrpc_client.inc"); |
|
106 |
/* Construct code that is run on remote machine */ |
|
107 |
$dbent_str = addslashes(serialize($dbent)); |
|
108 |
$tmp_stop_time = (isset($stop_time)) ? $stop_time : "null"; |
|
109 |
$execcmd = <<<EOF |
|
110 |
global \$cpzone; |
|
111 |
require_once('/etc/inc/captiveportal.inc'); |
|
112 |
require_once('/etc/inc/voucher.inc'); |
|
113 |
\$cpzone = "$cpzone"; |
|
114 |
\$dbent = unserialize("$dbent_str"); |
|
115 |
return captiveportal_disconnect(\$dbent, $term_cause, $tmp_stop_time); |
|
116 |
|
|
117 |
EOF; |
|
118 |
$rpc_client = new pfsense_xmlrpc_client(); |
|
119 |
$rpc_client->setConnectionData($syncip, $port, $username, $password); |
|
120 |
$resp = $rpc_client->xmlrpc_exec_php($execcmd); |
|
121 |
if (empty($resp)) { |
|
122 |
return false; |
|
123 |
} |
|
124 |
return $resp; |
|
125 |
} |
|
126 |
|
|
127 | 103 |
function xmlrpc_sync_used_voucher($voucher_received, $syncip, $port, $password, $username) { |
128 | 104 |
global $config, $cpzone; |
129 | 105 |
require_once("xmlrpc_client.inc"); |
Also available in: Unified diff
Forward an user disconnection to the other node
Redmine #97