for more details. * * Copyright 2007-2010 Rejo Zenger * Copyright 2010-2014 Poweradmin Development Team * * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * Script that handles user deletion * * @package Poweradmin * @copyright 2007-2010 Rejo Zenger * @copyright 2010-2014 Poweradmin Development Team * @license http://opensource.org/licenses/GPL-3.0 GPL */ require_once("inc/toolkit.inc.php"); include_once("inc/header.inc.php"); verify_permission('user_edit_own') ? $perm_edit_own = "1" : $perm_edit_own = "0"; verify_permission('user_edit_others') ? $perm_edit_others = "1" : $perm_edit_others = "0"; verify_permission('user_is_ueberuser') ? $perm_is_godlike = "1" : $perm_is_godlike = "0"; if (!(isset($_GET['id']) && v_num($_GET['id']))) { error(ERR_INV_INPUT); include_once("inc/footer.inc.php"); exit; } else { $uid = $_GET['id']; } if (isset($_POST['commit'])) { if (is_valid_user($uid)) { $zones = array(); if (isset($_POST['zone'])) { $zones = $_POST['zone']; } if (delete_user($uid, $zones)) { success(SUC_USER_DEL); } } else { header("Location: users.php"); exit; } } else { if (($uid != $_SESSION['userid'] && $perm_edit_others == "0") || ($uid == $_SESSION['userid'] && $perm_is_godlike == "0")) { error(ERR_PERM_DEL_USER); include_once("inc/footer.inc.php"); exit; } else { $fullname = get_fullname_from_userid($uid); $zones = get_zones("own", $uid); echo "

" . _('Delete user') . " \"" . $fullname . "\"

\n"; echo "
\n"; echo " \n"; if (count($zones) > 0) { $users = show_users(); echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; foreach ($zones as $zone) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; } } echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " " . _('You are about to delete a user. This user is owner for a number of zones. Please decide what to do with these zones.') . "\n"; echo "
" . _('Zone') . "" . _('Delete') . "" . _('Leave') . "" . _('Add new owner') . "" . _('Owner to be added') . "
" . $zone['name'] . "\n"; echo " \n"; echo "
\n"; echo " " . _('Really delete this user?') . "\n"; echo "
\n"; echo " \n"; echo "
\n"; } } include_once("inc/footer.inc.php");