Advertisement
Snoop-Dogg

phpStatus

Dec 6th, 2020
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 KB | None | 0 0
  1. <?php
  2. /****************************************************************/
  3. /* phpStatus */
  4. /* add_group.php file */
  5. /* (c)copyright 2003 */
  6. /* By hinton design */
  7. /* http://www.hintondesign.org */
  8. /* support@hintondesign.org */
  9. /* */
  10. /* This program is free software. You can redistrabute it and/or*/
  11. /* modify it under the terms of the GNU General Public Licence */
  12. /* as published by the Free Software Foundation; either version */
  13. /* 2 of the license. */
  14. /* */
  15. /****************************************************************/
  16.  
  17. define("PHPSTATUS_REAL_PATH","./../");
  18. include(PHPSTATUS_REAL_PATH . 'common.php');
  19.  
  20. if($HTTP_COOKIE_VARS['loged'] == 'yes') {
  21. if($HTTP_COOKIE_VARS['user_level'] == '1') {
  22. if(!$HTTP_POST_VARS['name']) {
  23. include("header.php");
  24. $template->getFile(array(
  25. 'error' => 'admin/error.tpl')
  26. );
  27. $template->add_vars(array(
  28. 'L_ERROR' => $lang['error'],
  29. 'DISPLAY' => $lang['error_mess7'])
  30. );
  31. $template->parse("error");
  32. include("footer.php");
  33. exit();
  34. }
  35.  
  36. $sql = "SELECT name FROM ".$prefix."_groups WHERE name='$HTTP_POST_VARS[name]'";
  37. $result = $db->query($sql);
  38.  
  39. $num = $db->num($result);
  40.  
  41. if($num > 0) {
  42. include("header.php");
  43. unset($HTTP_POST_VARS['name']);
  44. $template->getFile(array(
  45. 'error' => 'admin/error.tpl')
  46. );
  47. $template->add_vars(array(
  48. 'L_ERROR' => $lang['error'],
  49. 'DISPLAY' => $lang['error_mess8'])
  50. );
  51. $template->parse("error");
  52. include("footer.php");
  53. exit();
  54. }
  55.  
  56. $ports = join(",", $_POST['ports']);
  57.  
  58. $sql = "INSERT INTO ".$prefix."_groups (name, ports) VALUES ('$HTTP_POST_VARS[name]', '$ports')";
  59. $result = $db->query($sql);
  60.  
  61. if(!$result) {
  62. include("header.php");
  63. $template->getFile(array(
  64. 'error' => 'admin/error.tpl')
  65. );
  66. $template->add_vars(array(
  67. 'L_ERROR' => $lang['error'],
  68. 'DISPLAY' => $lang['error_mess9'])
  69. );
  70. $template->parse("error");
  71. include("footer.php");
  72. exit();
  73. } else {
  74. include("header.php");
  75. $link = "groups.php";
  76. $template->getFile(array(
  77. 'success' => 'admin/success.tpl')
  78. );
  79. $template->add_vars(array(
  80. 'L_SUCCESS' => $lang['success'],
  81. 'DISPLAY' => $lang['success_mess1'],
  82. 'LINK' => $link)
  83. );
  84. $template->parse("success");
  85. include("footer.php");
  86. exit();
  87. }
  88. } else {
  89. include("header.php");
  90. $template->getFile(array(
  91. 'error' => 'admin/error.tpl')
  92. );
  93. $template->add_vars(array(
  94. 'L_ERROR' => $lang['error'],
  95. 'DISPLAY' => $lang['error_mess5'])
  96. );
  97. $template->parse("error");
  98. include("footer.php");
  99. exit();
  100. }
  101. } else {
  102. include("header.php");
  103. $display = "You are not logged in.";
  104. $template->getFile(array(
  105. 'error' => 'admin/error.tpl')
  106. );
  107. $template->add_vars(array(
  108. 'L_ERROR' => $lang['error'],
  109. 'DISPLAY' => $lang['error_mess6'])
  110. );
  111. $template->parse("error");
  112. include("footer.php");
  113. exit();
  114. }
  115. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement