Project

General

Profile

« Previous | Next » 

Revision 2f384448

Added by Scott Ullrich about 15 years ago

Check for less time available on remote node

View differences:

etc/inc/voucher.inc
61 61
	log_error("Captive Portal Voucher XMLRPC sync data {$url}:{$port}.");
62 62
	$msg = new XML_RPC_Message($method, $params);
63 63
	$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
64
	$cli->setCredentials('admin', $password);
64
	$cli->setCredentials($username, $password);
65 65
	$resp = $cli->send($msg, "250");
66 66
	if(!$resp) {
67 67
		$error = "A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} (pfsense.exec_php).";
......
107 107
		$syncip   = $a_voucher['vouchersyncdbip'];
108 108
		$syncport = $a_voucher['vouchersyncport'];
109 109
		$syncpass = $a_voucher['vouchersyncpass'];
110
		$syncpass = $a_voucher['vouchersyncusername'];
110
		$vouchersyncusername = $a_voucher['vouchersyncusername'];
111 111
		$remote_time_used = xmlrpc_sync_used_voucher($voucher_received, $syncip, $syncport, $syncpass, $vouchersyncusername);
112 112
	}
113 113

  
......
191 191
        } else {
192 192
            $test_result[] = "Access granted for $total_minutes Minutes in total.";
193 193
        }
194
	unlock($voucherlck);
194
		unlock($voucherlck);
195 195
        return $test_result;
196 196
    }
197 197

  
......
208 208

  
209 209
	// If we did a XMLRPC sync earlier check the timeleft
210 210
	if($a_voucher['vouchersyncdbip']) 
211
		if($remote_time_used['timeleft'] < 1) 
211
		if($remote_time_used['timeleft'] < $total_minutes) 
212 212
			$total_minutes = $remote_time_used['timeleft'];
213 213

  
214 214
    // All given vouchers were valid and this isn't simply a test.

Also available in: Unified diff