F:\WEBSITES\testbed\zipped\yabb_svn_new\branches\2.5.2\cgi-bin\yabb2\Sources\Register.pl F:\WEBSITES\testbed\zipped\yabb_svn_new\trunk\cgi-bin\yabb2\Sources\Register.pm
############################################################################### ###############################################################################
# Register.pl                                                                 # # Register.pm                                                                 #
  # $Date: 01.05.16 $                                                           #
############################################################################### ###############################################################################
# YaBB: Yet another Bulletin Board                                            # # YaBB: Yet another Bulletin Board                                            #
# Open-Source Community Software for Webmasters                               # # Open-Source Community Software for Webmasters                               #
# Version:        YaBB 2.5.2                                                  # # Version:        YaBB 2.6.12                                                 #
# Packaged:       October 21, 2012                                            # # Packaged:       January 5, 2016                                             #
# Distributed by: http://www.yabbforum.com                                    # # Distributed by: http://www.yabbforum.com                                    #
# =========================================================================== # # =========================================================================== #
# Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved.     # # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved.     #
# Software by:  The YaBB Development Team                                     # # Software by:  The YaBB Development Team                                     #
#               with assistance from the YaBB community.                      # #               with assistance from the YaBB community.                      #
############################################################################### ###############################################################################
  # use strict;
  # use warnings;
  no warnings qw(uninitialized once redefine);
  use CGI::Carp qw(fatalsToBrowser);
  use English '-no_match_vars';
  our $VERSION = '2.6.12';
   
  $registerpmver = 'YaBB 2.6.12 $Revision: 1651 $';
  if ( $action eq 'detailedversion' ) { return 1; }
   
  if ( !$iamguest
     && ( !$admin && $action ne 'activate' && $action ne 'admin_descision' ) )
  {
     fatal_error('no_registration_logged_in');
  }
   
  require Sources::Mailer;
  LoadLanguage('Register');
  LoadCensorList();
   
$registerplver = 'YaBB 2.5.2 $Revision: 1.6 $';  get_template('Register'); 
if ($action eq 'detailedversion') { return 1; }  
if (!$iamguest && (!$admin && $action ne 'activate' && $action ne 'admin_descision') ) { &fatal_error("no_registration_logged_in"); }  if ( $OSNAME =~ /Win/sm ) { 
     my $regstyle = q~ style="text-transform: lowercase"~;
require "$sourcedir/Mailer.pl";  } 
&LoadLanguage('Register');  else { 
&LoadCensorList;     my $regstyle = q{}; 
   
if ($^O =~ /Win/) {  
   my $regstyle = qq~ style="text-transform: lowercase"~;  
} else {  
   my $regstyle = '';  
} }
   
sub Register { sub Register {
   if ($regtype == 0 && $iamguest) { &fatal_error("registration_disabled"); }    if ( $regtype == 0 && $iamguest ) { fatal_error('registration_disabled'); }
   my ($tmpregname, $tmprealname, $tmpregemail, $tmpregpasswrd1, $tmpregpasswrd2, $hidechecked, @birthdate);     if ( $RegAgree == 1 && $FORM{'regnoagree'} ) { 
   $yytitle = $register_txt{'97'};         $yySetLocation = qq~$scripturl~; 
   $yynavigation = qq~› $register_txt{'97'}~;         redirectexit(); 
   if ($FORM{'reglanguage'}) {     } 
       $language = $FORM{'reglanguage'};     if ( $RegAgree == 1 && !$FORM{'regagree'} ) { 
       &LoadLanguage('Register');         $yytitle      = qq~$register_txt{'97'}~; 
   }         $yynavigation = qq~› $register_txt{'97'}~; 
   if ($FORM{'regusername'}) { $tmpregname     = $FORM{'regusername'}; }         if ($language) { 
   if ($FORM{'regrealname'}) { $tmprealname    = $FORM{'regrealname'}; }             fopen( AGREE, "$langdir/$language/agreement.txt" ); 
   if ($FORM{'email'})       { $tmpregemail    = $FORM{'email'}; }        }
   if ($FORM{'hideemail'} || !exists $FORM{'hideemail'}) { $hidechecked = qq~ checked="checked"~; }         else { 
   if ($FORM{'add_field0'})    { $newfield       = $FORM{'add_field0'}; }             fopen( AGREE, "$langdir/$lang/agreement.txt" ); 
   if ($FORM{'passwrd1'})    { $tmpregpasswrd1 = $FORM{'passwrd1'}; }        }
   if ($FORM{'passwrd2'})    { $tmpregpasswrd2 = $FORM{'passwrd2'}; }         @agreement = <AGREE>; 
   if ($FORM{'reason'})      { $reason         = $FORM{'reason'}; }         fclose(AGREE); 
   if ($FORM{'birth_day'})   { $birthdate[0]   = $FORM{'birth_day'}; }         $fullagree = join q{}, @agreement; 
   if ($FORM{'birth_month'}) { $birthdate[1]   = $FORM{'birth_month'}; }         $fullagree =~ s/\n/<br \/>/gsm; 
   if ($FORM{'birth_year'})  { $birthdate[2]   = $FORM{'birth_year'}; }         $yymain .= $myregister_fullagree; 
         $yymain =~ s/{yabb fullagree}/$fullagree/sm;
   ## moved langopt setup to subs.pl         template(); 
   if (!$langopt) { &guestLangSel; }         exit; 
     }
   if (-e "$vardir/email_domain_filter.txt" ) { require "$vardir/email_domain_filter.txt"; }     my ( 
   if ($adomains) {         $tmpregname,     $tmprealname, $tmpregemail,    $tmpregpasswrd1, 
       @domains = split (/\,/, $adomains);         $tmpregpasswrd2, $hidechecked, $reg_start_time, @birthdate 
       $aedomains = qq~<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td><input type="text" maxlength="100" name="email" id="email" value="$tmpregemail" size="15" /></td><td><select name="domain" id="domain">~;     ); 
       foreach (@domains) { $aedomains .= ($_ =~ m/\@/) ? qq~<option value="$_">$_</option>~ : qq~<option value="\@$_">&#64;$_</option>~; }     $yytitle      = $register_txt{'97'}; 
       $aedomains .= qq~</select></td></tr></table>~;     $yynavigation = qq~&rsaquo; $register_txt{'97'}~; 
     if ( $FORM{'reglanguage'} ) {
   } else {         $language = $FORM{'reglanguage'}; 
       $aedomains .= qq~<input type="text" maxlength="100" onchange="checkAvail('$scripturl',this.value,'email')" name="email" id="email" value="$tmpregemail" size="45" />~;         LoadLanguage('Register'); 
   }    }
     if ( $FORM{'regusername'} ) { $tmpregname  = $FORM{'regusername'}; }
   $yymain .= qq~     if ( $FORM{'regrealname'} ) { $tmprealname = $FORM{'regrealname'}; } 
<script language="JavaScript1.2" type="text/javascript" src="$yyhtml_root/ajax.js"></script>     if ( $FORM{'email'} )       { $tmpregemail = $FORM{'email'}; } 
<form action="$scripturl?action=register2" method="post" name="creator" onsubmit="return CheckRegFields();">     if ( $FORM{'hideemail'} || !exists $FORM{'hideemail'} ) { 
<table border="0" width="100%" cellpadding="4" cellspacing="1" class="bordercolor">         $hidechecked = q~ checked="checked"~; 
   <colgroup>     } 
       <col width="45%" />     if ( $FORM{'add_field0'} )  { $newfield       = $FORM{'add_field0'}; } 
       <col width="55%" />     if ( $FORM{'passwrd1'} )    { $tmpregpasswrd1 = $FORM{'passwrd1'}; } 
   </colgroup>     if ( $FORM{'passwrd2'} )    { $tmpregpasswrd2 = $FORM{'passwrd2'}; } 
   <tr>     if ( $FORM{'reason'} )      { $reason         = $FORM{'reason'}; } 
       <td colspan="2" class="titlebg">     if ( $FORM{'birth_day'} )   { $birthdate[0]   = $FORM{'birth_day'}; } 
           <img src="$imagesdir/register.gif" alt="$register_txt{'97'}" title="$register_txt{'97'}" border="0" />     if ( $FORM{'birth_month'} ) { $birthdate[1]   = $FORM{'birth_month'}; } 
           <span class="text1"><b>$register_txt{'97'}</b> $register_txt{'517'}</span>     if ( $FORM{'birth_year'} )  { $birthdate[2]   = $FORM{'birth_year'}; } 
       </td>  
   </tr>     $min_reg_time ||= 0; 
   <tr>     if ( $min_reg_time > 0 ) { 
       <td class="windowbg" colspan="2" align="center">         $reg_start_time = 
           $register_txt{'97a'}           qq~<input type="hidden" name="reg_start_time" value="$date" />~; 
       </td>     } 
   </tr>~;  
     if ( !$langopt ) { guestLangSel(); }
   if ($morelang > 1) {  
       $yymain .= qq~     if ( -e "$vardir/email_domain_filter.txt" ) { 
   <tr>         require "$vardir/email_domain_filter.txt"; 
       <td class="windowbg" align="right" valign="top">     } 
           <label for="reglanguage"><b>$register_txt{'101'}</b></label>     if ($adomains) { 
       </td>         @domains = split /\,/xsm, $adomains; 
       <td class="windowbg2" align="left" valign="top">         $aedomains = $myaedomains_a; 
           <select name="reglanguage" id="reglanguage" onchange="document.creator.action='$scripturl?action=register'; document.creator.submit();">         $aedomains =~ s/{yabb tmpregemail}/$tmpregemail/sm; 
           $langopt         foreach (@domains) { 
           </select>             $aedomains .= 
           <noscript><input type="submit" value="$maintxt{'32'}" class="button" /></noscript>               ( $_ =~ m/\@/xsm ) 
       </td>               ? qq~<option value="$_">$_</option>~ 
   </tr>~;               : qq~<option value="\@$_">&commat;$_</option>~; 
   }        }
     $newfield = q{};         $aedomains .= $myaedomains_b; 
   $yymain .= qq~     } 
<!--user name section-->     else { 
   <tr>         $aedomains .= 
       <td class="windowbg" align="right" valign="top">  qq~<input type="text" maxlength="100" onchange="checkAvail('$scripturl',this.value,'email')" name="email" id="email" value="$tmpregemail" size="45" />~; 
           <label for="regusername"><b>$register_txt{'98'}:</b><br />     } 
           <span class="small">$register_txt{'520'}$register_txt{'241ea'}</span></label>  
       </td>     $yymain .= qq~ 
       <td class="windowbg2" align="left" valign="top">  <script type="text/javascript" src="$yyhtml_root/ajax.js"></script> 
           <input autocomplete="off" type="text" name="regusername" id="regusername" onchange="checkAvail('$scripturl',this.value,'user')" size="30" value="$tmpregname" maxlength="18"$regstyle /> *  <form action="$scripturl?action=register2" method="post" name="creator" onsubmit="return CheckRegFields();" accept-charset="$yymycharset"> 
           <div id="useravailability"></div>     $reg_start_time~; 
           <input type="hidden" name="language" id="language" value="$language" />     if ( $RegAgree == 1 && $FORM{'regagree'} ) { 
       </td>         $yymain .= q~ 
   </tr>  <input type="hidden" name="regagree" value="yes" />~; 
   <tr>     } 
       <td class="windowbg" align="right" valign="top">     $yymain .= $myregister_regfill_a; 
           <label for="regrealname"><b>$register_txt{'98a'}:</b>~;  
   if ($name_cannot_be_userid) {    if ( $morelang > 1 ) {
       $yymain .= qq~         $yymain .= $myregister_morelang; 
           <br /><span class="small">$register_txt{'521'}</span>~;         $yymain =~ s/{yabb langopt}/$langopt/sm; 
   }    }
   $yymain .= qq~</label>     $newfield = q{}; 
       </td>  ## user name section 
       <td class="windowbg2" align="left" valign="top">     $yymain .= $myregister_regfill_b; 
           <input type="text" name="regrealname" id="regrealname" onchange="checkAvail('$scripturl',this.value,'display')" size="30" value="$tmprealname" maxlength="30" /> *     $yymain =~ s/{yabb tmpregname}/$tmpregname/sm; 
           <div id="displayavailability"></div>     $yymain =~ s/{yabb regstyle}/$regstyle/sm; 
       </td>     $yymain =~ s/{yabb language}/$language/sm; 
   </tr>  
   <tr>     if ($name_cannot_be_userid) { 
       <td class="windowbg" align="right" valign="top"><label for="email"><b>$register_txt{'69'}:</b>         $yymain .= qq~ 
           <br /><span class="small">$register_txt{'679'}</span></label>             <br /><span class="small">$register_txt{'521'}</span>~; 
       </td>     } 
       <td class="windowbg2" align="left" valign="top">  
           $aedomains *     $email2 = q{}; 
           <div id="emailavailability"></div>     if ( $imp_email_check == 1 ) { 
   ~;         eval { 
   if ($allow_hide_email == 1) {             require Net::DNS; 
       $yymain .= qq~         }; 
           <br /><input type="checkbox" name="hideemail" id="hideemail" value="1"$hidechecked /> <label for="hideemail">$register_txt{'721'}</label>         if (!$EVAL_ERROR ) { 
       ~;             $email2 = $myregister_email2; 
   }             $email2 =~ s/{yabb email2}/$register_txt{'70'}/sm; 
   $yymain .= qq~         } 
       </td>     } 
   </tr>  
   ~;     $yymain .= $myregister_avail; 
     $yymain =~ s/{yabb tmprealname}/$tmprealname/sm;
   if ($birthday_on_reg) {     $yymain =~ s/{yabb aedomains}/$aedomains/sm; 
       &timetostring($date);  
       if ($timeselected =~ /[145]/) {    if ( $allow_hide_email == 1 ) {
           $yymain .= qq~        $yymain .= qq~
   <tr>             <br /><input type="checkbox" name="hideemail" id="hideemail" value="1"$hidechecked /> <label for="hideemail">$register_txt{'721'}</label> 
       <td class="windowbg" align="right" valign="top">         ~; 
           <label for="birth_month"><b>$register_txt{'birthday'}:</b></label>     } 
       </td>     $yymain .= $myregister_endrow; 
       <td class="windowbg2" align="left" valign="top"><input type="text" name="birth_month" id="birth_month" size="2" value="$birthdate[1]" maxlength="2" onkeypress="jumpatnext('document.creator.birth_month','document.creator.birth_day',2)" /> <input type="text" name="birth_day" id="birth_day" size="2" value="$birthdate[0]" maxlength="2" onkeypress="jumpatnext('document.creator.birth_day','document.creator.birth_year',2)" /> <input type="text" name="birth_year" id="birth_year" size="4" value="$birthdate[2]" maxlength="4" />~ . ($birthday_on_reg == 2 ? ' *' : '') . qq~ <span class="small">$register_txt{'birthday_a'}</span>~;     $yymain .= $email2; 
   
       } else {    if ($birthday_on_reg) {
           $yymain .= qq~         my $editAgeTxt; 
   <tr>         if ( $editAgeLimit == 1 ) { 
       <td class="windowbg" align="right" valign="top">             $editAgeTxt = 
           <label for="birth_day"><b>$register_txt{'birthday'}:</b></label>               qq~<br /><span class="small">$register_txt{'birthday_c'}</span>~; 
       </td>         } 
       <td class="windowbg2" align="left" valign="top"><input type="text" name="birth_day" id="birth_day" size="2" value="$birthdate[0]" maxlength="2" onkeypress="jumpatnext('document.creator.birth_day','document.creator.birth_month',2)" /> <input type="text" name="birth_month" id="birth_month" size="2" value="$birthdate[1]" maxlength="2" onkeypress="jumpatnext('document.creator.birth_month','document.creator.birth_year',2)" /> <input type="text" name="birth_year" id="birth_year" size="4" value="$birthdate[2]" maxlength="4" />~ . ($birthday_on_reg == 2 ? ' *' : '') . qq~ <span class="small">$register_txt{'birthday_b'}</span>~;         timetostring($date); 
       }         if ( $timeselected =~ /[145]/xsm ) { 
             $yymain .=
       $yymain .= qq~                 $myregister_bdonreg 
       </td>               . ( $birthday_on_reg == 2 ? $myreg_req : q{} ) 
   </tr>~;               . qq~ <span class="small">$register_txt{'birthday_a'}</span>~; 
   }        }
         else {
   if ($gender_on_reg) {             $yymain .= 
       if ($gender_on_reg == 1) {                 $myregister_bdonreg_2 
           $gender_req = qq~<label for="gender"><b>$register_txt{'gender'}: </b></label>~;               . ( $birthday_on_reg == 2 ? $myreg_req : q{} ) 
       }               . qq~ <span class="small">$register_txt{'birthday_b'}</span>~; 
       else {         } 
           $gender_req = qq~* <label for="gender"><b>$register_txt{'gender'}: </b></label>~;         $yymain =~ s/{yabb editAgeTxt}/$editAgeTxt/sm; 
       }         $yymain =~ s/{yabb birthdate0}/$birthdate[0]/sm; 
       $yymain .= qq~         $yymain =~ s/{yabb birthdate1}/$birthdate[1]/sm; 
       <tr>         $yymain =~ s/{yabb birthdate2}/$birthdate[2]/sm; 
           <td class="windowbg" align="right" valign="top">  
               $gender_req         $yymain .= $myregister_endrow; 
           </td>     } 
           <td class="windowbg2" align="left" valign="top">  
               <select name="gender" id="gender" size="1">     if ( $gender_on_reg ) { 
                   <option value=""></option>         my $editGenderTxt; 
                   <option value="Male">$register_txt{'gender_male'}</option>         my $nongen_opt = q{}; 
                   <option value="Female">$register_txt{'gender_female'}</option>         if ( $editGenderLimit == 1 ) { 
               </select>             $editGenderTxt = 
           </td>               qq~<br /><span class="small">$register_txt{'gender_edit'}</span>~; 
       </tr>         } 
       ~;         if ( $gender_on_reg == 2 ) { 
   }             $nongen_opt = $myreg_req; 
   unless ($emailpassword) {         } 
       $yymain .= qq~  
   <tr>         $yymain .= $myregister_gender; 
       <td class="windowbg" align="right" valign="top">         $yymain =~ s/{yabb editGenderTxt}/$editGenderTxt/sm; 
           <label for="passwrd1"><b>$register_txt{'81'}:</b></label>         $yymain =~ s/{yabb nongen_opt}/$nongen_opt/sm; 
       </td>     } 
       <td class="windowbg2" align="left" valign="top">     if ( !$emailpassword ) { 
           <script language="JavaScript1.2" type="text/javascript">         $yymain .= password_check(); 
           <!--     } 
               // Password_strength_meter start  
               var verdects = new Array("$pwstrengthmeter_txt{'1'}","$pwstrengthmeter_txt{'2'}","$pwstrengthmeter_txt{'3'}","$pwstrengthmeter_txt{'4'}","$pwstrengthmeter_txt{'5'}","$pwstrengthmeter_txt{'6'}","$pwstrengthmeter_txt{'7'}","$pwstrengthmeter_txt{'8'}");     if ( $addmemgroup_enabled == 1 || $addmemgroup_enabled == 3 ) { 
               var colors = new Array("#8F8F8F","#BF0000","#FF0000","#00A0FF","#33EE00","#339900");         my ( $addmemgroup, $selsize ); 
               var scores = new Array($pwstrengthmeter_scores);         foreach (@nopostorder) { 
               var common = new Array($pwstrengthmeter_common);             my ( 
               var minchar = $pwstrengthmeter_minchar;                 $title, undef, undef, undef, undef, undef, 
                 undef,  undef, undef, undef, $additional
               function runPassword(D) {             ) = split /\|/xsm, $NoPost{$_}; 
                   var nPerc = checkPassword(D);             if ($additional) { 
                   if (nPerc > -199 && nPerc < 0) {                 $addmemgroup .= qq~<option value="$_">$title</option>~; 
                       strColor = colors[0];                 $selsize++; 
                       strText = verdects[1];             } 
                       strWidth = "5%";         } 
                   } else if (nPerc == -200) {         $selsize = $selsize > 6 ? 6 : $selsize; 
                       strColor = colors[1];         my $additional_explain = 
                       strText = verdects[0];             $addmemgroup_enabled == 1 
                       strWidth = "0%";           ? $register_txt{'766'} 
                   } else if (scores[0] == -1 && scores[1] == -1 && scores[2] == -1 && scores[3] == -1) {           : $register_txt{'767'}; 
                       strColor = colors[4];         if ( $selsize > 1 ) { $additional_explain .= $register_txt{'767a'}; } 
                       strText = verdects[7];  
                       strWidth = "100%";         if ($addmemgroup) { 
                   } else if (nPerc <= scores[0]) {             $yymain .= $myregister_addmem; 
                       strColor = colors[1];             $yymain =~ s/{yabb additional_explain}/$additional_explain/sm; 
                       strText = verdects[2];             $yymain =~ s/{yabb selsize}/$selsize/sm; 
                       strWidth = "10%";             $yymain =~ s/{yabb addmemgroup}/$addmemgroup/sm; 
                   } else if (nPerc > scores[0] && nPerc <= scores[1]) {         } 
                       strColor = colors[2];     } 
                       strText = verdects[3];  
                       strWidth = "25%";     if ( $regtype == 1 ) { 
                   } else if (nPerc > scores[1] && nPerc <= scores[2]) {         $yymain .= 
                       strColor = colors[3];             $myregister_regreason_a 
                       strText = verdects[4];           . qq~            <textarea cols="60" rows="7" name="reason" id="reason">$reason</textarea>~ 
                       strWidth = "50%";           . $myregister_regreason_c 
                   } else if (nPerc > scores[2] && nPerc <= scores[3]) {           . length($RegReasonSymbols) 
                       strColor = colors[4];           . $myregister_regreason_b; 
                       strText = verdects[5];         $yymain =~ s/{yabb reason}/$reason/sm; 
                       strWidth = "75%";         $yymain =~ s/{yabb RegReasonSymbols}/$RegReasonSymbols/gsm; 
                   } else {     } 
                       strColor = colors[5];  
                       strText = verdects[6];     if ($extendedprofiles) { 
                       strWidth = "100%";         require Sources::ExtendedProfiles; 
                   }         my $reg_ext_prof = ext_register(); 
                   document.getElementById("passwrd1_bar").style.width = strWidth;         $yymain .= $reg_ext_prof; 
                   document.getElementById("passwrd1_bar").style.backgroundColor = strColor;     } 
                   document.getElementById("passwrd1_text").style.color = strColor;  
                   document.getElementById("passwrd1_text").childNodes[0].nodeValue = strText;     if ($regcheck) { 
               }         require Sources::Decoder; 
         validation_code();
               function checkPassword(C) {         $yymain .= $myregister_regcheck; 
                   if (C.length == 0 || C.length < minchar) return -100;         $yymain =~ s/{yabb flood_text}/$flood_text/sm; 
         $yymain =~ s/{yabb showcheck}/$showcheck/sm;
                   for (var D = 0; D < common.length; D++) {     } 
                       if (C.toLowerCase() == common[D]) return -200;     if ( $en_spam_questions && -e "$langdir/$language/spam.questions" ) { 
                   }         SpamQuestion(); 
         my $verification_question_desc;
                   var F = 0;         if ($spam_questions_case) { 
                   if (C.length >= minchar && C.length <= (minchar+2)) {             $verification_question_desc = 
                       F = (F + 6)               qq~<br />$register_txt{'verification_question_case'}~; 
                   } else if (C.length >= (minchar + 3) && C.length <= (minchar + 4)) {         } 
                       F = (F + 12)         $yymain .= $myregister_spamquest; 
                   } else if (C.length >= (minchar + 5)) {  
                       F = (F + 18)         $yymain =~ s/{yabb spam_question}/$spam_question/sm; 
                   }         $yymain =~ 
           s/{yabb verification_question_desc}/$verification_question_desc/sm;
                   if (C.match(/[a-z]/)) {         $yymain =~ s/{yabb spam_question_id}/$spam_question_id/sm; 
                       F = (F + 1)         $yymain =~ s/{yabb spam_question_image}/$spam_image/sm; 
                   }    }
                   if (C.match(/[A-Z]/)) {    if ( $honeypot == 1 ) {
                       F = (F + 5)         fopen( HONEY, "<$langdir/$language/honey.txt" ) 
                   }           or fatal_error( 'cannot_open', "$langdir/$language/honey.txt", 1 ); 
                   if (C.match(/d+/)) {         @honey = <HONEY>; 
                       F = (F + 5)         fclose(HONEY); 
                   }         chomp @honey; 
                   if (C.match(/(.*[0-9].*[0-9].*[0-9])/)) {         $hony      = int rand $#honey; 
                       F = (F + 7)         $newfieldb = $honey[$hony]; 
                   }  
                   if (C.match(/.[!,\@,#,\$,\%,^,&,*,?,_,\~]/)) {         $yymain .= $myregister_honey; 
                       F = (F + 5)         $yymain =~ s/{yabb newfieldb}/$newfieldb/sm; 
                   }         $yymain =~ s/{yabb newfield}/$newfield/sm; 
                   if (C.match(/(.*[!,\@,#,\$,\%,^,&,*,?,_,\~].*[!,\@,#,\$,\%,^,&,*,?,_,\~])/)) {     } 
                       F = (F + 7)  
                   }     # SpamFruits courtesy of Carsten Dalgaard # 
                   if (C.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){     if ( $spamfruits == 1 ) { 
                       F = (F + 2)         my @fruits = 
                   }           ( $fruittxt{'2'}, $fruittxt{'3'}, $fruittxt{'4'}, $fruittxt{'5'} ); 
                   if (C.match(/([a-zA-Z])/) && C.match(/([0-9])/)) {         my $rdn = int rand 4; 
                       F = (F + 3)         $fruit = $fruits[$rdn]; 
                   }         $yymain .= $myregister_fruits; 
                   if (C.match(/([a-zA-Z0-9].*[!,\@,#,\$,\%,^,&,*,?,_,\~])|([!,\@,#,\$,\%,^,&,*,?,_,\~].*[a-zA-Z0-9])/)) {         $yymain =~ s/{yabb fruit}/$fruit/gsm; 
                       F = (F + 3)  
                   }  
                   return F;  
               }  
               // Password_strength_meter end  
           // -->  
           </script>  
           <div style="float:left;"><input type="password" maxlength="30" name="passwrd1" id="passwrd1" value="$tmpregpasswrd1" size="30" onkeypress="capsLock(event,'cappasswrd1')" onkeyup="runPassword(this.value);" /> *&nbsp;</div>  
           <div style="float:left; width: 150px; height: 20px; text-align:left;">  
               <div id="password-strength-meter" style="background: transparent url($imagesdir/empty_bar.gif) repeat-x center left; height: 4px"></div>  
               <div class="pstrength-bar" id="passwrd1_bar" style="border: 1px solid #FFFFFF; height: 4px"></div>  
               <div class="pstrength-info" id="passwrd1_text">&nbsp;</div>  
           </div>  
           <div style="clear:left; color: red; font-weight: bold; display: none" id="cappasswrd1">$register_txt{'capslock'}</div>  
           <div style="clear:left; color: red; font-weight: bold; display: none" id="cappasswrd1_char">$register_txt{'wrong_char'}: <span id="cappasswrd1_character">&nbsp;</span></div>  
       </td>  
   </tr>  
   <tr>  
       <td class="windowbg" align="right" valign="top">  
           <label for="passwrd2"><b>$register_txt{'82'}:</b></label>  
       </td>  
       <td class="windowbg2" align="left" valign="top">  
           <input type="password" maxlength="30" name="passwrd2" id="passwrd2" value="$tmpregpasswrd2" size="30" onkeypress="capsLock(event,'cappasswrd2')" /> *  
           <div style="color: red; font-weight: bold; display: none" id="cappasswrd2">$register_txt{'capslock'}</div>  
           <div style="color: red; font-weight: bold; display: none" id="cappasswrd2_char">$register_txt{'wrong_char'}: <span id="cappasswrd2_character">&nbsp;</span></div>  
       </td>  
   </tr>~;  
   }  
   
   if ($addmemgroup_enabled == 1 || $addmemgroup_enabled == 3) {  
       my ($title, $additional, $addmemgroup, $selsize);  
       foreach (@nopostorder) {  
           ($title, undef, undef, undef, undef, undef, undef, undef, undef, undef, $additional) = split(/\|/, $NoPost{$_});  
           if ($additional) {  
               $addmemgroup .= qq~<option value="$_">$title</option>~;  
               $selsize++;  
           }  
       }  
       $selsize = $selsize > 6 ? 6 : $selsize;  
       my $additional_explain = $addmemgroup_enabled == 1 ? $register_txt{'766'} : $register_txt{'767'};  
       $additional_explain .= $register_txt{'767a'} if $selsize > 1;  
   
       $yymain .= qq~  
   <tr>  
       <td class="windowbg" align="right" valign="top">  
           <label for="joinmemgroup"><b>$register_txt{'765'}:</b>  
           <br /><span class="small">$additional_explain</span></label>  
       </td>  
       <td class="windowbg2" align="left" valign="top">  
           <select name="joinmemgroup" id="joinmemgroup" size="$selsize" multiple="multiple">  
           $addmemgroup  
           </select>  
       </td>  
   </tr>~ if $addmemgroup;  
   }  
   
   if ($regtype == 1) {  
       $yymain .= qq~  
   <tr>  
       <td class="windowbg" align="right" valign="top">  
           <label for="reason"><b>$prereg_txt{'regreason'}:</b><br />  
           <span class="small">$prereg_txt{'reason_exp'}</span></label><br /><br />  
       </td>  
       <td class="windowbg2" align="left" valign="top">  
           <textarea cols="60" rows="7" name="reason" id="reason">$reason</textarea> *<br />  
           <span class="small">$prereg_txt{'16'} <input value="$RegReasonSymbols" size="~ . length($RegReasonSymbols) . qq~" name="msgCL" class="windowbg" style="border: 0px; padding: 1px; font-size: 11px;" readonly="readonly" /></span>  
           <script type="text/javascript" language="JavaScript">  
           <!--  
           var supportsKeys = false;  
           function tick() {  
               calcCharLeft(document.forms[0]);  
               if (!supportsKeys) { timerID = setTimeout("tick()",$RegReasonSymbols); }  
           }  
           function calcCharLeft(sig) {  
               clipped = false;  
               maxLength = $RegReasonSymbols;  
               if (document.creator.reason.value.length > maxLength) {  
                   document.creator.reason.value = document.creator.reason.value.substring(0,maxLength);  
                   charleft = 0;  
                   clipped = true;  
               } else {  
                   charleft = maxLength - document.creator.reason.value.length;  
               }  
               document.creator.msgCL.value = charleft;  
               return clipped;  
           }  
           tick();  
           //-->  
           </script>  
       </td>  
   </tr>~;  
   }  
   
   if ($extendedprofiles) {  
       require "$sourcedir/ExtendedProfiles.pl";  
       my $reg_ext_prof = &ext_register;  
       $reg_ext_prof =~ s/align="left" valign="top"/align="right" valign="top"/g;  
       $reg_ext_prof =~ s/<\/td><td align="left">/<\/td><td class="windowbg2" align="left">/g;  
       $yymain .= $reg_ext_prof;  
   }  
   
   if ($regcheck) {  
       require "$sourcedir/Decoder.pl";  
       &validation_code;  
   
       $yymain .= qq~  
   <tr>  
       <td class="windowbg" align="right" valign="top">  
           <label for="verification"><b>$floodtxt{'1'}:</b><br />  
           <span class="small">$floodtxt{'casewarning'}</span></label>  
       </td>  
       <td class="windowbg2" align="left" valign="middle">  
           $showcheck  
       </td>  
   </tr>  
   <tr>  
       <td class="windowbg" align="right" valign="top">  
           <label for="verification"><b>$floodtxt{'3'}:</b></label>  
       </td>  
       <td class="windowbg2" align="left" valign="top">  
           <input type="text" maxlength="30" name="verification" id="verification" size="30" /> *  
       </td>  
   </tr>~;  
   }  
   if ($en_spam_questions) {  
       srand;  
       fopen(SPAMQUESTIONS, "<$langdir/$language/spam.questions") || &fatal_error("cannot_open","$langdir/$language/spam.questions", 1);  
       rand($.) < 1 && ($spam_question_rand = $_) while <SPAMQUESTIONS>;  
       fclose(SPAMQUESTIONS);  
       ($spam_question_id, $spam_question, undef) = split(/\|/, $spam_question_rand);  
       if ($spam_questions_case) { $verification_question_desc = qq~<br />$register_txt{'verification_question_case'}~; }  
       $yymain .= qq~        $yymain .= qq~
   <tr>                 <script type="text/javascript"> 
       <td class="windowbg" align="right" valign="top">                     function ShowFruits() { 
           <label for="verification_question"><b>$spam_question</b><br />                         var visfruits = "<html><head><link rel='stylesheet' href='$extpagstyle' type='text/css' /></head><body class='windowbg2'> "; 
           <span class="small">$register_txt{'verification_question_desc'}$verification_question_desc</span></label>                         visfruits += "<img src='$defaultimagesdir/fruits.png' width='290' height='75' name='fruitsview' id='fruitsview' style='position: absolute; top: 0px; left: 0px; cursor: pointer;' alt='' onclick='FruitClick(event)' /> "; 
       </td>                         visfruits += "<img src='$defaultimagesdir/fruitcheck.png' id='frmarker' style='z-index: 2; display: none;'> "; 
       <td class="windowbg2" align="left" valign="top">                         visfruits += "<script type='text/javascript'> " 
           <input type="text" name="verification_question" id="verification_question" size="30" /> *                         visfruits += "var xcor = 0; " 
           <input type="hidden" name="verification_question_id" value="$spam_question_id" />                         visfruits += "var ycor = 0; " 
       </td>                         visfruits += "var mrkpos = 30; " 
   </tr>~;                         visfruits += "function FruitClick(event) \{ " 
   }                         visfruits += "xcor = (event.clientX); " 
   if ($honeypot == 1) {                         visfruits += "ycor = (event.clientY); " 
           fopen(HONEY, "<$langdir/$language/honey.txt") || &fatal_error("cannot_open","$langdir/$language/honey.txt", 1);                         visfruits += "if(xcor > 0) mrkpos = 30; " 
           @honey = <HONEY>;                         visfruits += "if(xcor > 75) mrkpos = 100; " 
           fclose(HONEY);                         visfruits += "if(xcor > 145) mrkpos = 170; " 
           chomp @honey;                         visfruits += "if(xcor > 215) mrkpos = 240; " 
         $hony = int rand $#honey;                         visfruits += "document.getElementById('frmarker').style.display = 'block'; " 
       $newfieldb = $honey[$hony];                         visfruits += "document.getElementById('frmarker').style.position = 'absolute'; " 
                         visfruits += "document.getElementById('frmarker').style.left = mrkpos + 'px'; " 
       $yymain .= qq~                         visfruits += "document.getElementById('frmarker').style.top = '67px'; " 
       <tr class="green">                         visfruits += "parent.document.creator.ycord.value = ycor; " 
           <td align="right" valign="top" class="green">                         visfruits += "parent.document.creator.xcord.value = xcor; " 
               <label for="add_field0" class="green"><b>$newfieldb</b>                         visfruits += "\} " 
           </td>                         visfruits += "<\\/script> <\\/body> <\\/html>"; 
           <td align="left" valign="top" class="green">                         fruits.document.open("text/html"); 
               <input type="text" name="add_field0" id="add_field0" size="30" value="$newfield" maxlength="18" class="green" /> *                         fruits.document.write(visfruits); 
           </td>                         fruits.document.close(); 
       </tr>~;    }                    }
                            ShowFruits() 
   # SpamFruits courtesy of Carsten Dalgaard #                 </script>~; 
   if ($spamfruits == 1) {             $yymain .= $myregister_endrow; 
       my @fruits = ($fruittxt{'2'},$fruittxt{'3'},$fruittxt{'4'},$fruittxt{'5'});     } 
       my $rdn = int(rand(4));  
       $fruit = $fruits[$rdn];     if ( $RegAgree == 2 ) { 
       $yymain .= qq~         if ($language) { 
       <tr>             fopen( AGREE, "$langdir/$language/agreement.txt" ); 
           <td class="windowbg" align="right" valign="top">         } 
               <b>$fruittxt{'1'} $fruit:</b>         else { 
           </td>             fopen( AGREE, "$langdir/$lang/agreement.txt" ); 
           <td class="windowbg2" align="left" valign="middle">         } 
               <input type="hidden" name="xcord" id="xcord" value="0" />         @agreement = <AGREE>; 
               <input type="hidden" name="ycord" id="ycord" value="0" />         fclose(AGREE); 
               <input type="hidden" name="thefruit" id="thefruit" value="$fruit" />         $fullagree = join q{}, @agreement; 
               <iframe id="fruits" name="fruits" width="290" height="87" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe>         $fullagree =~ s/\n/<br \/>/gsm; 
               <script language="JavaScript1.2" type="text/javascript">         $yymain .= $myregister_regagree; 
               <!--         $yymain =~ s/{yabb fullagree}/$fullagree/gsm; 
                   function ShowFruits() {  
                       var visfruits = "<html><head><link rel='stylesheet' href='$extpagstyle' type='text/css' /></head><body class='windowbg2'> ";     } 
                       visfruits += "<img src='$defaultimagesdir/fruits.png' width='290' height='75' name='fruitsview' id='fruitsview' border='0' style='position: absolute; top: 0px; left: 0px; cursor: pointer;' alt='' onclick='FruitClick(event)' /> ";     $yymain .= $myregister_endform; 
                       visfruits += "<img src='$defaultimagesdir/fruitcheck.png' id='frmarker' style='z-index: 2; display: none;'> ";     $yymain .= qq~ 
                       visfruits += "<script language='JavaScript1.2' type='text/javascript'> "  <script type="text/javascript"> 
                       visfruits += "var xcor = 0; "     document.creator.regusername.focus(); 
                       visfruits += "var ycor = 0; "   
                       visfruits += "var mrkpos = 30; "     function CheckRegFields() { 
                       visfruits += "function FruitClick(event) \{ "         if (document.creator.regusername.value === '') { 
                       visfruits += "xcor = (event.clientX); "             alert("$register_txt{'error_username'}"); 
                       visfruits += "ycor = (event.clientY); "             document.creator.regusername.focus(); 
                       visfruits += "if(xcor > 0) mrkpos = 30; "             return false; 
                       visfruits += "if(xcor > 75) mrkpos = 100; "         }~; 
                       visfruits += "if(xcor > 145) mrkpos = 170; "         if ( !$emailpassword ) { 
                       visfruits += "if(xcor > 215) mrkpos = 240; "             $yymain .= qq~ 
                       visfruits += "document.getElementById('frmarker').style.display = 'block'; "         if (document.creator.regusername.value == document.creator.passwrd1.value || document.creator.regrealname.value == document.creator.passwrd1.value) { 
                       visfruits += "document.getElementById('frmarker').style.position = 'absolute'; "             alert("$register_txt{'error_usernameispass'}"); 
                       visfruits += "document.getElementById('frmarker').style.left = mrkpos + 'px'; "             document.creator.regusername.focus(); 
                       visfruits += "document.getElementById('frmarker').style.top = '67px'; "             return false; 
                       visfruits += "parent.document.creator.ycord.value = ycor; "         }~; 
                       visfruits += "parent.document.creator.xcord.value = xcor; "         } 
                       visfruits += "\} "     $yymain .= qq~ 
                       visfruits += "<\\/script> <\\/body> <\\/html>";         if (document.creator.regrealname.value === '') { 
                       fruits.document.open("text/html");             alert("$register_txt{'error_realname'}"); 
                       fruits.document.write(visfruits);             document.creator.regrealname.focus(); 
                       fruits.document.close();             return false; 
                   }         }~ . 
                   ShowFruits()  
               //-->       ( 
               </script>         $name_cannot_be_userid 
           </td>         ? qq~ 
       </tr>         if (document.creator.regusername.value == document.creator.regrealname.value) { 
       ~;             alert("$register_txt{'error_name_cannot_be_userid'}"); 
   }             document.creator.regrealname.focus(); 
             return false;
   if ($RegAgree) {         }~ 
       if ($language) {         : q{} 
           fopen(AGREE, "$langdir/$language/agreement.txt");       ) 
       } else {  
           fopen(AGREE, "$langdir/$lang/agreement.txt");       . qq~ 
       }         if (document.creator.email.value === '') { 
       @agreement = <AGREE>;             alert("$register_txt{'error_email'}"); 
       fclose(AGREE);             document.creator.email.focus(); 
       $fullagree = join("", @agreement);             return false; 
       $fullagree =~ s/\n/<br \/>/g;         }~ . 
       $yymain .= qq~  
   <tr>       ( 
       <td colspan="2" class="titlebg">           $imp_email_check ? qq~ 
           <img src="$imagesdir/xx.gif" alt="$register_txt{'764a'}" title="$register_txt{'764a'}" border="0" /> <b>$register_txt{'764a'}</b>         if (document.creator.email2.value === '') { 
       </td>             alert("$register_txt{'error_email2'}"); 
   </tr>             document.creator.email2.focus(); 
   <tr>             return false; 
       <td colspan="2" class="windowbg">         } 
           <label for="regagree"><span style="float: left; padding: 5px;">$fullagree</span></label>         if (document.creator.email.value != document.creator.email2.value) { 
       </td>             alert("$register_txt{'error_email3'}"); 
   </tr>             document.creator.email.focus(); 
   <tr>             return false; 
       <td colspan="2" class="windowbg2" align="center">         }~ : q{} 
           <label for="regagree"><b>$register_txt{'585'}</b></label> <input type="radio" name="regagree" id="regagree" value="yes" /> * &nbsp;&nbsp; <label for="regnoagree"><b>$register_txt{'586'}</b></label> <input type="radio" name="regagree" id="regnoagree" value="no" />       ) . 
       </td>  
   </tr>~;       ( 
   }         $birthday_on_reg 
   $yymain .= qq~         ? q~ 
   <tr>         if (~ 
       <td colspan="2" align="center" class="titlebg">           . ( 
           <br />             $birthday_on_reg == 1 
           <label for="submitbutton">$register_txt{'95'}</label><br />             ? 'document.creator.birth_day.value.length && ' 
           <br />             : q{} 
           <input type="submit" id="submitbutton" value="$register_txt{'97'}" class="button" /><br /><br />           ) 
       </td>           . qq~(document.creator.birth_day.value.length < 2 || document.creator.birth_day.value < 1 || document.creator.birth_day.value > 31 || (/\\D/.test)(document.creator.birth_day.value))) { 
   </tr>             alert("$register_txt{'error_birth_day'}"); 
</table>             document.creator.birth_day.focus(); 
</form>             return false; 
         }
<script type="text/javascript" language="JavaScript">         if (~ 
<!--           . ( 
   document.creator.regusername.focus();             $birthday_on_reg == 1 
             ? 'document.creator.birth_month.value.length && ' 
   function CheckRegFields() {             : q{} 
       if (document.creator.regusername.value == '') {           ) 
           alert("$register_txt{'error_username'}");           . qq~(document.creator.birth_month.value.length < 2 || document.creator.birth_month.value < 1 || document.creator.birth_month.value > 12 || (/\\D/.test)(document.creator.birth_month.value))) { 
           document.creator.regusername.focus();             alert("$register_txt{'error_birth_month'}"); 
           return false;             document.creator.birth_month.focus(); 
       }             return false; 
       if (document.creator.regusername.value == document.creator.passwrd1.value || document.creator.regrealname.value == document.creator.passwrd1.value) {         } 
           alert("$register_txt{'error_usernameispass'}");         if (~ 
           document.creator.regusername.focus();           . ( 
           return false;             $birthday_on_reg == 1 
       }             ? 'document.creator.birth_year.value.length && ' 
       if (document.creator.regrealname.value == '') {             : q{} 
           alert("$register_txt{'error_realname'}");           ) 
           document.creator.regrealname.focus();           . qq~(document.creator.birth_year.value.length < 4 || (/\\D/.test)(document.creator.birth_year.value))) { 
           return false;             alert("$register_txt{'error_birth_year'}"); 
       }~ .             document.creator.birth_year.focus(); 
             return false;
       ($name_cannot_be_userid ? qq~         } 
       if (document.creator.regusername.value == document.creator.regrealname.value) {         if (~ 
           alert("$register_txt{'error_name_cannot_be_userid'}");           . ( 
           document.creator.regrealname.focus();             $birthday_on_reg == 1 
           return false;             ? 'document.creator.birth_year.value.length && ' 
       }~ : '')             : q{} 
           )
       . qq~           . qq~(document.creator.birth_year.value < ($year - 120) || document.creator.birth_year.value > $year)) { 
       if (document.creator.email.value == '') {             alert("$register_txt{'error_birth_year_real'}"); 
           alert("$register_txt{'error_email'}");             document.creator.birth_year.focus(); 
           document.creator.email.focus();             return false; 
           return false;         }~ 
       }~ .         : q{} 
       )
       ($birthday_on_reg ? qq~  
       if (~ . ($birthday_on_reg == 1 ? 'document.creator.birth_day.value.length && ' : '') . qq~(document.creator.birth_day.value.length < 2 || document.creator.birth_day.value < 1 || document.creator.birth_day.value > 31 || /\\D/.test(document.creator.birth_day.value))) {       . qq~ 
           alert("$register_txt{'error_birth_day'}");         var emailpassword = $emailpassword; 
           document.creator.birth_day.focus();         if (emailpassword === 0) { 
           return false;             if (document.creator.passwrd1.value === '' || document.creator.passwrd2.value === '') { 
       }                 alert("$register_txt{'error_pass1'}"); 
       if (~ . ($birthday_on_reg == 1 ? 'document.creator.birth_month.value.length && ' : '') . qq~(document.creator.birth_month.value.length < 2 || document.creator.birth_month.value < 1 || document.creator.birth_month.value > 12 || /\\D/.test(document.creator.birth_month.value))) {                 document.creator.passwrd1.focus(); 
           alert("$register_txt{'error_birth_month'}");                 return false; 
           document.creator.birth_month.focus();             } 
           return false;             if (document.creator.passwrd1.value != document.creator.passwrd2.value) { 
       }                 alert("$register_txt{'error_pass2'}"); 
       if (~ . ($birthday_on_reg == 1 ? 'document.creator.birth_year.value.length && ' : '') . qq~(document.creator.birth_year.value.length < 4 || /\\D/.test(document.creator.birth_year.value))) {                 document.creator.passwrd1.focus(); 
           alert("$register_txt{'error_birth_year'}");                 return false; 
           document.creator.birth_year.focus();             } 
           return false;         } 
       }         var regcheck = $regcheck; 
       if (~ . ($birthday_on_reg == 1 ? 'document.creator.birth_year.value.length && ' : '') . qq~(document.creator.birth_year.value < ($year - 120) || document.creator.birth_year.value > $year)) {        if (regcheck > 0 && document.creator.verification.value === '') {
           alert("$register_txt{'error_birth_year_real'}");             alert("$register_txt{'error_verification'}"); 
           document.creator.birth_year.focus();             document.creator.verification.focus(); 
           return false;            return false;
       }~ : '')         }~ . 
   
       . qq~       ( 
       if ($emailpassword == 0) {         $en_spam_questions && -e "$langdir/$language/spam.questions" 
           if (document.creator.passwrd1.value == '' || document.creator.passwrd2.value == '') {         ? qq~ 
               alert("$register_txt{'error_pass1'}");         if (document.creator.verification_question.value === '') { 
               document.creator.passwrd1.focus();             alert("$register_txt{'error_verification_question'}"); 
               return false;             document.creator.verification_question.focus(); 
           }             return false; 
           if (document.creator.passwrd1.value != document.creator.passwrd2.value) {         }~ 
               alert("$register_txt{'error_pass2'}");         : q{} 
               document.creator.passwrd1.focus();       ) 
               return false;  
           }       . qq~ 
       }         var regtype = $regtype; 
       if ($regcheck > 0 && document.creator.verification.value == '') {         var RegAgree = $RegAgree; 
           alert("$register_txt{'error_verification'}");         var gender_on_reg = $gender_on_reg; 
           document.creator.verification.focus();         if (regtype == 1 && document.creator.reason.value === '') { 
           return false;             alert("$register_txt{'error_reason'}"); 
       }~ .             document.creator.reason.focus(); 
             return false;
       ($en_spam_questions ? qq~         } 
       if (document.creator.verification_question.value == '') {        if (RegAgree == 2 && document.creator.regagree[0].checked !== true) {
           alert("$register_txt{'error_verification_question'}");             alert("$register_txt{'error_agree'}"); 
           document.creator.verification_question.focus();             return false; 
           return false;         } 
       }~ : '')  
         if (gender_on_reg > 1 && !document.creator.gender.value) {
       . qq~             alert("$register_txt{'error_gender'}"); 
       if ($regtype == 1 && document.creator.reason.value == '') {             document.creator.gender.focus(); 
           alert("$register_txt{'error_reason'}");             return false; 
           document.creator.reason.focus();         } 
           return false;         return true; 
       }    }
       if ($RegAgree > 0 && document.creator.regagree[0].checked != true) {  
           alert("$register_txt{'error_agree'}");     function jumpatnext(from,to,length) { 
           return false;         window.setTimeout('if (' + from + '.value.length == ' + length + ') ' + to + '.focus();', 1); 
       }    }
   
       if ($gender_on_reg > 1 && !document.creator.gender.value) {  
           alert("$register_txt{'error_gender'}");  
           document.creator.gender.focus();  
           return false  
       }  
       return true;  
   }  
   
   function jumpatnext(from,to,length) {  
       window.setTimeout('if (' + from + '.value.length == ' + length + ') ' + to + '.focus();', 1);  
   }  
//-->  
</script> </script>
   ~;    ~;
   &template;     template(); 
     return;
} }
   
sub Register2 { sub Register2 {
   if (!$regtype) { &fatal_error("registration_disabled"); }    if ( !$regtype ) { fatal_error('registration_disabled'); }
   if ($RegAgree && $FORM{'regagree'} ne 'yes') { &fatal_error('no_regagree'); }     if ( $RegAgree > 0 && $FORM{'regagree'} ne 'yes' ) { 
   my %member;         fatal_error('no_regagree'); 
   while (($key, $value) = each(%FORM)) {     } 
       $value =~ s~\A\s+~~;     my %member; 
       $value =~ s~\s+\Z~~;     while ( ( $key, $value ) = each %FORM ) { 
       unless ($key eq "reason") {$value =~ s~[\n\r]~~g;}         $value =~ s/\A\s+//xsm; 
       $member{$key} = $value;         $value =~ s/\s+\Z//xsm; 
   }        if ( $key ne 'reason' ) { $value =~ s/[\n\r]//gxsm; }
   if ($member{'domain'}) { $member{'email'} .= $member{'domain'}; }         $member{$key} = $value; 
   $member{'regusername'} =~ s/\s/_/g;     } 
   $member{'regrealname'} =~ s~\t+~\ ~g;     if ( $member{'domain'} ) { $member{'email'} .= $member{'domain'}; } 
  #    $member{'regusername'} =~ s/\s/_/gxsm;
   # Make sure users can't register with banned details     $member{'regrealname'} =~ s/\t+/\ /gsm; 
   &email_domain_check($member{'email'});  
   &banning($member{'regusername'}, $member{'email'});     # If enabled check if user has a valid e-mail address (needs Net::DNS to be installed) 
     if ( $imp_email_check == 1 ) {
   # check if there is a system hash named like this by checking existence through size         eval { 
   &fatal_error("system_prohibited_id", "($member{'regusername'})") if keys(%{ $member{'regusername'} }) > 0;             require Net::DNS; 
   &fatal_error("id_to_long","($member{'regusername'})") if length($member{'regusername'}) > 25;         }; 
   &fatal_error("email_to_long","($member{'email'})") if length($member{'email'}) > 100;         if ( !$EVAL_ERROR ) { 
   &fatal_error("no_username","($member{'regusername'})") if $member{'regusername'} eq '';             my $helo; 
   &fatal_error("id_alfa_only","($member{'regusername'})") if $member{'regusername'} eq '_';             require Mail::CheckUser; 
   &fatal_error("id_reserved","$member{'regusername'}") if $member{'regusername'} =~ /guest/i;             Mail::CheckUser->import(qw(check_email last_check)); 
   &fatal_error("invalid_character","$register_txt{'35'} $register_txt{'241re'}") if $member{'regusername'} =~ /[^\w\+\-\.\@]/;             $Mail::CheckUser::Sender_Addr = $webmaster_email; 
   &fatal_error("no_email","($member{'regusername'})") if $member{'email'} eq "";             if ($boardurl =~ /http\:\/\/(.*?)\//){ $Mail::CheckUser::Helo_Domain = $1; } 
   &fatal_error("id_taken","($member{'regusername'})") if -e ("$memberdir/$member{'regusername'}.vars");             if (check_email($member{'email'})) { 
   &fatal_error("password_is_userid") if $member{'regusername'} eq $member{'passwrd1'};                 my $email_ok = 1; 
   &fatal_error("no_reg_reason") if $member{'reason'} eq "" && $regtype == 1;             } 
             else {
   if ($spamfruits == 1) {                     my $failure = last_check()->{code}; 
       if($member{'ycord'} < 5 || $member{'ycord'} > 70) { &fatal_error("", "$fruittxt{'6'}"); }                 fatal_error(q{}, "$mail_check{'address'} $member{'email'} $mail_check{'invalid'} $mail_check{'reason'} $mail_check{$failure}"); 
       if($member{'thefruit'} eq $fruittxt{'2'} && ($member{'xcord'} < 5 || $member{'xcord'} > 75)) { &fatal_error("", "$fruittxt{'6'}"); }            }
       if($member{'thefruit'} eq $fruittxt{'3'} && ($member{'xcord'} < 75 || $member{'xcord'} > 145)) { &fatal_error("", "$fruittxt{'6'}"); }        }
       if($member{'thefruit'} eq $fruittxt{'4'} && ($member{'xcord'} < 145 || $member{'xcord'} > 215)) { &fatal_error("", "$fruittxt{'6'}"); }    }
       if($member{'thefruit'} eq $fruittxt{'5'} && ($member{'xcord'} < 215 || $member{'xcord'} > 285)) { &fatal_error("", "$fruittxt{'6'}"); }  
   }     # Make sure users can't register with banned details 
     email_domain_check( $member{'email'} );
   &FromChars($member{'regrealname'});     banning( $member{'regusername'}, $member{'email'} ); 
   $convertstr = $member{'regrealname'};  
   $convertcut = 30;  # check if there is a system hash named like this by checking existence through size 
   &CountChars;     if ( keys( %{ $member{'regusername'} } ) > 0 ) { 
     $member{'regrealname'} = $convertstr;         fatal_error( 'system_prohibited_id', "($member{'regusername'})" ); 
   &fatal_error("realname_to_long","($member{'regrealname'} => $convertstr)") if $cliped;     } 
   &fatal_error('invalid_character', "$register_txt{'38'} $register_txt{'241re'}") if $member{'regrealname'} =~ /[^ \w\x80-\xFF\[\]\(\)#\%\+,\-\|\.:=\?\@\^]/;     if ( length( $member{'regusername'} ) > 25 ) { 
         fatal_error( 'id_to_long', "($member{'regusername'})" );
   if ($name_cannot_be_userid && lc $member{'regusername'} eq lc $member{'regrealname'}) { &fatal_error('name_is_userid'); }    }
     if ( $member{'email'} ne $member{'email2'} && $imp_email_check ) {
   if (lc $member{'regusername'} eq lc &MemberIndex("check_exist", $member{'regusername'})) { &fatal_error("id_taken","($member{'regusername'})"); }         fatal_error( 'email_mismatch' ); 
   if (lc $member{'email'} eq lc &MemberIndex("check_exist", $member{'email'})) { &fatal_error("email_taken","($member{'email'})"); }    }
   if (lc $member{'regrealname'} eq lc &MemberIndex("check_exist", $member{'regrealname'})) { &fatal_error("name_taken"); }     if ( length( $member{'email'} ) > 100 ) { 
   if ( &CheckCensor($member{'regusername'}) ne "" ) { &fatal_error("censor1",&CheckCensor($member{'regusername'})); }         fatal_error( 'email_to_long', "($member{'email'})" ); 
   if ( &CheckCensor($member{'email'}) ne "" ) { &fatal_error("censor2",&CheckCensor($member{'email'})); }    }
   if ( &CheckCensor($member{'regrealname'}) ne "" ) { &fatal_error("censor3",&CheckCensor($member{'regrealname'})); }     if ( $member{'regusername'} eq q{} ) { 
   if ( $honeypot == 1 && $member{'add_field0'} ne q{}) {&fatal_error("bad_bot");}         fatal_error( 'no_username', "($member{'regusername'})" ); 
     }
   if ($regtype == 1) {    if ( $member{'regusername'} eq q{_} ) {
       $convertstr = $member{'reason'};         fatal_error( 'id_alfa_only', "($member{'regusername'})" ); 
       $convertcut = $RegReasonSymbols;     } 
       &CountChars;     if ( $member{'regusername'} =~ /guest/ixsm ) { 
       $member{'reason'} = $convertstr;         fatal_error( 'id_reserved', "$member{'regusername'}" ); 
     }
       &FromChars($member{'reason'});     if ( $member{'regusername'} =~ /[^\w\+\-\_\@\.]/sm ) { 
       &ToHTML($member{'reason'});         fatal_error( 'invalid_character', 
       &ToChars($member{'reason'});             "$register_txt{'35'} $register_txt{'241e'}" ); 
       $member{'reason'} =~ s~[\n\r]{1,2}~<br />~ig;     } 
   }     if ( $member{'regusername'} =~ /^[0-9]+$/sm ) { 
         fatal_error( 'all_numbers',
   if ($regcheck) { require "$sourcedir/Decoder.pl"; &validation_check($member{'verification'}); }             "$register_txt{'35'} $register_txt{'241n'}" ); 
   if ($en_spam_questions) {     } 
       fopen(SPAMQUESTIONS, "<$langdir/$language/spam.questions") || &fatal_error("cannot_open","$langdir/$language/spam.questions", 1);     if ( $member{'email'} eq q{} ) { 
       @spam_questions = <SPAMQUESTIONS>;         fatal_error( 'no_email', "($member{'regusername'})" ); 
       fclose(SPAMQUESTIONS);     } 
       foreach my $verification_question (@spam_questions) {    if ( -e ("$memberdir/$member{'regusername'}.vars") ) {
           chomp $verification_question;         fatal_error( 'id_taken', "($member{'regusername'})" ); 
           if ($verification_question =~ /$member{'verification_question_id'}/) {     } 
              (undef, undef, $verification_answer) = split(/\|/, $verification_question);     if ( $member{'regusername'} eq $member{'passwrd1'} ) { 
           }         fatal_error('password_is_userid'); 
       }    }
       $member{'verification_question'} =~ s/\A\s+//;     if ( $member{'reason'} eq q{} && $regtype == 1 ) { 
       $member{'verification_question'} =~ s/\s+\Z//;         fatal_error('no_reg_reason'); 
       unless ($spam_questions_case) {     } 
           $verification_answer = lc($verification_answer);  
           $member{'verification_question'} = lc($member{'verification_question'});     if ( $spamfruits == 1 ) { 
       }         if ( $member{'ycord'} < 5 || $member{'ycord'} > 70 ) { 
       &fatal_error("no_verification_question") if $member{'verification_question'} eq '';             fatal_error( q{}, "$fruittxt{'6'}" ); 
       @verificationanswer = split(/,/, $verification_answer);         } 
       foreach (@verificationanswer) {         if ( $member{'thefruit'} eq $fruittxt{'2'}