Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /****************************************************************/
- /* phpStatus */
- /* add_group.php file */
- /* (c)copyright 2003 */
- /* By hinton design */
- /* http://www.hintondesign.org */
- /* support@hintondesign.org */
- /* */
- /* This program is free software. You can redistrabute it and/or*/
- /* modify it under the terms of the GNU General Public Licence */
- /* as published by the Free Software Foundation; either version */
- /* 2 of the license. */
- /* */
- /****************************************************************/
- define("PHPSTATUS_REAL_PATH","./../");
- include(PHPSTATUS_REAL_PATH . 'common.php');
- if($HTTP_COOKIE_VARS['loged'] == 'yes') {
- if($HTTP_COOKIE_VARS['user_level'] == '1') {
- if(!$HTTP_POST_VARS['name']) {
- include("header.php");
- $template->getFile(array(
- 'error' => 'admin/error.tpl')
- );
- $template->add_vars(array(
- 'L_ERROR' => $lang['error'],
- 'DISPLAY' => $lang['error_mess7'])
- );
- $template->parse("error");
- include("footer.php");
- exit();
- }
- $sql = "SELECT name FROM ".$prefix."_groups WHERE name='$HTTP_POST_VARS[name]'";
- $result = $db->query($sql);
- $num = $db->num($result);
- if($num > 0) {
- include("header.php");
- unset($HTTP_POST_VARS['name']);
- $template->getFile(array(
- 'error' => 'admin/error.tpl')
- );
- $template->add_vars(array(
- 'L_ERROR' => $lang['error'],
- 'DISPLAY' => $lang['error_mess8'])
- );
- $template->parse("error");
- include("footer.php");
- exit();
- }
- $ports = join(",", $_POST['ports']);
- $sql = "INSERT INTO ".$prefix."_groups (name, ports) VALUES ('$HTTP_POST_VARS[name]', '$ports')";
- $result = $db->query($sql);
- if(!$result) {
- include("header.php");
- $template->getFile(array(
- 'error' => 'admin/error.tpl')
- );
- $template->add_vars(array(
- 'L_ERROR' => $lang['error'],
- 'DISPLAY' => $lang['error_mess9'])
- );
- $template->parse("error");
- include("footer.php");
- exit();
- } else {
- include("header.php");
- $link = "groups.php";
- $template->getFile(array(
- 'success' => 'admin/success.tpl')
- );
- $template->add_vars(array(
- 'L_SUCCESS' => $lang['success'],
- 'DISPLAY' => $lang['success_mess1'],
- 'LINK' => $link)
- );
- $template->parse("success");
- include("footer.php");
- exit();
- }
- } else {
- include("header.php");
- $template->getFile(array(
- 'error' => 'admin/error.tpl')
- );
- $template->add_vars(array(
- 'L_ERROR' => $lang['error'],
- 'DISPLAY' => $lang['error_mess5'])
- );
- $template->parse("error");
- include("footer.php");
- exit();
- }
- } else {
- include("header.php");
- $display = "You are not logged in.";
- $template->getFile(array(
- 'error' => 'admin/error.tpl')
- );
- $template->add_vars(array(
- 'L_ERROR' => $lang['error'],
- 'DISPLAY' => $lang['error_mess6'])
- );
- $template->parse("error");
- include("footer.php");
- exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement