} // if organization change, delete old organization permitted users from teams if ($clod != $projectDetail->pro_organization[0]) { $tmpquery = "WHERE tea.project = '{$id}' AND mem.profil = '3'"; $suppTeamClient = new request(); $suppTeamClient->openTeams($tmpquery); $comptSuppTeamClient = count($suppTeamClient->tea_id); if ($comptSuppTeamClient == '0') { for ($i = 0; $i < $comptSuppTeamClient; $i++) { $membersTeam .= $suppTeamClient->tea_mem_id[$i]; if ($i < $comptSuppTeamClient - 1) { $membersTeam .= ','; } if ($htaccessAuth == 'true') { $Htpasswd->initialize('../files/' . $id . '/.htpasswd'); $Htpasswd->deleteUser($suppTeamClient->mem_login[$i]); } } $tmpquery4 = 'DELETE FROM ' . $tableCollab['teams'] . " WHERE project = '{$id}' AND member IN({$membersTeam})"; connectSql($tmpquery4); } } // ------------------------------------------------------------------------------------------------- $tmpquery = "WHERE pro.id = '{$id}'"; $targetProject = new request(); $targetProject->openProjects($tmpquery); // Delete old or unused phases if ($targetProject->pro_phase_set[0] != $thisPhase) { $tmpquery = 'DELETE FROM ' . $tableCollab['phases'] . " WHERE project_id = {$id}"; connectSql($tmpquery); }
header("Location: ../projects/listprojects.php?msg=blank"); exit; } if ($action == "delete") { $id = str_replace("**", ",", $id); $pieces = explode(",", $id); if ($htaccessAuth == "true") { require_once "../includes/htpasswd.class.php"; $Htpasswd = new Htpasswd(); $Htpasswd->initialize("../files/" . $projectDetail->pro_id[0] . "/.htpasswd"); $tmpquery = "WHERE mem.id IN({$id})"; $listMembers = new request(); $listMembers->openMembers($tmpquery); $comptListMembers = count($listMembers->mem_id); for ($i = 0; $i < $comptListMembers; $i++) { $Htpasswd->deleteUser($listMembers->mem_login[$i]); } } // if mantis bug tracker enabled if ($enableMantis == "true") { // include mantis library require_once "../mantis/core_API.php"; } $compt = count($pieces); for ($i = 0; $i < $compt; $i++) { $tmpquery1 = "DELETE FROM " . $tableCollab["teams"] . " WHERE member = '{$pieces[$i]}'"; connectSql("{$tmpquery1}"); // if mantis bug tracker enabled if ($enableMantis == "true") { // Unassign user from this project in mantis $f_project_id = $project;
$errors[] = $e->getMessage(); } } else { $errors[] = "User {$username} already exists"; } } else { $errors[] = "Username or password not set"; } } if ($_REQUEST['action'] == "delete") { $username = trim($_REQUEST['username']); if ($username) { if (($key = array_search($username, $users)) !== false) { try { $htpasswd = new Htpasswd($HTPASSWD_FP); $htpasswd->deleteUser($username); $messages[] = "User {$username} has been removed successfully"; unset($users[$key]); } catch (Exception $e) { $errors[] = $e->getMessage(); } } else { $errors[] = "User {$username} not found"; } } } } ?> <html lang="en"> <head> <meta charset="utf-8">