PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/mds/web/modules/proxy/blacklist/delete.php

https://github.com/vmasilva/mmc
PHP | 72 lines | 39 code | 10 blank | 23 comment | 5 complexity | 2795c12fdca2f7dea659f214d30ce51c MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * (c) 2004-2007 Linbox / Free&ALter Soft, http://linbox.com
  4. * (c) 2007-2008 Mandriva, http://www.mandriva.com/
  5. *
  6. * $Id$
  7. *
  8. * This file is part of Mandriva Management Console (MMC).
  9. *
  10. * MMC is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * MMC is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with MMC; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  23. */
  24. ?>
  25. <?php
  26. /* $Id$ */
  27. require("modules/proxy/includes/proxy.inc.php");
  28. require("modules/proxy/includes/config.inc.php");
  29. if (isset($_POST["bdelblacklist"])) {
  30. $arrB=get_blacklist();
  31. delElementInBlackList($_POST["blacklist"],$arrB);
  32. save_blacklist($arrB);
  33. }
  34. ?>
  35. <h2><?php echo _T("Remove a squidGuard domain"); ?></h2>
  36. <?php
  37. if (isset($_GET["blacklist"])) {
  38. $blacklist = urldecode($_GET["blacklist"]);
  39. ?>
  40. <form action="<?php echo urlStr("proxy/blacklist/delete"); ?>" method="post">
  41. <p>
  42. <?php printf(_T("You will remove <b>%s</b> entry"), $blacklist); ?>
  43. </p>
  44. <br>
  45. <p>
  46. <?php echo _T("Are you sure ?"); ?>
  47. </p>
  48. <input name="blacklist" type="hidden" value="<?php echo $blacklist; ?>" />
  49. <input name="bdelblacklist" type="submit" class="btnPrimary" value="<?php echo _("Delete"); ?> <?php echo $blacklist; ?>" />
  50. <input name="bback" type="submit" class="btnSecondary" value="<?php echo _("Cancel"); ?>" onclick="new Effect.Fade('popup'); return false;" />
  51. </form>
  52. <?php
  53. }
  54. else if (isset($_POST["bdelblacklist"]))
  55. {
  56. $n = new NotifyWidget();
  57. $blacklist = $_POST["blacklist"];
  58. if (!isXMLRPCError()) $str = sprintf(_T("Domain %s has been removed"), $blacklist);
  59. $n->add($str);
  60. redirectTo(urlStrRedirect('proxy/blacklist/index'));
  61. }
  62. ?>