9 namespace Fossology\UI\Page;
14 use Symfony\Component\HttpFoundation\Request;
15 use Symfony\Component\HttpFoundation\Response;
24 const NAME =
'group_delete';
26 function __construct()
28 parent::__construct(self::NAME, array(
29 self::TITLE => _(
"Delete Group"),
30 self::MENU_LIST =>
"Admin::Groups::Delete Group",
32 self::REQUIRES_LOGIN => TRUE
40 protected function handle(Request $request)
47 $groupMap = $userDao->getDeletableAdminGroupMap($userId,
50 $groupId = $request->get(
'grouppk');
51 if (! empty($groupId)) {
53 $userDao->deleteGroup($groupId);
54 $vars[
'message'] = _(
"Group") .
' ' . $groupMap[$groupId] .
' ' . _(
"deleted") .
'.';
55 unset($groupMap[$groupId]);
56 }
catch (\Exception $e) {
57 $vars[
'message'] = $e->getMessage();
61 if (empty($groupMap)) {
62 $vars[
'content'] = _(
"You have no groups you can delete.");
63 return $this->
render(
'include/base.html.twig', $this->mergeWithDefault($vars));
65 $vars[
'groupMap'] = $groupMap;
67 $vars[
'groupMap'] = $groupMap;
68 return $this->
render(
'admin_group_delete.html.twig', $this->mergeWithDefault($vars));
Contains the constants and helpers for authentication of user.
static getUserId()
Get the current user's id.
render($templateName, $vars=null, $headers=null)
Traceback_uri()
Get the URI without query to this location.