True, "nonavbar" => True);
}
if (! $group_id)
Header("Location: " . $phpgw->link("groups.php"));
$phpgw_flags["currentapp"] = "admin";
include("../header.inc.php");
// I would like to have an option to auto remove users from the group
if (($group_id) && (! $confirm)) {
$phpgw->db->query("select group_name from groups where group_id='$group_id'");
$phpgw->db->next_record();
$group_name = $phpgw->db->f("group_name");
$phpgw->db->query("select con,loginid from accounts where groups like '%$group_id%'");
if ($phpgw->db->num_rows()) {
echo '
';
echo lang_admin("Sorry, the follow users are still a member of the group x",$group_name)
. '
' . lang_admin("They must be removed before you can continue")
. '';
echo '";
exit;
}
?>
include($phpgw_info["server"]["api_dir"] . "/footer.inc.php");
}
if ($confirm) {
$phpgw->db->query("select group_name from groups where group_id='$group_id'");
$phpgw->db->next_record();
$group_name = $phpgw->db->f("group_name");
$phpgw->db->query("delete from groups where group_id='$group_id'");
$sep = $phpgw->common->filesystem_sepeartor();
$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep
. "groups" . $sep;
if (! @rmdir($basedir . $group_name)) {
$cd = 38;
} else {
$cd = 32;
}
Header("Location: " . $phpgw->link("groups.php","cd=$cd"));
}