# FILE: src-board-subs-5 #------------------------------------------------------------------------------- # This script is copyright (c) 1998 by DiscusWare, LLC, all rights reserved. # Its use is subject to the license agreement that can be found at the following # URL: http://www.chem.hope.edu/discus/license #------------------------------------------------------------------------------- #---SEPARATOR---# #REQ:extract_colorsonly sub preview_admin_message { local ($message_source, $message_formatted, $username, $referer, $action, $mtitle) = @_; &header; print "Preview of $mtitle\n"; print "\n"; ($bgcolor, $text, $link, $vlink, $alink, $face, $size, $img) = &extract_colorsonly; print "$fs\n"; print "
Preview of $mtitle
\n
\n"; if ($mtitle eq "About Message" || $mtitle eq "Announcement") { local (@array) = ("$topic_number:$topic_name"); foreach $key (sort by_number keys(%level_number)) { push (@array, "$level_number{$key}:$level_name{$key}"); } print "Page Manager:\n"; foreach $line (@array) { ($number,$name) = split(/:/, $line, 2); print ""; print "$name"; print ": \n"; } } elsif ($mtitle eq "Main Message" || $mtitle eq "Title Message" || $mtitle eq "Topic Description") { print "Board Manager:\n"; } elsif ($mtitle eq "Welcome Message") { print "Options Manager: "; print "Self Registration Configurator: "; } print "Preview of $mtitle\n"; print "

\n"; print "A preview of your message appears below. If you used any "; print "formatting tags in your message, please check to see that your "; print "formatting is displayed correctly in the preview.

\n"; print "\n"; print "
$message_formatted"; print "

\n"; print "


Revise $mtitle

\n"; print "
"; print "
\n" if ($mtitle eq "About Message" || $mtitle eq "Announcement"); print "\n" if ($mtitle eq "Main Message" || $mtitle eq "Topic Description" || $mtitle eq "Title Message"); print "\n" if ($mtitle eq "Welcome Message"); print "

\n\n"; print "\n"; print "\n"; print "\n"; print "\n" if $message_formatted !~ /

FORMATTING/i; print "\n" if $referer; print "

\n"; exit(0); } #---SEPARATOR---# sub change_about_message { local ($file, $source, $formatted) = @_; local (@file, $messageflag, $line, $source_esc, $topic, $page); if ($file =~ m|/(\d+)/(\d+)\.$ext|) { ($topic, $page) = ($1, $2); } else { &error_message("Change About Message Error", "Could not open requested file"); } &lock("$message_dir/$topic/$page.$ext"); local ($head, $color, $lm, $ann, $ann_src, $sublist, $about, $about_src, $message, $message_src) = &get_page($topic, $page); &set_page($topic, $page, $head, $color, $lm, $ann, $ann_src, $sublist, $formatted, &escape($source), $message, $message_src); &unlock("$message_dir/$topic/$page.$ext"); } #---SEPARATOR---# #REQ:recurse sub remove_page { local ($topic_number, $parent, $page_number) = @_; local ($pn, @pn, @lines, $line, $filename, $filenumber, @ps); @pn = split(/,/, $page_number); foreach $pn (@pn) { $pn =~ s/^0//g; } &lock("$message_dir/$topic_number/$parent.$ext"); local ($head, $color, $lm, $ann, $ann_src, $sublist, $about, $about_src, $message, $message_src) = &get_page($topic_number, $parent); @lines = split(/\n/, $sublist); foreach $line (@lines) { $filenumber = "-NONE-"; $filenumber = $1 if $line =~ m||; $filenumber = $1 if $line =~ m||; if (grep(/^$filenumber$/, @pn)) { $line = ""; push (@ps, $filenumber); } } $sublist = join("\n", grep(/\S/, @lines)); &set_page($topic_number, $parent, $head, $color, $lm, $ann, $ann_src, $sublist, $about, $about_src, $message, $message_src); &unlock("$message_dir/$topic_number/$parent.$ext"); foreach $filenumber (@ps) { &recurse ($topic_number, $filenumber, "delete"); } } #---SEPARATOR---# #REQ:get_date_time #REQ:manage_images #REQ:manage_attachments #REQ:reapply_webtags sub move_page { local ($old_topic, $page_number, $old_parent, $new_topic, $new_parent) = @_; return 1 if ($old_topic == $new_topic && $old_parent == $new_parent); &lock("$message_dir/$old_topic/$old_parent.$ext"); local ($head1, $color1, $lm1, $ann1, $ann_src1, $sublist1, $about1, $about_src1, $message1, $message_src1) = &get_page($old_topic, $old_parent); local (@temp, $headstr, $nextkey, $owner, $line, $param, @tomove, $temp, @pn); local ($t1, $t2, $t3); undef @message_move_move_page; @pn = split(/,/, $page_number); @temp = split(/\n/, $sublist1); foreach $line (@temp) { $line =~ m||; $temp = $2; if (grep(/^$temp$/, @pn)) { push (@tomove, $line) if ($old_topic != $new_topic || $old_parent != $new_parent); $line = ""; } } $sublist1 = join("\n", grep(/\S/, @temp)); &set_page($old_topic, $old_parent, $head1, $color1, $lm1, $ann1, $ann_src1, $sublist1, $about1, $about_src1, $message1, $message_src1); &unlock("$message_dir/$old_topic/$old_parent.$ext"); &lock("$message_dir/$new_topic/$new_parent.$ext"); local ($head2, $color2, $lm2, $ann2, $ann_src2, $sublist2, $about2, $about_src2, $message2, $message_src2) = &get_page($new_topic, $new_parent); if ($new_topic != $old_topic) { foreach $line (@tomove) { $line =~ s|/messages/$old_topic/(\d+).$ext|/messages/$new_topic/$1.$ext|g; } } $sublist2 .= join("\n", @tomove); @temp = split(/\n/, $head2); foreach $line (@temp) { if ($line =~ m||) { $owner = $1; } elsif ($line =~ m||) { ($t1, $t2, $t3) = ($1, $2, $3); $headstr .= "$line\n"; $nextkey = $t1; } elsif ($line =~ m||) { $param = $1; } } $nextkey += 1; &set_page($new_topic, $new_parent, $head2, $color2, $lm2, $ann2, $ann_src2, $sublist2, $about2, $about_src2, $message2, $message_src2); &unlock("$message_dir/$new_topic/$new_parent.$ext"); foreach $line (@tomove) { if ($line =~ m||) { ®enerate_pages($headstr, $old_topic, $1, "", $owner, $new_topic, $nextkey, $new_parent); } } if (scalar(@message_move_move_page)) { local (@LOG); &lock("$admin_dir/log.txt"); open (LOG, "$admin_dir/log.txt"); @LOG = ; close (LOG); local ($indx, $who, $when, $where, $rest); foreach $line (@LOG) { ($indx, $who, $when, $where, $rest) = split(/;/, $line, 5); if (grep(/^$indx$/, @message_move_move_page)) { ($tpc, $page) = split(/\//, $where); $line = join(";", $indx, $who, $when, "$new_topic/$page", $rest); } } open (LOG, ">$admin_dir/log.txt"); print LOG @LOG; close (LOG); &unlock("$admin_dir/log.txt"); } } sub regenerate_pages { local ($headstr, $topic, $page, $additional, $owner, $new_topic, $nextkey, $parent) = @_; &lock("$message_dir/$topic/$page.$ext"); local ($head1, $color1, $lm1, $ann, $ann_src, $sublist1, $about1, $about_src1, $message1, $message_src1) = &get_page($topic, $page); &unlock("$message_dir/$topic/$page.$ext"); local ($line, @head, $newhead, $me_name, $param, $me_number); @head = split(/\n/, $head1); foreach $line (@head) { if ($line =~ m||) { ($me_number, $me_name) = ($1, $2); } elsif ($line =~ m||) { $param = $1; } } $newhead = $headstr; $newhead .= $additional; $newhead .= "\n"; $additional .= "\n"; $nextkey += 1; $newhead .= "\n"; $newhead .= "\n"; $newhead .= "\n"; $newhead .= "\n"; local ($numb, $exten, @msg); &unlock("$message_dir/$topic/$page.$ext"); @msg = split(/\n/, $sublist1); foreach $line (@msg) { if ($line =~ m||) { $numb = $1; if ($new_topic != $topic) { $line =~ s|/messages/$topic/(\d+).$ext|/messages/$new_topic/$1.$ext|g; } ®enerate_pages($headstr, $topic, $numb, $additional, $owner, $new_topic, $nextkey, $me_number); } } $sublist1 = join("\n", @msg); $p_temp = $message1; while ($p_temp =~ m||) { push (@message_move_move_page, $1); $p_temp = join("", $`, $'); } undef @files_move; @files_move = &manage_images(&unescape($message_src1), $topic, 0, "list"); @files_move_2 = &manage_attachments(&unescape($message_src1), $topic, 0, "list") if $pro; foreach $f (@files_move_2) { push (@files_move, $f); } if (scalar(@files_move) > 0) { $topic_number = $new_topic; foreach $file_in (@files_move) { if ($file_in =~ m|^(.*)/(\d+)/([^/]+)$|) { $filename = $3; $dest = "$message_dir/$new_topic/$filename" if -e "$message_dir/$new_topic"; $dest = "$secdir/$new_topic/$filename" if -e "$secdir/$new_topic"; open (SRC, "$file_in"); eval 'binmode(SRC);'; @src = ; close (SRC); open (DEST, ">$dest"); eval 'binmode(DEST);'; print DEST @src; close (DEST); unlink($file_in); } } $message1 = &reapply_webtags($message_src1, $message1); } &set_page($new_topic, $page, $newhead, $color1, $lm1, $ann, $ann_src, $sublist1, $about1, $about_src1, $message1, $message_src1); if ($new_topic != $topic) { unlink ("$secdir/$topic/$page.$ext") if !-e "$html_dir/messages/$topic/$page.$ext"; unlink ("$html_dir/messages/$topic/$page.$ext") if -e "$html_dir/messages/$topic/$page.$ext"; } } #---SEPARATOR---# #REQ:determine_addmessage sub printuntil { local ($start, $finish, $topic_number, $title, $flag, $cache) = @_; if (!$cache) { ($template, $addfile) = &determine_addmessage($topic_number); @PrintUntil_FILE = split(/\n/, $template); if ($flag != 1) { ($bgcolor, $text, $link, $vlink, $alink, $face, $size, $image) = &ex('extract_colorsonly', 1); } foreach $line (@PrintUntil_FILE) { $line .= "\n"; while ($line =~ /\$(\w+)/) { $this = eval "\$$1"; $line = $` . $this . $'; } } } $cpos = 0; foreach $line (@PrintUntil_FILE) { if ($line =~ m||) { $cpos = 1; } elsif ($line =~ m||) { $cpos = 2; } elsif ($line =~ m||) { $cpos = 3; } elsif ($line =~ m||) { $cpos = 4; } elsif ($line =~ m||) { $cpos = 5; } elsif ($line =~ m||) { $cpos = 0; } elsif ($line =~ m||) { $cpos = 5; } elsif ($line =~ m||) { $cpos = 6; } elsif ($line =~ m||) { $cpos = 7; } elsif ($line =~ m||) { $cpos = 8; } elsif ($line =~ m||) { $cpos = 9; } elsif ($line =~ m||) { $cpos = 10; } elsif ($line =~ m||) { $cpos = 11; } elsif ($line =~ m||) { $cpos = 12; } elsif ($line =~ m||) { $cpos = 13; } elsif ($line =~ m||) { $cpos = 14; } elsif ($line =~ m||) { $cpos = 15; } elsif ($line =~ m|| && $cpos == 16) { $cpos = 17; } elsif ($line =~ m||) { # Skip } elsif ($line =~ m|^|) { # Skip } elsif ($start == $finish && $cpos == $start) { print $line if $line =~ /\S/; } elsif ($start != $finish && $cpos >= $start && $cpos <= $finish && $cpos % 2 == 1) { print $line if $line =~ /\S/; } } } #---SEPARATOR---# sub remove_swearing { local ($message_in, $code, $star_flag) = @_; if (open(CUSS, "$admin_dir/cuss.txt")) { @cuss = ; close (CUSS); @cuss = grep(!/^#/, @cuss); foreach $line (@cuss) { $line =~ s/\s//g; next if length($line) == 0; if ($line =~ m|!|) { $line = $'; $line =~ tr/a-zA-Z/b-zaB-ZA/; } $stars = "\\char{149}" x length($line); $stars = join("", "\\red{", $stars, "}") if $code != 3; $stars = "•" x length($line) if $star_flag; $message_in =~ s/\b$line\b/$stars/gi; } } return $message_in; } #---SEPARATOR---# sub access_mgr_2 { local ($topic, $username) = @_; local (@read, @post, $rl, $pl); &extract("//$topic/$topic.$ext"); open (SECURITY, "$admin_dir/posting.txt"); @post = ; close (SECURITY); ($pl) = grep(/^$topic:/, @post); open (SECURITY, "$admin_dir/postoptions.txt"); @options = ; close (SECURITY); ($ps) = grep(/^$topic:/, @options); open (GROUPS, "$admin_dir/groups.txt"); @grp = ; close (GROUPS); foreach $grp (@grp) { $grp =~ m|^(\w+):|; $grp = $1; } &header; print "Access Manager\n"; print "\n"; print '$fs\n"; print "
Access Editor: $topic_name
\n"; print "
Access Manager:\n"; print "Access Editor\n"; print "

Posting Privileges

"; print "
\n"; print "
\n"; ($topic, $ip, $usrgrp, $modgrp, $pass) = split(/:/, $pl); @usrgrp = split(/,/, $usrgrp); @modgrp = split(/,/, $modgrp); @ip = split(/,/, $ip); print "$fs\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "Unrestricted:
\n"; print "   Public Posting (anyone at all)"; print "

\n"; print "Restricted to:
\n"; print "   Moderators in this group (\u$owner)"; print "
\n"; print "   Users in this group (\u$owner)"; print "
\n"; print "   Moderators in every group"; print "
\n"; print "   Users in every group"; $ps =~ s/\s*$//; print "

\n"; ($topicnumb, $anon, $stamp, $emaild) = split(/:/, $ps); print " Disable anonymous posts\n"; print "
\n"; print " Disable e-mail link on posts\n"; print "
\n"; print " Disable full name on posts\n"; print "

\n"; print "\n"; print "

\n"; print "
\n"; print "\n"; } #---SEPARATOR---# sub send_email_message { local ($addresses, $subject_line, $text_out, $footer, $topic_number, $me_number) = @_; if ($GLOBAL_OPTIONS{'options_used'}) { if ($GLOBAL_OPTIONS{'capable'} eq "0") { return 0; } if ($GLOBAL_OPTIONS{'capable'} eq "" && $GLOBAL_OPTIONS{'email'} == 0) { return 0; } } # Important note: Each address in '$addresses' was checked in the calling # subroutine to meet the following pattern: # m|^([\w\-\+\.]+)\@([\w\-\+\.]+)$| undef %email; # The following code checks for an "email.txt" file in your source directory # and if it exists, it uses it. We use this in our demonstration service, # although it is unlikely that anyone else would need to use this. if (open(CFG, "$admin_dir/source/email.txt")) { @cfg = ; close (CFG); } elsif (open (CFG, "$admin_dir/email.txt")) { @cfg = ; close (CFG); } else { return 0; } foreach $line (@cfg) { if ($line =~ m|^(\w+)=(.*)|) { $o = $1; $t = $2; $t = &unescape($t) if $t !~ /\s/; $email{$o} = $t; } } $command = $email{'command_line'}; $input = $email{'input_stream'}; $command =~ s/\$SUBJECT/$subject_line/g; $input =~ s/\$SUBJECT/$subject_line/g; $command =~ s/\$REPLYTO/$reply_to/g; $input =~ s/\$REPLYTO/$reply_to/g; if ($email{'1message'} == 1) { @addresses = split(/,/, $addresses); foreach $line (@addresses) { ($email, $user, $pass) = split(/\|\|/, $line); $line = $email; } $addresses = join(",", @addresses); $command =~ s/\$BCC/$addresses/g; $input =~ s/\$BCC/$addresses/g; if ($email{'tempfile'} == 0) { open (MAIL, $command); } else { $pid = $$; $pid =~ s/\D//g; $time = time; $tempfile = "$message_dir/$time-$pid.tmp"; open (MAIL, ">$tempfile"); } print MAIL $input; print MAIL "\n"; print MAIL $text_out; print MAIL $footer if $footer; close (MAIL); if ($email{'tempfile'} == 1) { $command =~ s%^\|\s*%%; $pr = $email{'mail_program'}; if ($command =~ m|$pr|) { $stuff = $'; $command = $pr; } else { $stuff = ""; } if ($^O eq "MSWin32") { $mail_prog = $pr; $mail_prog =~ s/\//\\/g; $tempfile =~ s/\//\\/g; $stuff =~ s/'/"/g; $stuff =~ s/^\s*//; if ($mail_prog =~ m|(.*)\\|) { $cwd = $1; } else { $cwd = "."; } eval ' use Win32::Process; use Win32; Win32::Process::Create($ProcessObj, $mail_prog, "$mail_prog $tempfile $stuff", 0, DETACHED_PROCESS, $cwd) || &error_message("Windows Process Creation Error", Win32::FormatMessage(Win32::GetLastError())); $ProcessObj->Wait(INFINITE); '; } else { system("$command_line", "$tempfile", "$stuff"); } unlink ($tempfile); } } else { @addresses = split(/,/, $addresses); foreach $address (@addresses) { ($email, $user, $pass) = split(/\|\|/, $address); $address = $email; $command_temp = $command; $input_temp = $input; $command_temp =~ s/\$TO/$address/g; $input_temp =~ s/\$TO/$address/g; if ($email{'tempfile'} == 0) { open (MAIL, $command_temp); } else { $command_temp =~ s%^\|\s*%%; $pid = $$; $pid =~ s/\D//g; $time = time; $tempfile = "$message_dir/$time-$pid.tmp"; open (MAIL, ">$tempfile"); } print MAIL $input_temp; print MAIL "\n"; print MAIL $text_out; print MAIL $footer if $footer; if ($reply_by_email) { print MAIL " ***||$user||", crypt($pass, "cookie"), "||$topic_number||$me_number||***\n\n"; print MAIL "$L{BPR_GOTOLINK}\n"; print MAIL "$script_url/show.$cgi_extension?$topic/$page\n\n"; } close (MAIL); if ($email{'tempfile'} == 1) { $pr = $email{'mail_program'}; if ($command_temp =~ m|$pr|) { $stuff = $'; $command_temp = $pr; } else { $stuff = ""; } if ($^O eq "MSWin32") { $mail_prog = $pr; $mail_prog =~ s/\//\\/g; $tempfile =~ s/\//\\/g; $stuff =~ s/'/"/g; $stuff =~ s/^\s*//; if ($mail_prog =~ m|(.*)\\|) { $cwd = $1; } else { $cwd = "."; } eval ' use Win32::Process; use Win32; Win32::Process::Create($ProcessObj, $mail_prog, "$mail_prog $tempfile $stuff", 0, DETACHED_PROCESS, $cwd) || &error_message("Windows Process Creation Error", Win32::FormatMessage(Win32::GetLastError())); $ProcessObj->Wait(INFINITE); '; } else { system("$command_line", "$tempfile", "$stuff"); } unlink ($tempfile); } } } } #---SEPARATOR---# sub change_announce_message { local ($file, $source, $formatted) = @_; local (@file, $messageflag, $line, $source_esc, $topic, $page); if ($file =~ m|/(\d+)/(\d+)\.$ext|) { ($topic, $page) = ($1, $2); } else { &error_message("Change Announcement Error", "Could not open requested file", 0, 1); } &lock("$message_dir/$topic/$page.$ext"); local ($head, $color, $lm, $ann, $ann_src, $sublist, $about, $about_src, $message, $message_src) = &get_page($topic, $page); &set_page($topic, $page, $head, $color, $lm, $formatted, &escape($source), $sublist, $about, $about_src, $message, $message_src); &unlock("$message_dir/$topic/$page.$ext"); } #---SEPARATOR---# sub manage_images { local ($source_in, $topic_number, $queue, $action) = @_; local (@file); while ($source_in =~ m|\\image_alreadyuploaded\{(\d+)|) { push (@file, "$1.gif"); $source_in = join("", $`, $'); } while ($source_in =~ m|\\jpeg_alreadyuploaded\{(\d+)|) { push (@file, "$1.jpg"); $source_in = join("", $`, $'); } if ($queue != 0) { $dir = ""; } else { if (-e "$message_dir/$topic_number") { $dir = "$message_dir/$topic_number"; } else { $dir = "$secdir/$topic_number"; } } if ($action eq "delete") { foreach $line (@file) { (unlink("$dir/$line")); } } elsif ($action eq "list") { foreach $line (@file) { $line = "$dir/$line"; } return @file; } } #---SEPARATOR---# #REQ:webtags sub reapply_webtags { local ($text, $message) = @_; local (%source); $flag = 0; @lines = split(/\n/, $text); foreach $line (@lines) { if ($line =~ m||) { $flag = $1; } elsif ($line =~ m||) { $flag = 0; } elsif ($flag) { $source{$flag} .= $line; } } foreach $key (keys(%source)) { $u = &unescape($source{$key}); if ($u =~ m|\\image_alreadyuploaded| || $u =~ m|\\jpeg_alreadyuploaded| || $u =~ m|attachment_alreadyuploaded|) { ($lint, $message_var_replace) = &webtags($u, 0, 1); @lines = split(/\n/, $message); $ctr = 0; $flag = 0; foreach $line (@lines) { $ctr += 1; if ($line =~ m||) { $flag = ($ctr - 1); last; } } if ($flag) { $lines[$flag-1] = $message_var_replace; } $message = join("\n", @lines); } } return $message; } #---SEPARATOR---# #REQ:printuntil sub profile_editor_screen { local ($file, $username, $group, $username_editing, $action_url, $action, $editflag) = @_; $file =~ tr/A-Z/a-z/; $IS_MODERATOR = 0; open (FILE, "$admin_dir/$file.txt"); @file = ; close (FILE); if ($file eq "passwd") { ($uline) = grep(/^$username:/, @file); $IS_MODERATOR = 1; } else { @u = grep(/^$username:/, @file); ($uline) = grep(/:$group\s*$/, @u); } chop ($uline) if $uline =~ m|\n$|; if ($uline eq "") { &error_message("Edit Profile Error", "Could not find entry for $username in file $file!"); } ($username, $password, $email, $fullname, $editing, $email_notify, $lastcheck, $group) = split(/:/, $uline); @emt = split(/,/, $email_notify); foreach $l (@emt) { if ($l =~ m|^(\d+)/|) { $l = $1; } } &header; &printuntil(1, 1, 0, $L{PROFEDIT_TITLE}); print "
$L{PROFEDIT_TITLE}"; print ": \u$username" if $editing; print "
\n"; print "
\n"; if ($editflag == 1) { print ""; print "User Manager:\n"; print ""; print "Edit \u$group:\n"; print "Edit \u$username
\n"; } elsif ($editflag == 2) { print ""; print "Moderator Manager:\n"; print "Edit \u$username
\n"; } print "

$L{PROFEDIT_INFO}

\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$fs$L{PROFEDIT_YOURUSERNAME}$fs\u$username
$fs$L{PROFEDIT_YOURFULLNAME}
$fs$L{PROFEDIT_YOUREMAIL}

$fs\n"; print "

\n"; if ($GLOBAL_OPTIONS{'email'}) { print "
\n"; print "

$L{PROFEDIT_EMAILNOTIFY}

\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$fs\n"; print "$L{PROFEDIT_CHOOSETOPICS}\n

    "; open (TOP, "$message_dir/board-topics.html"); @top = ; close (TOP); @topics = grep(/^|) { $o = $1; &extract("//$o/$o.$ext"); print " $topic_name
    \n"; } } print "

$L{PROFEDIT_MYPOSTS}\n

    \n"; print " $L{PROFEDIT_MYPOSTSBOX}

\n"; print "

\n"; } if ($GLOBAL_OPTIONS{'pwchange'} ne "0" || $editflag || $IS_MODERATOR) { print "
\n"; print "

$L{PROFEDIT_CHANGEPASSWORD}

\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$fs\n"; print "$L{PROFEDIT_CHANGEPASSWORD_INSTR}

"; print "\n"; print "\n"; print "
$fs$L{PROFEDIT_NEWPASS}
$fs$L{PROFEDIT_VERIFY}
\n"; print "

\n"; print "

"; print "
\n"; } if ($editflag) { print "
\n"; print "

Editing Privileges

\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$fs\n"; print "Choose whether this person is able to edit his or her own profile.

\n"; print "

    \n"; print " Editing is enabled
    \n"; print " Editing is disabled
    \n"; print "

\n"; print "\n"; print "

\n"; } &ex('printuntil', 3, 17, 0, "", 0, 1); exit(0); } #---SEPARATOR---# sub verify_owner { local ($owner, $username) = @_; $username =~ tr/A-Z/a-z/; local (@group_data, $group, $usernames, @username, $groupname); open (GROUP, "$admin_dir/groups.txt") || &error_message("File Error", "Cannot open group file (groups.txt)!"); @group_data = ; close (GROUP); foreach $group (@group_data) { chop ($group) if $group =~ /\n$/; ($groupname, $usernames) = split(/:/, $group); if ($groupname eq $owner) { @username = split(/,/, $usernames); if (grep (/^$username$/, @username)) { return 1; } else { return 0; } } } return 0; } #---SEPARATOR---# sub profanity_editor { &header; print "Profanity List Editor\n"; print '$fs\n"; print "
Profanity List Editor
\n"; print "
\n"; print "Options Manager"; print ": Profanity List Editor\n
\n"; print "
\n"; print "\n"; print "\n"; print "
$fs"; print "Using the box below, enter profanity/cuss words that are to be blocked out.\n"; print "Enter one word per line.

\n"; print "

\n"; print "$fs

\n"; print "
\n"; exit(0); } #---SEPARATOR---# sub cuss_save { local ($words) = @_; &lock("$admin_dir/cuss.txt"); @words = split(/\n/, $words); @words = grep(/\S/, @words); undef @cuss; foreach $word (@words) { $word =~ tr/b-zaB-ZA/a-zA-Z/; $word =~ s/^\s+//; $word =~ s/\s+$//; push (@cuss, "!$word\n"); } open (CUSS, ">$admin_dir/cuss.txt"); print CUSS @cuss; close (CUSS); &unlock("$admin_dir/cuss.txt"); }