Projet

Général

Profil

« Précédent | Suivant » 

Révision a6057836

Ajouté par Renato Botelho il y a plus de 9 ans

Use array id to delete phase2, it will simplify changes I'm working on and will commit soon

Voir les différences:

usr/local/www/vpn_ipsec.php
150 150
		mark_subsystem_dirty('ipsec');
151 151
	} else if ($_GET['act'] == "delph2") {
152 152
		/* remove the phase2 entry */
153
		foreach ($a_phase2 as $ph2idx => $ph2) {
154
			if ($ph2['uniqid'] == $_GET['p2index']) {
155
				unset($a_phase2[$ph2idx]);
156
				write_config();
157
				mark_subsystem_dirty('ipsec');
158
				break;
159
			}
160
		}
153
		unset($a_phase2[$_GET['p2index']]);
154
		write_config();
155
		mark_subsystem_dirty('ipsec');
161 156
	} else if ($_GET['act'] == "toggle") {
162 157
		if (isset($a_phase1[$_GET['p1index']]['disabled']))
163 158
			unset($a_phase1[$_GET['p1index']]['disabled']);
......
410 405
									</td>
411 406
								</tr>
412 407
<?php
413
								foreach ($a_phase2 as $ph2ent):
408
								foreach ($a_phase2 as $ph2index => $ph2ent):
414 409
									if ($ph2ent['ikeid'] != $ph1ent['ikeid'])
415 410
										continue;
416 411

  
......
487 482
										<a href="vpn_ipsec_phase2.php?p2index=<?=$ph2ent['uniqid'];?>">
488 483
											<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit phase2 entry"); ?>" width="17" height="17" border="0" alt="edit" />
489 484
										</a>
490
										<a href="vpn_ipsec.php?act=delph2&amp;p1index=<?=$i;?>&amp;p2index=<?=$ph2ent['uniqid'];?>" onclick="return confirm('<?=gettext("Do you really want to delete this phase2 entry?"); ?>')">
485
										<a href="vpn_ipsec.php?act=delph2&amp;p1index=<?=$i;?>&amp;p2index=<?=$ph2index;?>" onclick="return confirm('<?=gettext("Do you really want to delete this phase2 entry?"); ?>')">
491 486
											<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete phase2 entry"); ?>" width="17" height="17" border="0" alt="delete" />
492 487
										</a>
493 488
										<a href="vpn_ipsec_phase2.php?dup=<?=$ph2ent['uniqid'];?>">

Formats disponibles : Unified diff