mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
VPN: OpenVPN: Instances - add "interface invoke registration" event to reconfigure action, closes https://github.com/opnsense/core/issues/7869
This commit is contained in:
parent
415b280959
commit
1a048805d7
@ -71,7 +71,6 @@ class ServiceController extends ApiControllerBase
|
||||
*/
|
||||
public function searchSessionsAction()
|
||||
{
|
||||
$this->sessionClose();
|
||||
$data = json_decode((new Backend())->configdRun('openvpn connections client,server') ?? '', true) ?? [];
|
||||
$records = [];
|
||||
$roles = ['client', 'server'];
|
||||
@ -177,7 +176,6 @@ class ServiceController extends ApiControllerBase
|
||||
if (!$this->request->isPost()) {
|
||||
return ['result' => 'failed'];
|
||||
}
|
||||
$this->sessionClose();
|
||||
$server_id = $this->request->get('server_id', null);
|
||||
$session_id = $this->request->get('session_id', null);
|
||||
if ($server_id != null && $session_id != null) {
|
||||
@ -201,8 +199,6 @@ class ServiceController extends ApiControllerBase
|
||||
return ['result' => 'failed'];
|
||||
}
|
||||
|
||||
$this->sessionClose();
|
||||
|
||||
(new Backend())->configdpRun('service start', ['openvpn', $id]);
|
||||
|
||||
return ['result' => 'ok'];
|
||||
@ -218,8 +214,6 @@ class ServiceController extends ApiControllerBase
|
||||
return ['result' => 'failed'];
|
||||
}
|
||||
|
||||
$this->sessionClose();
|
||||
|
||||
(new Backend())->configdpRun('service stop', ['openvpn', $id]);
|
||||
|
||||
return ['result' => 'ok'];
|
||||
@ -235,8 +229,6 @@ class ServiceController extends ApiControllerBase
|
||||
return ['result' => 'failed'];
|
||||
}
|
||||
|
||||
$this->sessionClose();
|
||||
|
||||
(new Backend())->configdpRun('service restart', ['openvpn', $id]);
|
||||
|
||||
return ['result' => 'ok'];
|
||||
@ -251,9 +243,9 @@ class ServiceController extends ApiControllerBase
|
||||
return ['result' => 'failed'];
|
||||
}
|
||||
|
||||
$this->sessionClose();
|
||||
|
||||
(new Backend())->configdpRun('openvpn configure');
|
||||
$backend = new Backend();
|
||||
$backend->configdRun('openvpn configure');
|
||||
$backend->configdRun('interface invoke registration');
|
||||
|
||||
return ['result' => 'ok'];
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user