Commit d80be7bf authored by Franco Fichtner's avatar Franco Fichtner

ipsec: more config amending; fixes #112

parent 2d86dbfb
<?php <?php
/* $Id$ */
/* /*
Copyright (C) 2014 Deciso B.V. Copyright (C) 2014 Deciso B.V.
Copyright (C) 2004-2009 Scott Ullrich Copyright (C) 2004-2009 Scott Ullrich
...@@ -57,8 +57,13 @@ if ($_GET['act'] == 'connect') { ...@@ -57,8 +57,13 @@ if ($_GET['act'] == 'connect') {
} }
} }
if (!is_array($config['ipsec']['phase1'])) if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['phase1'])) {
$config['ipsec']['phase1'] = array(); $config['ipsec']['phase1'] = array();
}
$a_phase1 = &$config['ipsec']['phase1']; $a_phase1 = &$config['ipsec']['phase1'];
......
...@@ -33,8 +33,13 @@ global $g; ...@@ -33,8 +33,13 @@ global $g;
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("ipsec.inc"); require_once("ipsec.inc");
if (!is_array($config['ipsec']['phase2'])) if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['phase2'])) {
$config['ipsec']['phase2'] = array(); $config['ipsec']['phase2'] = array();
}
$ipsec_status = array(); $ipsec_status = array();
......
...@@ -38,11 +38,13 @@ if (!is_array($config['ipsec'])) { ...@@ -38,11 +38,13 @@ if (!is_array($config['ipsec'])) {
$config['ipsec'] = array(); $config['ipsec'] = array();
} }
if (!is_array($config['ipsec']['phase1'])) if (!is_array($config['ipsec']['phase1'])) {
$config['ipsec']['phase1'] = array(); $config['ipsec']['phase1'] = array();
}
if (!is_array($config['ipsec']['phase2'])) if (!is_array($config['ipsec']['phase2'])) {
$config['ipsec']['phase2'] = array(); $config['ipsec']['phase2'] = array();
}
$a_phase1 = &$config['ipsec']['phase1']; $a_phase1 = &$config['ipsec']['phase1'];
$a_phase2 = &$config['ipsec']['phase2']; $a_phase2 = &$config['ipsec']['phase2'];
......
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Shrew Soft Inc Copyright (C) 2008 Shrew Soft Inc
...@@ -35,14 +36,15 @@ if (!is_array($config['ipsec'])) { ...@@ -35,14 +36,15 @@ if (!is_array($config['ipsec'])) {
$config['ipsec'] = array(); $config['ipsec'] = array();
} }
if (!is_array($config['ipsec']['phase1'])) if (!is_array($config['ipsec']['phase1'])) {
$config['ipsec']['phase1'] = array(); $config['ipsec']['phase1'] = array();
}
$a_phase1 = &$config['ipsec']['phase1']; if (!is_array($config['ipsec']['client'])) {
if (!is_array($config['ipsec']['client']))
$config['ipsec']['client'] = array(); $config['ipsec']['client'] = array();
}
$a_phase1 = &$config['ipsec']['phase1'];
$a_client = &$config['ipsec']['client']; $a_client = &$config['ipsec']['client'];
if (count($a_client)) { if (count($a_client)) {
......
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2008 Shrew Soft Inc Copyright (C) 2008 Shrew Soft Inc
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
Copyright (C) 2014 Ermal LUÇI Copyright (C) 2014 Ermal Luçi
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
...@@ -37,11 +38,13 @@ if (!is_array($config['ipsec'])) { ...@@ -37,11 +38,13 @@ if (!is_array($config['ipsec'])) {
$config['ipsec'] = array(); $config['ipsec'] = array();
} }
if (!is_array($config['ipsec']['phase1'])) if (!is_array($config['ipsec']['phase1'])) {
$config['ipsec']['phase1'] = array(); $config['ipsec']['phase1'] = array();
}
if (!is_array($config['ipsec']['phase2'])) if (!is_array($config['ipsec']['phase2'])) {
$config['ipsec']['phase2'] = array(); $config['ipsec']['phase2'] = array();
}
$a_phase1 = &$config['ipsec']['phase1']; $a_phase1 = &$config['ipsec']['phase1'];
$a_phase2 = &$config['ipsec']['phase2']; $a_phase2 = &$config['ipsec']['phase2'];
......
...@@ -36,14 +36,15 @@ if (!is_array($config['ipsec'])) { ...@@ -36,14 +36,15 @@ if (!is_array($config['ipsec'])) {
$config['ipsec'] = array(); $config['ipsec'] = array();
} }
if (!is_array($config['ipsec']['client'])) if (!is_array($config['ipsec']['client'])) {
$config['ipsec']['client'] = array(); $config['ipsec']['client'] = array();
}
$a_client = &$config['ipsec']['client']; if (!is_array($config['ipsec']['phase2'])) {
if (!is_array($config['ipsec']['phase2']))
$config['ipsec']['phase2'] = array(); $config['ipsec']['phase2'] = array();
}
$a_client = &$config['ipsec']['client'];
$a_phase2 = &$config['ipsec']['phase2']; $a_phase2 = &$config['ipsec']['phase2'];
if (!empty($_GET['p2index'])) if (!empty($_GET['p2index']))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment