#!/usr/bin/perl #------------------------------------------------------------------------------ # mwForum - Web-based discussion forum # Copyright (c) 1999-2015 Markus Wichitill # # 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. #------------------------------------------------------------------------------ use strict; use warnings; no warnings qw(uninitialized redefine); # Imports use MwfMain; #------------------------------------------------------------------------------ # Init my ($m, $cfg, $lng, $user, $userId) = MwfMain->new($_[0]); # Check if user is admin $user->{admin} or $m->error('errNoAccess'); # Print header $m->printHeader(); # Print page bar my @navLinks = ({ url => $m->url('forum_show'), txt => 'comUp', ico => 'up' }); $m->printPageBar(mainTitle => "Group Administration", navLinks => \@navLinks); # Print create board form print "
\n", "
\n", "
Create Group
\n", "
\n", $m->submitButton("Create", 'group'), $m->stdFormFields(), "
\n", "
\n", "
\n\n"; # Get groups my $groups = $m->fetchAllHash(" SELECT id, title FROM groups ORDER BY title"); # Print group list print "\n", "\n", "\n", "\n", "\n"; for my $group (@$groups) { my $groupId = $group->{id}; my $infUrl = $m->url('group_info', gid => $groupId); my $optUrl = $m->url('group_options', gid => $groupId, ori => 1); my $mbrUrl = $m->url('group_members', gid => $groupId); my $brdUrl = $m->url('group_boards', gid => $groupId, ori => 1); my $delUrl = $m->url('user_confirm', gid => $groupId, script => 'group_delete', name => $group->{title}, ori => 1); print "\n", "\n", "\n"; } print "
TitleCommands
$group->{title}\n", "Opt\n", "Mbr\n", "Brd\n", "Del\n", "
\n\n"; # Log action and finish $m->logAction(3, 'group', 'admin', $userId); $m->printFooter(); $m->finish();