home *** CD-ROM | disk | FTP | other *** search
/ ftp.sunet.sepub/pictures / 2014.11.ftp.sunet.se-pictures.tar / ftp.sunet.se / pub / pictures / ACiD-artpacks / www / mirrors / acheron / cgi-bin / discus / board-admin-menuonly.cgi < prev    next >
Text File  |  1999-01-26  |  7KB  |  194 lines

  1. #!/usr/bin/perl
  2. $discus_conf = '/usr/local/www/www.acheron.org/discus_admin_245059122/discus.conf';
  3. #Discus board administration (menu only) script
  4. #-------------------------------------------------------------------------------
  5. # This script is copyright (c) 1998 by DiscusWare, LLC, all rights reserved.
  6. # Its use is subject to the license agreement that can be found at the following
  7. # URL:  http://www.chem.hope.edu/discus/license
  8. #-------------------------------------------------------------------------------
  9. if (open (FILE, "$discus_conf")) {
  10.     @file = <FILE>;
  11.     close (FILE);
  12.     $evals = "";
  13.     foreach $line (@file) {
  14.         if ($line =~ /^(\w+)=(.*)/) {
  15.             $varname = $1;
  16.             $value = $2;
  17.             $value =~ s/'/\\'/g; $value =~ s/\r//g;
  18.             $evals .= "\$$varname='$value'; ";
  19.         }
  20.     }
  21.     eval($evals);
  22.     require "$admin_dir/source/src-board-subs-common";
  23. } else {
  24.     print "Content-type: text/html\n\n";
  25.     print "<HTML><HEAD><TITLE>Script Execution Error</TITLE></HEAD>\n";
  26.     print "<BODY BGCOLOR=#ffffff TEXT=#000000>\n";
  27.     print "<H1>Script Execution Error</H1>\n";
  28.     print "Discus scripts could not execute because the discus.conf file\n";
  29.     print "could not be opened.";
  30.     print "<P>Reason: <FONT COLOR=#ff0000><B>$!</B></FONT>" if $!;
  31.     print "<P>This generally indicates a setup error of some kind.\n";
  32.     print "Consult the <A HREF=\"http://www.chem.hope.edu/discus/rc\">Discus ";
  33.     print "Resource Center</A> for troubleshooting information.</BODY></HTML>\n";
  34.     exit(0);
  35. }
  36. require "$admin_dir/source/src-board-subs-admin";
  37. &parse_form;
  38. &read_cookie;
  39. if ($FORM{'action'} eq 'mgr_1') {
  40.     &check_passwd;
  41.     &ex('page_mgr_1', $FORM{"username"});
  42.     exit(0);
  43. }
  44. if ($FORM{'cmd'} eq "backup_mgr") {
  45.     &check_passwd;
  46.     &error_message("Permissions Error", "Only the superuser may access this functionality") if $FORM{'username'} ne $superuser;
  47.     &ex('backup_mgr', 1);
  48.     exit(0);
  49. }
  50. if ($FORM{'action'} eq 'access_mgr_1') {
  51.     &check_passwd;
  52.     &ex('page_mgr_1', $FORM{"username"}, 2);
  53.     exit(0);
  54. }
  55. if ($FORM{'cmd'} eq 'log_analy') {
  56.     &check_passwd;
  57.     &ex('log_analysis_1', $FORM{"username"});
  58.     exit(0);
  59. }
  60. if ($FORM{'cmd'} eq 'archive_mgr') {
  61.     &check_passwd;
  62.     &error_message("Permissions Error", "Only the superuser may access this functionality") if $FORM{'username'} ne $superuser;
  63.     &ex('archive_mgr', 1);
  64.     exit(0);
  65. }
  66. if ($FORM{'cmd'} eq 'options_mgr') {
  67.     &check_passwd;
  68.     &error_message("Permissions Error", "Only the superuser may access this functionality") if $FORM{'username'} ne $superuser;
  69.     &ex('options_mgr', 1);
  70.     exit(0);
  71. }
  72. if ($FORM{'cmd'} eq 'profanity_editor') {
  73.     &check_passwd;
  74.     &error_message("Permissions Error", "Only the superuser may access this functionality") if $FORM{'username'} ne $superuser;
  75.     &ex('profanity_editor', 1);
  76.     exit(0);
  77. }
  78. if ($FORM{'cmd'} eq 'email_configurator') {
  79.     &check_passwd;
  80.     &error_message("Permissions Error", "Only the superuser may access this functionality") if $FORM{'username'} ne $superuser;
  81.     &ex('email_configurator', 1);
  82.     exit(0);
  83. }
  84. if ($FORM{'action'} eq 'queue_mgr_1') {
  85.     &check_passwd;
  86.     &ex('queue_mgr_1', $FORM{'username'}) if $pro;
  87.     exit(0);
  88. }
  89. if ($FORM{'action'} eq 'queue_mgr_disp') {
  90.     &check_passwd;
  91.     &ex('queue_mgr_disp', $FORM{'username'}, $FORM{'number'}) if $pro;
  92.     exit(0);
  93. }
  94. if ($FORM{'action'} eq 'queue_frames') {
  95.     &check_passwd;
  96.     &ex('queue_frames', $FORM{'username'}) if $pro;
  97.     exit(0);
  98. }
  99. if ($FORM{'action'} eq 'access_mgr_2') {
  100.     &check_passwd;
  101.     &extract($FORM{'HTTP_REFERER'});
  102.     &verify_owner($owner,$FORM{'username'}) || &error_message("Permissions Error", "You do not have permission to edit the selected topic!");
  103.     &ex('access_mgr_2', $topic_number, $FORM{'username'}) if !$pro;
  104.     &ex('access_mgr_2_pro', $topic_number, $FORM{'username'}) if $pro;
  105.     exit(0);
  106. }
  107. if ($FORM{'action'} eq "page_editor") {
  108.     &check_passwd;
  109.     &extract($FORM{'HTTP_REFERER'});
  110.     &verify_owner($owner,$FORM{'username'}) || &error_message("Permissions Error", "You do not have permission to edit the selected topic!");
  111.     $refer = "//$FORM{'HTTP_REFERER'}";
  112.     &ex("page_mgr_2", $refer,$FORM{"username"});
  113. }
  114. if ($FORM{'action'} eq "graphic_browser") {
  115.     &check_passwd;
  116.     &extract ($FORM{'HTTP_REFERER'});
  117.     &ex('graphic_browser_select', $topic_number, $me_number, $FORM{'username'});
  118.     exit(0);
  119. }
  120. if ($FORM{'cmd'} eq "board_mgr") {
  121.     &check_passwd;
  122.     &error_message("Permissions Error", "Only the superuser may access the board manager!") if $FORM{'username'} ne $superuser;
  123.     &ex('board_manager', $FORM{"username"}); exit(0);
  124. }
  125. if ($FORM{'cmd'} eq "data_recovery") {
  126.     &check_passwd;
  127.     &error_message("Permissions Error", "Only the superuser may access the data recovery utility!") if $FORM{'username'} ne $superuser;
  128.     &ex('data_recovery', $FORM{"username"}); exit(0);
  129. }
  130. if ($FORM{'cmd'} eq "moderator_mgr") {
  131.     &check_passwd;
  132.     &error_message("Permissions Error", "Only the superuser may access the moderator manager!") if $FORM{'username'} ne $superuser;
  133.     &ex('moderator_mgr', $FORM{"username"});
  134.     exit(0);
  135. }
  136. if ($FORM{'action'} eq "viewmessage") {
  137.     &check_passwd;
  138.     &extract ($FORM{'HTTP_REFERER'});
  139.     &verify_owner($owner,$FORM{'username'}) || &error_message("Permissions Error", "You do not have permission to view messages in this topic!");
  140.     $file = "$message_dir/$topic_number/$me_number.$ext";
  141.     $post = $FORM{'num'};
  142.     &ex('viewmessage', $topic_number, $me_number, $post);
  143.     exit(0);
  144. }
  145. if ($FORM{'action'} eq 'menu' || $FORM{'cmd'} eq 'menu') {
  146.     $COOKIE{'pass' . $COOKIE_ID} = "";
  147.     $pass = &check_passwd(1,1);
  148.     $flag = 1 if $pass eq "* BLANK *";
  149.     if ($GLOBAL_OPTIONS{'admin'} == 0 && $GLOBAL_OPTIONS{'options_used'} == 1) {
  150.         &error_message("Administration Disabled", "Administration has been disabled on this board for all moderators except the superuser.") if $FORM{'username'} ne $superuser;
  151.     }
  152.     &ex('admin_main_menu',$FORM{"username"}, $pass, $flag);
  153.     exit(0);
  154. }
  155. if ($FORM{'action'} eq 'first_pass') {
  156.     $pass = &check_passwd(0,1);
  157.     &error_message("Permissions Error", "Only the superuser may access this!") if $FORM{'username'} ne $superuser;
  158.     &ex('first_pass', $FORM{"username"});
  159.     exit(0);
  160. }
  161. if ($FORM{'cmd'} eq "group_mgr") {
  162.     &check_passwd;
  163.     &error_message("Permissions Error", "Only the superuser may access the group manager!") if $FORM{'username'} ne $superuser;
  164.    &ex('group_mgr', $FORM{"username"}); exit(0);
  165. }
  166. if ($FORM{'cmd'} eq "user_mgr") {
  167.     &check_passwd;
  168.     &ex('user_mgr_1', $FORM{"username"});
  169.     exit(0);
  170. }
  171. if ($FORM{'cmd'} eq "user_mgr_2") {
  172.     &check_passwd;
  173.     &verify_owner($FORM{'group'},$FORM{'username'}) || &error_message("Permissions Error", "You do not have permission to edit users in this group!");
  174.     &ex('user_mgr_2', $FORM{"username"}, $FORM{"group"});
  175.     exit(0);
  176. }
  177. if ($FORM{'cmd'} eq "version_mgr") {
  178.     &check_passwd;
  179.     &error_message("Permissions Error", "Only the superuser may access the version manager!") if $FORM{'username'} ne $superuser;
  180.     &ex('version_manager', 1);
  181.     exit(0);
  182. }
  183. if ($FORM{'cmd'} eq "reg_configurator") {
  184.     &check_passwd;
  185.     &error_message("Permissions Error", "Only the superuser may access the version manager!") if $FORM{'username'} ne $superuser;
  186.     &ex('reg_configurator', 1);
  187.     exit(0);
  188. }
  189. if ($FORM{'cmd'} eq "start") {
  190.     &ex('admin_from_here', 1);
  191. }
  192. &ex("front_page", 1);
  193. exit(0);
  194.