# ================================================================== # Gossamer Forum - Advanced web community # # Website : http://gossamer-threads.com/ # Support : http://gossamer-threads.com/scripts/support/ # Revision : $Id: Admin.pm,v 1.15 2002/03/04 07:40:26 jagerman Exp $ # # Copyright (c) 2001 Gossamer Threads Inc. All Rights Reserved. # Redistribution in part or in whole strictly prohibited. Please # see LICENSE file for full details. # ================================================================== package GForum::Admin; # ================================================================== use strict; use GForum qw/$DB $CFG/; use GT::SQL::Admin; use vars qw/@ISA $ERROR_MESSAGE $VERSION $DEBUG $FONT $ROW_COLOR1 $ROW_COLOR2/; # This line is annoying constants GT::SQL::Admin uses. @ISA = qw/GT::SQL::Admin/; $VERSION = sprintf "%d.%03d", q$Revision: 1.15 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0; $ERROR_MESSAGE = 'GT::SQL'; $ROW_COLOR1 = $GT::SQL::Admin::ROW_COLOR1; $ROW_COLOR2 = $GT::SQL::Admin::ROW_COLOR2; $FONT = $GT::SQL::Admin::FONT; sub _check_opts { # ------------------------------------------------------------------- # This is overriden to allow searching by moderators, subscribers, or system group permissions # for the Forum table. # my $self = shift; my $sel = 0; my $cols = $self->{table}->cols; for (keys %{$self->{cgi}}) { if ($self->{cgi}->{$_} =~ /\S/ and exists $cols->{$_}) { $sel = 1; last; } } if (exists $self->{cgi}->{query} and $self->{cgi}->{query} =~ /\S/ or exists $self->{cgi}->{keyword} and $self->{cgi}->{keyword} =~ /\S/) { $sel = 1; } my $prefix = $DB->prefix; if (!$sel and $self->{table}->name eq $prefix . 'Forum' and $self->{cgi}->{'ForumModerator.user_id_fk'} || $self->{cgi}->{'ForumSubscriber.user_id_fk'}) { $sel = 1; } if (!$sel and $self->{table}->name eq $prefix . 'User' and exists $self->{cgi}->{'UserGroup.group_id_fk'}) { $sel = 1; } return $sel; } sub _buttons { # ------------------------------------------------------------------- # Adds a warning message to delete Users, Posts, and Categories. # my $self = shift; my $name = shift; my $table = $self->{record}; my $msg = ''; if ($self->{record} eq 'Forum' and $name eq 'Delete') { $msg = qq~
Warning: deleting a forum will also delete all posts contained within that forum!
~; } elsif ($self->{record} eq 'Category' and $name eq 'Delete') { $msg = qq~Warning: deleting a category will also delete all forums in that category and any posts in those forums!
~; } elsif ($self->{record} eq 'Post' and $name eq 'Delete') { $msg = qq~Warning: deleting a post will also delete any direct or indirect replies to that post!
~; } elsif ($self->{record} eq 'Forum' and $name eq 'Add' and not $DB->table('Category')->count) { return ''; } my $ret = ''; $table = 'Group' if $table eq 'Grouping'; return qq~\n$ret
|
Pages: "; $speedbar .= $self->{html}->toolbar($self->{cgi}->{nh} || 1, $self->{cgi}->{mh} || 25, $hits, $name); $speedbar .= "
\n"; print $speedbar; } if ( $self->{in}->param('dr') and $self->{in}->param('dr') eq 'rows' ) { print qq!
|
", $self->_footer; print $self->_end_html; } 1;