package WebGUI::Operation::Group;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001 Plain Black Software.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use Exporter;
use strict;
use Tie::CPHash;
use WebGUI::Form;
use WebGUI::International;
use WebGUI::Privilege;
use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Utility;
our @ISA = qw(Exporter);
our @EXPORT = qw(&www_addGroup &www_addGroupSave &www_deleteGroup &www_deleteGroupConfirm &www_editGroup &www_editGroupSave &www_listGroups);
#-------------------------------------------------------------------
sub www_addGroup {
my ($output);
if (WebGUI::Privilege::isInGroup(3)) {
$output .= '
';
$output .= '
';
$output .= ''; $output .= '
'; return $output; } else { return WebGUI::Privilege::adminOnly(); } } #------------------------------------------------------------------- sub www_deleteGroupConfirm { if ($session{form}{gid} < 26) { return WebGUI::Privilege::vitalComponent(); } elsif (WebGUI::Privilege::isInGroup(3)) { WebGUI::SQL->write("delete from groups where groupId=$session{form}{gid}",$session{dbh}); WebGUI::SQL->write("delete from groupings where groupId=$session{form}{gid}",$session{dbh}); return www_listGroups(); } else { return WebGUI::Privilege::adminOnly(); } } #------------------------------------------------------------------- sub www_editGroup { my ($output, $sth, %group, @user); tie %group, 'Tie::CPHash'; if (WebGUI::Privilege::isInGroup(3)) { %group = WebGUI::SQL->quickHash("select * from groups where groupId=$session{form}{gid}",$session{dbh}); $output .= '
';
$output .= '
';
$output .= '