groupdelete.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2012
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. include "root.php";
  22. require_once "includes/require.php";
  23. require_once "includes/checkauth.php";
  24. if (permission_exists('group_delete') || if_group("superadmin")) {
  25. //access allowed
  26. }
  27. else {
  28. echo "access denied";
  29. return;
  30. }
  31. //get the http value and set as a variable
  32. $id = check_str($_GET["id"]);
  33. //delete the group
  34. $sqldelete = "delete from v_groups ";
  35. $sqldelete .= "where domain_uuid = '$domain_uuid' ";
  36. $sqldelete .= "and group_uuid = '$id' ";
  37. if (!$db->exec($sqldelete)) {
  38. //echo $db->errorCode() . "<br>";
  39. $info = $db->errorInfo();
  40. print_r($info);
  41. // $info[0] == $db->errorCode() unified error code
  42. // $info[1] is the driver specific error code
  43. // $info[2] is the driver specific error string
  44. }
  45. //redirect the user
  46. header("Location: grouplist.php");
  47. ?>