delete_user.php
changeset 126 cb06e3e29ed8
parent 119 f74e4f88b680
child 185 6baa2f78d3fe
equal deleted inserted replaced
125:700a3674b72e 126:cb06e3e29ed8
    20  */
    20  */
    21 
    21 
    22 require_once("inc/toolkit.inc.php");
    22 require_once("inc/toolkit.inc.php");
    23 include_once("inc/header.inc.php");
    23 include_once("inc/header.inc.php");
    24 
    24 
    25 verify_permission(user_edit_own) ? $perm_edit_own = "1" : $perm_edit_own = "0" ;
    25 verify_permission('user_edit_own') ? $perm_edit_own = "1" : $perm_edit_own = "0" ;
    26 verify_permission(user_edit_others) ? $perm_edit_others = "1" : $perm_edit_others = "0" ;
    26 verify_permission('user_edit_others') ? $perm_edit_others = "1" : $perm_edit_others = "0" ;
    27 
    27 
    28 if (!(isset($_GET['id']) && v_num($_GET['id']))) {
    28 if (!(isset($_GET['id']) && v_num($_GET['id']))) {
    29 	error(ERR_INV_INPUT);
    29 	error(ERR_INV_INPUT);
    30 	include_once("inc/footer.inc.php");
    30 	include_once("inc/footer.inc.php");
    31 	exit;
    31 	exit;
    37 	if (delete_user($uid,$_POST['zone'])) {
    37 	if (delete_user($uid,$_POST['zone'])) {
    38 		success(SUC_USER_DEL);	
    38 		success(SUC_USER_DEL);	
    39 	}
    39 	}
    40 } else {
    40 } else {
    41 
    41 
    42 	if (($uid != $_SESSION['userid'] && !verify_permission(user_edit_others)) || ($uid == $_SESSION['userid'] && !verify_permission(user_edit_own))) {
    42 	if (($uid != $_SESSION['userid'] && !verify_permission('user_edit_others')) || ($uid == $_SESSION['userid'] && !verify_permission('user_edit_own'))) {
    43 		error(ERR_PERM_DEL_USER);
    43 		error(ERR_PERM_DEL_USER);
    44 		include_once("inc/footer.inc.php");
    44 		include_once("inc/footer.inc.php");
    45 		exit;
    45 		exit;
    46 	} else {
    46 	} else {
    47 		$fullname = get_fullname_from_userid($uid);
    47 		$fullname = get_fullname_from_userid($uid);