home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / FAQ / discus_admin_1357211388 / source / contact.pl < prev    next >
Text File  |  2009-11-06  |  2KB  |  60 lines

  1. # FILE: contact.pl
  2. # DESCRIPTION: Contact Moderators
  3. #-------------------------------------------------------------------------------
  4. # DISCUS COPYRIGHT NOTICE
  5. #
  6. # Discus is copyright (c) 2002 by DiscusWare, LLC, all rights reserved.
  7. # The use of Discus is governed by the Discus License Agreement which is
  8. # available from the Discus WWW site at:
  9. #    http://www.discusware.com/discus/license
  10. #
  11. # Pursuant to the Discus License Agreement, this copyright notice may not be
  12. # removed or altered in any way.
  13. #-------------------------------------------------------------------------------
  14.  
  15. use strict;
  16. use vars qw($GLOBAL_OPTIONS $DCONF $PARAMS);
  17.  
  18. ###
  19. ### contact_control
  20. ###
  21. ### Controls contact information functions
  22. ###
  23.  
  24. sub contact_control {
  25.     dreq("template");
  26.     my $FORMref = parse_form($ENV{'QUERY_STRING'}, $ENV{'CONTENT_LENGTH'});
  27.     contact_first($FORMref) if $FORMref->{action} eq "";
  28. }
  29.  
  30. ###
  31. ### contact_first
  32. ###
  33. ### Lists moderators on the board
  34. ###
  35.  
  36. sub contact_first {
  37.     my ($FORMref) = @_;
  38.     dreq("authpass", "fcn-priv");
  39.     my $ml = read_account_file("passwd", undef, { returnformat => "single_array" } );
  40.     my @mod = sort { $a->{user} cmp $b->{user} } @{ $ml };
  41.     my $tpf = read_privilege_file();
  42.     my $x = read_tree(undef, { no_lock => 1, no_unlock => 1, zero_ok => 1 });
  43.     my $cookie = "";
  44.     if ($DCONF->{pro} && $GLOBAL_OPTIONS->{topics_to_show} == 1) {
  45.         dreq("authwrap-PRO");
  46.         ($x, $cookie) = tree_list_simple_prune($x, $FORMref);
  47.     }
  48.     foreach my $m (@mod) {
  49.         my $y = $tpf->{by_mod}->{$m->{user}};
  50.         my @k = grep($y->{$_->{topic}} == 1, @{ $x });
  51.         $m->{topics} = \@k;
  52.     }
  53.     @mod = grep($_->{user} ne $DCONF->{superuser}, @mod) if $GLOBAL_OPTIONS->{contact_hide_admin};
  54.     my $subst = {};
  55.     $subst->{moderators} = \@mod;
  56.     screen_out("contact1", $subst, $cookie);
  57. }
  58.  
  59. 1;
  60.