Snoop-Dogg

phpStatus

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