#####################################################
#  LEO SuperCool BBS / LeoBBS X / 雷傲極酷超級論壇  #
#####################################################
# 基於山鷹(糊)、花無缺製作的 LB5000 XP 2.30 免費版  #
#   新版程式製作 & 版權所有: 雷傲科技 (C)(R)2004    #
#####################################################
#      主頁地址： http://www.LeoBBS.com/            #
#      論壇地址： http://bbs.LeoBBS.com/            #
#####################################################

    my $x = &myrand(1000000000);
    $x = crypt($x, aun);
    $x =~ s/%([a-fA-F0-9]{2})/pack("C", hex($1))/eg;
    $x =~ s/[^\w\d]//g;
    $x = substr($x, 2, 9);
    $memdir    = "members$x"  if (rename("$lbdir$memdir",     "${lbdir}members$x"));
    $msgdir    = "messages$x" if (rename("$lbdir$msgdir",     "${lbdir}messages$x"));

    opendir (DIRS, "$lbdir");
    my @files = readdir(DIRS);
    closedir (DIRS);
    my @ftpdir = grep(/^ftpdata/i, @files);
    $ftpdir = $ftpdir[0];
    my @memfavdir = grep(/^memfav/i, @files);
    $memfavdir = $memfavdir[0];
    my @searchdir = grep(/^search/i, @files);
    $searchdir = $searchdir[0];
    $searchdir = $searchdir[1] if ($searchdir eq "search.cgi");
    my @recorddir = grep(/^record/i, @files);
    $recorddir = $recorddir[0];
    $recorddir = $recorddir[1] if ($recorddir eq "record.cgi");
    my $x = &myrand(1000000000);
    $x = crypt($x, aun);
    $x =~ s/%([a-fA-F0-9]{2})/pack("C", hex($1))/eg;
    $x =~ s/[^\w\d]//g;
    $x = substr($x, 2, 9);
    $searchdir = "search$x"   if (rename("$lbdir$searchdir",  "${lbdir}search$x"));
    $ftpdir    = "ftpdata$x"  if (rename("$lbdir$ftpdir",     "${lbdir}ftpdata$x"));
    $memfavdir = "memfav$x"   if (rename("$lbdir$memfavdir",  "${lbdir}memfav$x"));
    $recorddir = "record$x"   if (rename("$lbdir$recorddir",  "${lbdir}record$x"));

1;
