Revision 6c07db48
Added by Phil Davis about 10 years ago
etc/inc/openvpn.inc | ||
---|---|---|
526 | 526 |
// Otherwise, if a specific interface is requested, use it |
527 | 527 |
// If "any" interface was selected, local directive will be omitted. |
528 | 528 |
if (is_ipaddrv4($ipaddr)) { |
529 |
$iface_ip=$ipaddr;
|
|
529 |
$iface_ip = $ipaddr;
|
|
530 | 530 |
} else { |
531 | 531 |
if ((!empty($interface)) && (strcmp($interface, "any"))) { |
532 | 532 |
$iface_ip=get_interface_ip($interface); |
533 | 533 |
} |
534 | 534 |
} |
535 | 535 |
if (is_ipaddrv6($ipaddr)) { |
536 |
$iface_ipv6=$ipaddr;
|
|
536 |
$iface_ipv6 = $ipaddr;
|
|
537 | 537 |
} else { |
538 | 538 |
if ((!empty($interface)) && (strcmp($interface, "any"))) { |
539 | 539 |
$iface_ipv6=get_interface_ipv6($interface); |
... | ... | |
1326 | 1326 |
$client['vpnid'] = $settings['vpnid']; |
1327 | 1327 |
$client['mgmt'] = "client{$client['vpnid']}"; |
1328 | 1328 |
$socket = "unix://{$g['varetc_path']}/openvpn/{$client['mgmt']}.sock"; |
1329 |
$client['status']="down";
|
|
1329 |
$client['status'] = "down";
|
|
1330 | 1330 |
|
1331 | 1331 |
$clients[] = openvpn_get_client_status($client, $socket); |
1332 | 1332 |
} |
... | ... | |
1355 | 1355 |
|
1356 | 1356 |
/* Get the client state */ |
1357 | 1357 |
if (strstr($line, "CONNECTED")) { |
1358 |
$client['status']="up";
|
|
1358 |
$client['status'] = "up";
|
|
1359 | 1359 |
$list = explode(",", $line); |
1360 | 1360 |
|
1361 |
$client['connect_time'] = date("D M j G:i:s Y", $list[0]);
|
|
1362 |
$client['virtual_addr'] = $list[3];
|
|
1361 |
$client['connect_time'] = date("D M j G:i:s Y", $list[0]); |
|
1362 |
$client['virtual_addr'] = $list[3]; |
|
1363 | 1363 |
$client['remote_host'] = $list[4]; |
1364 | 1364 |
} |
1365 | 1365 |
if (strstr($line, "CONNECTING")) { |
1366 |
$client['status']="connecting";
|
|
1366 |
$client['status'] = "connecting";
|
|
1367 | 1367 |
} |
1368 | 1368 |
if (strstr($line, "ASSIGN_IP")) { |
1369 |
$client['status']="waiting";
|
|
1369 |
$client['status'] = "waiting";
|
|
1370 | 1370 |
$list = explode(",", $line); |
1371 | 1371 |
|
1372 |
$client['connect_time'] = date("D M j G:i:s Y", $list[0]);
|
|
1373 |
$client['virtual_addr'] = $list[3];
|
|
1372 |
$client['connect_time'] = date("D M j G:i:s Y", $list[0]); |
|
1373 |
$client['virtual_addr'] = $list[3]; |
|
1374 | 1374 |
} |
1375 | 1375 |
if (strstr($line, "RECONNECTING")) { |
1376 |
$client['status']="reconnecting";
|
|
1376 |
$client['status'] = "reconnecting";
|
|
1377 | 1377 |
$list = explode(",", $line); |
1378 | 1378 |
|
1379 |
$client['connect_time'] = date("D M j G:i:s Y", $list[0]);
|
|
1379 |
$client['connect_time'] = date("D M j G:i:s Y", $list[0]); |
|
1380 | 1380 |
$client['status'] .= "; " . $list[2]; |
1381 | 1381 |
} |
1382 | 1382 |
/* parse end of output line */ |
Also available in: Unified diff
Code spacing
and other random stuff I noticed.
I think this finishes messing with code style. The codebase should match
the developer style guide closely enough that 99.9% of changes will not
feel the need to also massage the formatting.