D:\WEBSITES\testbed\zipped\yabb252_09_17\cgi-bin\yabb2\Admin\Settings_Advanced.pl D:\WEBSITES\testbed\zipped\yabb252_09_25\cgi-bin\yabb2\Admin\Settings_Advanced.pl
############################################################################### ###############################################################################
# Settings_Advanced.pl                                                        # # Settings_Advanced.pl                                                        #
############################################################################### ###############################################################################
# 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.5.2                                                  #
# Packaged:       September 30, 2012                                          # # Packaged:       September 30, 2012                                          #
# 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-2012 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.                      #
############################################################################### ###############################################################################
   
$settings_advancedplver = 'YaBB 2.5.2 $Revision: 1.0 $'; $settings_advancedplver = 'YaBB 2.5.2 $Revision: 1.1 $';
if ($action eq 'detailedversion') { return 1; } if ($action eq 'detailedversion') { return 1; }
   
my $uploaddiriscorrect = qq~<span style="color: red;">$admin_txt{'164'}</span>~; my $uploaddiriscorrect = qq~<span style="color: red;">$admin_txt{'164'}</span>~;
if(-w $uploaddir && -d $uploaddir) {$uploaddiriscorrect = qq~<span style="color: green;">$admin_txt{'163'}</span>~;} if(-w $uploaddir && -d $uploaddir) {$uploaddiriscorrect = qq~<span style="color: green;">$admin_txt{'163'}</span>~;}
   
# Setting for gzip, if it's available # Setting for gzip, if it's available
my $compressgzip = (-e "/bin/gzip" && open(GZIP, "| gzip -f")) ? qq~\n  <option value="1" ${isselected($gzcomp == 1)}>$gztxt{'4'}</option>~ : ''; my $compressgzip = (-e "/bin/gzip" && open(GZIP, "| gzip -f")) ? qq~\n  <option value="1" ${isselected($gzcomp == 1)}>$gztxt{'4'}</option>~ : '';
   
# Setting for Compress::Zlib, if it's available # Setting for Compress::Zlib, if it's available
my $compresszlib; my $compresszlib;
eval { require Compress::Zlib; Compress::Zlib::memGzip("test"); }; eval { require Compress::Zlib; Compress::Zlib::memGzip("test"); };
$compresszlib = qq~\n  <option value="2" ${isselected($gzcomp == 2)}>$gztxt{'5'}</option>~ unless $@; $compresszlib = qq~\n  <option value="2" ${isselected($gzcomp == 2)}>$gztxt{'5'}</option>~ unless $@;
   
# RSS Defaults # RSS Defaults
if ($rss_disabled eq '') { $rss_disabled = 0; } if ($rss_disabled eq '') { $rss_disabled = 0; }
if ($rss_limit eq '') { $rss_limit = 10; } if ($rss_limit eq '') { $rss_limit = 10; }
if ($rss_message eq '') { $rss_message = 1; } if ($rss_message eq '') { $rss_message = 1; }
   
# Free Disk Space Checking # Free Disk Space Checking
my @disk_space = qx{df -k .};  if( $^O eq 'MSWin32' ) { 
map { $_ =~ s/ +/  /g } @disk_space;       @x = qx{DIR /-C}; 
     my $lastline = pop(@x); # should look like: 17 Directory(s), 21305790464 Bytes free  
     return -1 if $lastline !~ m/byte/i; # error trapping if output fails. The word byte should be in the line  
     $lastline =~ /^\s+(\d+)\s+(.+?)\s+(\d+)\s+(.+?)\n$/;  
     $FreeBytes = $3 - 100000; # 100000 bytes reserve  
     if ($FreeBytes >= 1073741824) {  
         $yyfreespace = sprintf("%.2f", $FreeBytes / (1024 * 1024 * 1024)) . " GB";  
     } elsif ($FreeBytes >= 1048576) {  
         $yyfreespace = sprintf("%.2f", $FreeBytes / (1024 * 1024)) . " MB";  
     } else {  
         $yyfreespace = sprintf("%.2f", $FreeBytes / 1024) . " KB";  
     }  
         @disk_space = $yyfreespace;  
  #       @quota = ();             
  }  
  else {  
     @disk_space = qx{df -k .};  
   
my @find = qx(find . -noleaf -type f -printf "%s-");     map { $_ =~ s/ +/  /g } @disk_space; 
  }  
     my @find = qx(find . -noleaf -type f -printf "%s-");  
   
$hostusername = $hostusername || (split(/ +/, qx{ls -l YaBB.$yyext}))[2];    $hostusername = $hostusername || (split(/ +/, qx{ls -l YaBB.$yyext}))[2];
my @quota = qx{quota -u $hostusername -v};    @quota = qx{quota -u $hostusername -v};
$quota[0] =~ s/^ +//;    $quota[0] =~ s/^ +//;
$quota[0] =~ s/ /&nbsp;/g;    $quota[0] =~ s/ /&nbsp;/g;
$quota[1] =~ s/^ +//;    $quota[1] =~ s/^ +//;
$quota[1] =~ s/ /&nbsp;/g;    $quota[1] =~ s/ /&nbsp;/g;
my $quota_select = qq~$quota[0]<br />$quota[1]~;    my $quota_select = qq~$quota[0]<br />$quota[1]~;
if ($quota[2]) {    if ($quota[2]) {
   my $ds = (split(/ +/, $disk_space[1], 2))[0] if !$enable_quota;        my $ds = (split(/ +/, $disk_space[1], 2))[0] if !$enable_quota;
   $quota_select .= qq~<br /><select name="enable_quota_value">~;        $quota_select .= qq~<br /><select name="enable_quota_value">~;
   for (my $i = 2; $i < @quota; $i++) {        for (my $i = 2; $i < @quota; $i++) {
       $quota[$i] =~ s/^ +//;            $quota[$i] =~ s/^ +//;
       $quota[$i] =~ s/ +/&nbsp;&nbsp;/g;            $quota[$i] =~ s/ +/&nbsp;&nbsp;/g;
       $quota_select .= qq~<option value="$i" ~ . ${isselected($i == $enable_quota || ($ds && $quota[$i] =~ /^$ds/))} . qq~>$quota[$i]</option>~;            $quota_select .= qq~<option value="$i" ~ . ${isselected($i == $enable_quota || ($ds && $quota[$i] =~ /^$ds/))} . qq~>$quota[$i]</option>~;
   }        }
   $quota_select .= '</select>';        $quota_select .= '</select>';
  #   } 
} }
   
# List of settings # List of settings
@settings = ( @settings = (
{ {
   name  => $settings_txt{'permarss'},    name  => $settings_txt{'permarss'},
   id    => 'permarss',    id    => 'permarss',
   items => [    items => [
       # Permalinks        # Permalinks
       {        {
           header => $admin_txt{'24'},            header => $admin_txt{'24'},
       },        },
       {        {
           description => qq~<label for="accept_permalink">$admin_txt{'22'}</label>~,            description => qq~<label for="accept_permalink">$admin_txt{'22'}</label>~,
           input_html => qq~<input type="checkbox" name="accept_permalink" id="accept_permalink" value="1" ${ischecked($accept_permalink)}/>~,            input_html => qq~<input type="checkbox" name="accept_permalink" id="accept_permalink" value="1" ${ischecked($accept_permalink)}/>~,
           name => 'accept_permalink',            name => 'accept_permalink',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="symlink">$admin_txt{'25'}<br /><span class="small">$admin_txt{'26'}</span></label>~,            description => qq~<label for="symlink">$admin_txt{'25'}<br /><span class="small">$admin_txt{'26'}</span></label>~,
           input_html => qq~<input type="text" size="30" name="symlink" id="symlink" value="$symlink" />~,            input_html => qq~<input type="text" size="30" name="symlink" id="symlink" value="$symlink" />~,
           name => 'symlink',            name => 'symlink',
           validate => 'text,null',            validate => 'text,null',
           depends_on => ['accept_permalink'],            depends_on => ['accept_permalink'],
       },        },
       {        {
           description => qq~<label for="perm_domain">$admin_txt{'23'}</label>~,            description => qq~<label for="perm_domain">$admin_txt{'23'}</label>~,
           input_html => qq~<input type="text" size="30" name="perm_domain" id="perm_domain" value="$perm_domain" />~,            input_html => qq~<input type="text" size="30" name="perm_domain" id="perm_domain" value="$perm_domain" />~,
           name => 'perm_domain',            name => 'perm_domain',
           validate => 'text,null',            validate => 'text,null',
           depends_on => ['accept_permalink'],            depends_on => ['accept_permalink'],
       },        },
       # RSS        # RSS
       {        {
           header => $settings_txt{'rss'},            header => $settings_txt{'rss'},
       },        },
       {        {
           description => qq~<label for="rss_disabled">$rss_txt{'1'}</label>~,            description => qq~<label for="rss_disabled">$rss_txt{'1'}</label>~,
           input_html => qq~<input type="checkbox" name="rss_disabled" id="rss_disabled" value="1"${ischecked($rss_disabled)} />~,            input_html => qq~<input type="checkbox" name="rss_disabled" id="rss_disabled" value="1"${ischecked($rss_disabled)} />~,
           name => 'rss_disabled',            name => 'rss_disabled',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="rss_limit">$rss_txt{'2'}</label>~,            description => qq~<label for="rss_limit">$rss_txt{'2'}</label>~,
           input_html => qq~<input type="text" name="rss_limit" id="rss_limit" size="5" value="$rss_limit" />~,            input_html => qq~<input type="text" name="rss_limit" id="rss_limit" size="5" value="$rss_limit" />~,
           name => 'rss_limit',            name => 'rss_limit',
           validate => 'number',            validate => 'number',
           depends_on => ['!rss_disabled'],            depends_on => ['!rss_disabled'],
       },        },
   
       {        {
           description => qq~<label for="showauthor">$rss_txt{'7'}</label>~,            description => qq~<label for="showauthor">$rss_txt{'7'}</label>~,
           input_html => qq~<input type="checkbox" name="showauthor" id="showauthor" size="5"${ischecked($showauthor)} />~,            input_html => qq~<input type="checkbox" name="showauthor" id="showauthor" size="5"${ischecked($showauthor)} />~,
           name => 'showauthor',            name => 'showauthor',
           validate => 'boolean',            validate => 'boolean',
           depends_on => ['!rss_disabled'],            depends_on => ['!rss_disabled'],
       },        },
       {        {
           description => qq~<label for="showdate">$rss_txt{'8'}</label>~,            description => qq~<label for="showdate">$rss_txt{'8'}</label>~,
           input_html => qq~<input type="checkbox" name="showdate" id="showdate" size="5"${ischecked($showdate)} />~,            input_html => qq~<input type="checkbox" name="showdate" id="showdate" size="5"${ischecked($showdate)} />~,
           name => 'showdate',            name => 'showdate',
           validate => 'boolean',            validate => 'boolean',
           depends_on => ['!rss_disabled'],            depends_on => ['!rss_disabled'],
       },        },
       {        {
           description => qq~<label for="rss_message">$rss_txt{'3'}</label>~,            description => qq~<label for="rss_message">$rss_txt{'3'}</label>~,
           input_html => qq~            input_html => qq~
<select name="rss_message" id="rss_message" size="1"> <select name="rss_message" id="rss_message" size="1">
 <option value="0" ${isselected($rss_message == 0)}>$rss_txt{'4'}</option>  <option value="0" ${isselected($rss_message == 0)}>$rss_txt{'4'}</option>
 <option value="1" ${isselected($rss_message == 1)}>$rss_txt{'5'}</option>  <option value="1" ${isselected($rss_message == 1)}>$rss_txt{'5'}</option>
 <option value="2" ${isselected($rss_message == 2)}>$rss_txt{'6'}</option>  <option value="2" ${isselected($rss_message == 2)}>$rss_txt{'6'}</option>
</select>~, </select>~,
           name => 'rss_message',            name => 'rss_message',
           validate => 'number',            validate => 'number',
           depends_on => ['!rss_disabled'],            depends_on => ['!rss_disabled'],
       },        },
   
   ],    ],
}, },
{ {
   name  => $settings_txt{'email'},    name  => $settings_txt{'email'},
   id    => 'email',    id    => 'email',
   items => [    items => [
       # Email        # Email
       {        {
           header => $settings_txt{'email'},            header => $settings_txt{'email'},
       },        },
       {        {
           description => qq~<label for="mailtype">$admin_txt{'404'}</label>~,            description => qq~<label for="mailtype">$admin_txt{'404'}</label>~,
           input_html => qq~            input_html => qq~
<select name="mailtype" id="mailtype" size="1"> <select name="mailtype" id="mailtype" size="1">
 <option value="0" ${isselected($mailtype == 0)}>$smtp_txt{'sendmail'}</option>  <option value="0" ${isselected($mailtype == 0)}>$smtp_txt{'sendmail'}</option>
 <option value="1" ${isselected($mailtype == 1)}>$smtp_txt{'smtp'}</option>  <option value="1" ${isselected($mailtype == 1)}>$smtp_txt{'smtp'}</option>
 <option value="2" ${isselected($mailtype == 2)}>$smtp_txt{'net'}</option>  <option value="2" ${isselected($mailtype == 2)}>$smtp_txt{'net'}</option>
 <option value="3" ${isselected($mailtype == 3)}>$smtp_txt{'tslnet'}</option>  <option value="3" ${isselected($mailtype == 3)}>$smtp_txt{'tslnet'}</option>
</select>~, </select>~,
           name => 'mailtype',            name => 'mailtype',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="mailprog">$admin_txt{'354'}</label>~,            description => qq~<label for="mailprog">$admin_txt{'354'}</label>~,
           input_html => qq~<input type="text" name="mailprog" id="mailprog" size="20" value="$mailprog" />~,            input_html => qq~<input type="text" name="mailprog" id="mailprog" size="20" value="$mailprog" />~,
           name => 'mailprog',            name => 'mailprog',
           validate => 'text,null',            validate => 'text,null',
       },        },
       {        {
           description => qq~<label for="smtp_server">$admin_txt{'407'}</label>~,            description => qq~<label for="smtp_server">$admin_txt{'407'}</label>~,
           input_html => qq~<input type="text" name="smtp_server" id="smtp_server" size="20" value="$smtp_server" />~,            input_html => qq~<input type="text" name="smtp_server" id="smtp_server" size="20" value="$smtp_server" />~,
           name => 'smtp_server',            name => 'smtp_server',
           validate => 'text,null',            validate => 'text,null',
       },        },
       {        {
           description => qq~<label for="smtp_auth_required">$smtp_txt{'1'}</label>~,            description => qq~<label for="smtp_auth_required">$smtp_txt{'1'}</label>~,
           input_html => qq~            input_html => qq~
<select name="smtp_auth_required" id="smtp_auth_required" size="1"> <select name="smtp_auth_required" id="smtp_auth_required" size="1">
 <option value="4" ${isselected($smtp_auth_required == 4)}>$smtp_txt{'auto'}</option>  <option value="4" ${isselected($smtp_auth_required == 4)}>$smtp_txt{'auto'}</option>
 <option value="3" ${isselected($smtp_auth_required == 3)}>$smtp_txt{'cram'}</option>  <option value="3" ${isselected($smtp_auth_required == 3)}>$smtp_txt{'cram'}</option>
 <option value="2" ${isselected($smtp_auth_required == 2)}>$smtp_txt{'login'}</option>  <option value="2" ${isselected($smtp_auth_required == 2)}>$smtp_txt{'login'}</option>
 <option value="1" ${isselected($smtp_auth_required == 1)}>$smtp_txt{'plain'}</option>  <option value="1" ${isselected($smtp_auth_required == 1)}>$smtp_txt{'plain'}</option>
 <option value="0" ${isselected($smtp_auth_required == 0)}>$smtp_txt{'off'}</option>  <option value="0" ${isselected($smtp_auth_required == 0)}>$smtp_txt{'off'}</option>
</select>~, </select>~,
           name => 'smtp_auth_required',            name => 'smtp_auth_required',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="authuser">$smtp_txt{'3'}</label>~,            description => qq~<label for="authuser">$smtp_txt{'3'}</label>~,
           input_html => qq~<input type="text" name="authuser" id="authuser" size="20" value="$authuser" />~,            input_html => qq~<input type="text" name="authuser" id="authuser" size="20" value="$authuser" />~,
           name => 'authuser',            name => 'authuser',
           validate => 'text,null',            validate => 'text,null',
       },        },
       {        {
           description => qq~<label for="authpass">$smtp_txt{'4'}</label>~,            description => qq~<label for="authpass">$smtp_txt{'4'}</label>~,
           input_html => qq~<input type="password" name="authpass" id="authpass" size="20" value="$authpass" />~,            input_html => qq~<input type="password" name="authpass" id="authpass" size="20" value="$authpass" />~,
           name => 'authpass',            name => 'authpass',
           validate => 'text,null',            validate => 'text,null',
       },        },
       {        {
           description => qq~<label for="webmaster_email">$admin_txt{'355'}</label>~,            description => qq~<label for="webmaster_email">$admin_txt{'355'}</label>~,
           input_html => qq~<input type="text" name="webmaster_email" id="webmaster_email" size="35" value="$webmaster_email" />~,            input_html => qq~<input type="text" name="webmaster_email" id="webmaster_email" size="35" value="$webmaster_email" />~,
           name => 'webmaster_email',            name => 'webmaster_email',
           validate => 'text',            validate => 'text',
       },        },
       # New Member Notification        # New Member Notification
       {        {
           header => $admin_txt{'366'},            header => $admin_txt{'366'},
       },        },
       {        {
           description => qq~<label for="new_member_notification">$admin_txt{'367'}</label>~,            description => qq~<label for="new_member_notification">$admin_txt{'367'}</label>~,
           input_html => qq~<input type="checkbox" name="new_member_notification" id="new_member_notification" value="1"${ischecked($new_member_notification)} />~,            input_html => qq~<input type="checkbox" name="new_member_notification" id="new_member_notification" value="1"${ischecked($new_member_notification)} />~,
           name => 'new_member_notification',            name => 'new_member_notification',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="new_member_notification_mail">$admin_txt{'368'}</label>~,            description => qq~<label for="new_member_notification_mail">$admin_txt{'368'}</label>~,
           input_html => qq~<input type="text" name="new_member_notification_mail" id="new_member_notification_mail" size="35" value="$new_member_notification_mail" />~,            input_html => qq~<input type="text" name="new_member_notification_mail" id="new_member_notification_mail" size="35" value="$new_member_notification_mail" />~,
           name => 'new_member_notification_mail',            name => 'new_member_notification_mail',
           validate => 'text,null',            validate => 'text,null',
           depends_on => ['new_member_notification']            depends_on => ['new_member_notification']
       },        },
       # New Member Notification        # New Member Notification
       {        {
           header => $admin_txt{'600'},            header => $admin_txt{'600'},
       },        },
       {        {
           description => qq~<label for="sendtopicmail">$admin_txt{'601'}</label>~,            description => qq~<label for="sendtopicmail">$admin_txt{'601'}</label>~,
           input_html => qq~<select name="sendtopicmail" id="sendtopicmail">            input_html => qq~<select name="sendtopicmail" id="sendtopicmail">
               <option value="0"${isselected($sendtopicmail == 0)}>$admin_txt{'602'}</option>                <option value="0"${isselected($sendtopicmail == 0)}>$admin_txt{'602'}</option>
               <option value="1"${isselected($sendtopicmail == 1)}>$admin_txt{'603'}</option>                <option value="1"${isselected($sendtopicmail == 1)}>$admin_txt{'603'}</option>
               <option value="2"${isselected($sendtopicmail == 2)}>$admin_txt{'604'}</option>                <option value="2"${isselected($sendtopicmail == 2)}>$admin_txt{'604'}</option>
               <option value="3"${isselected($sendtopicmail == 3)}>$admin_txt{'605'}</option>                <option value="3"${isselected($sendtopicmail == 3)}>$admin_txt{'605'}</option>
           </select>~,            </select>~,
           name => 'sendtopicmail',            name => 'sendtopicmail',
           validate => 'number',            validate => 'number',
       },        },
   ],    ],
}, },
{ {
   name => $settings_txt{'attachments'},    name => $settings_txt{'attachments'},
   id => 'attachments',    id => 'attachments',
   items => [    items => [
       {        {
           header => $settings_txt{'attachments'},            header => $settings_txt{'attachments'},
       },        },
       {        {
           description => qq~$edit_paths_txt{'20'}<br />$settings_txt{'changeinpaths'}~,            description => qq~$edit_paths_txt{'20'}<br />$settings_txt{'changeinpaths'}~,
           input_html => $uploaddir, # Non-changable setting            input_html => $uploaddir, # Non-changable setting
       },        },
       {        {
           description => $settings_txt{'uploaddircorrect'},            description => $settings_txt{'uploaddircorrect'},
           input_html => $uploaddiriscorrect, # This is tested to see if it's valid at the top of the file.            input_html => $uploaddiriscorrect, # This is tested to see if it's valid at the top of the file.
       },        },
       {        {
           description => $fatxt{'17'},            description => $fatxt{'17'},
           input_html => qq~<input type="text" name="allowattach" id="allowattach" size="5" value="$allowattach" /> ~,            input_html => qq~<input type="text" name="allowattach" id="allowattach" size="5" value="$allowattach" /> ~,
           name => 'allowattach',            name => 'allowattach',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="allowguestattach">$fatxt{'18'}</label>~,            description => qq~<label for="allowguestattach">$fatxt{'18'}</label>~,
           input_html => qq~<input type="checkbox" name="allowguestattach" id="allowguestattach" value="1" ${ischecked($allowguestattach)}/>~,            input_html => qq~<input type="checkbox" name="allowguestattach" id="allowguestattach" value="1" ${ischecked($allowguestattach)}/>~,
           name => 'allowguestattach',            name => 'allowguestattach',
           validate => 'boolean',            validate => 'boolean',
           depends_on => ['allowattach!=0'],            depends_on => ['allowattach!=0'],
       },        },
       {        {
           description => qq~<label for="amdisplaypics">$fatxt{'16'}</label>~,            description => qq~<label for="amdisplaypics">$fatxt{'16'}</label>~,
           input_html => qq~<input type="checkbox" name="amdisplaypics" id="amdisplaypics" value="1" ${ischecked($amdisplaypics)}/>~,            input_html => qq~<input type="checkbox" name="amdisplaypics" id="amdisplaypics" value="1" ${ischecked($amdisplaypics)}/>~,
           name => 'amdisplaypics',            name => 'amdisplaypics',
           validate => 'boolean',            validate => 'boolean',
           depends_on => ['allowattach!=0'],            depends_on => ['allowattach!=0'],
       },        },
       {        {
           description => qq~<label for="checkext">$fatxt{'15'}</label>~,            description => qq~<label for="checkext">$fatxt{'15'}</label>~,
           input_html => qq~<input type="checkbox" name="checkext" id="checkext" value="1" ${ischecked($checkext)}/>~,            input_html => qq~<input type="checkbox" name="checkext" id="checkext" value="1" ${ischecked($checkext)}/>~,
           name => 'checkext',            name => 'checkext',
           validate => 'boolean',            validate => 'boolean',
           depends_on => ['allowattach!=0'],            depends_on => ['allowattach!=0'],
       },        },
       {        {
           description => qq~<label for="extensions">$fatxt{'14'}</label>~,            description => qq~<label for="extensions">$fatxt{'14'}</label>~,
           input_html => qq~<input type="text" name="extensions" id="extensions" size="35" value="~ . join(' ', @ext) . qq~" />~,            input_html => qq~<input type="text" name="extensions" id="extensions" size="35" value="~ . join(' ', @ext) . qq~" />~,
           name => 'extensions',            name => 'extensions',
           validate => 'text',            validate => 'text',
           depends_on => ['allowattach!=0', 'checkext'],            depends_on => ['allowattach!=0', 'checkext'],
       },        },
       {        {
           description => qq~<label for="limit">$fatxt{'12'}</label>~,            description => qq~<label for="limit">$fatxt{'12'}</label>~,
           input_html => qq~<input type="text" name="limit" id="limit" size="5" value="$limit" /> KB~,            input_html => qq~<input type="text" name="limit" id="limit" size="5" value="$limit" /> KB~,
           name => 'limit',            name => 'limit',
           validate => 'number',            validate => 'number',
           depends_on => ['allowattach!=0'],            depends_on => ['allowattach!=0'],
       },        },
       {        {
           description => qq~<label for="dirlimit">$fatxt{'13'}</label>~,            description => qq~<label for="dirlimit">$fatxt{'13'}</label>~,
           input_html => qq~<input type="text" name="dirlimit" id="dirlimit" size="5" value="$dirlimit" /> KB~,            input_html => qq~<input type="text" name="dirlimit" id="dirlimit" size="5" value="$dirlimit" /> KB~,
           name => 'dirlimit',            name => 'dirlimit',
           validate => 'number',            validate => 'number',
           depends_on => ['allowattach!=0'],            depends_on => ['allowattach!=0'],
       },        },
       {        {
           description => qq~<label for="overwrite">$fatxt{'53'}</label>~,            description => qq~<label for="overwrite">$fatxt{'53'}</label>~,
           input_html => qq~            input_html => qq~
           <select name="overwrite" id="overwrite" size="1">            <select name="overwrite" id="overwrite" size="1">
           <option value="0"${isselected($overwrite == 0)}>$fatxt{'54r'}</option>            <option value="0"${isselected($overwrite == 0)}>$fatxt{'54r'}</option>
           <option value="1"${isselected($overwrite == 1)}>$fatxt{'54o'}</option>            <option value="1"${isselected($overwrite == 1)}>$fatxt{'54o'}</option>
           <option value="2"${isselected($overwrite == 2)}>$fatxt{'54n'}</option>            <option value="2"${isselected($overwrite == 2)}>$fatxt{'54n'}</option>
           </select>~,            </select>~,
           name => 'overwrite',            name => 'overwrite',
           validate => 'number',            validate => 'number',
           depends_on => ['allowattach!=0'],            depends_on => ['allowattach!=0'],
       },        },
   ],    ],
}, },
{ {
   name  => $settings_txt{'images'},    name  => $settings_txt{'images'},
   id    => 'images',    id    => 'images',
   items => [    items => [
       {        {
           header => $admin_txt{'471'},            header => $admin_txt{'471'},
       },        },
       {        {
           description => qq~<label for="max_avatar_width">$admin_txt{'472'}</label>~,            description => qq~<label for="max_avatar_width">$admin_txt{'472'}</label>~,
           input_html => qq~<input type="text" name="max_avatar_width" id="max_avatar_width" size="5" value="$max_avatar_width" /> pixel~,            input_html => qq~<input type="text" name="max_avatar_width" id="max_avatar_width" size="5" value="$max_avatar_width" /> pixel~,
           name => 'max_avatar_width',            name => 'max_avatar_width',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="max_avatar_height">$admin_txt{'473'}</label>~,            description => qq~<label for="max_avatar_height">$admin_txt{'473'}</label>~,
           input_html => qq~<input type="text" name="max_avatar_height" id="max_avatar_height" size="5" value="$max_avatar_height" /> pixel~,            input_html => qq~<input type="text" name="max_avatar_height" id="max_avatar_height" size="5" value="$max_avatar_height" /> pixel~,
           name => 'max_avatar_height',            name => 'max_avatar_height',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="fix_avatar_img_size">$admin_txt{'473x'}</label>~,            description => qq~<label for="fix_avatar_img_size">$admin_txt{'473x'}</label>~,
           input_html => qq~<input type="checkbox" name="fix_avatar_img_size" id="fix_avatar_img_size" value="1"${ischecked($fix_avatar_img_size)} />~,            input_html => qq~<input type="checkbox" name="fix_avatar_img_size" id="fix_avatar_img_size" value="1"${ischecked($fix_avatar_img_size)} />~,
           name => 'fix_avatar_img_size',            name => 'fix_avatar_img_size',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="max_post_img_width">$admin_txt{'474'}</label>~,            description => qq~<label for="max_post_img_width">$admin_txt{'474'}</label>~,
           input_html => qq~<input type="text" name="max_post_img_width" id="max_post_img_width" size="5" value="$max_post_img_width" /> pixel~,            input_html => qq~<input type="text" name="max_post_img_width" id="max_post_img_width" size="5" value="$max_post_img_width" /> pixel~,
           name => 'max_post_img_width',            name => 'max_post_img_width',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="max_post_img_height">$admin_txt{'475'}</label>~,            description => qq~<label for="max_post_img_height">$admin_txt{'475'}</label>~,
           input_html => qq~<input type="text" name="max_post_img_height" id="max_post_img_height" size="5" value="$max_post_img_height" /> pixel~,            input_html => qq~<input type="text" name="max_post_img_height" id="max_post_img_height" size="5" value="$max_post_img_height" /> pixel~,
           name => 'max_post_img_height',            name => 'max_post_img_height',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="fix_post_img_size">$admin_txt{'475x'}</label>~,            description => qq~<label for="fix_post_img_size">$admin_txt{'475x'}</label>~,
           input_html => qq~<input type="checkbox" name="fix_post_img_size" id="fix_post_img_size" value="1"${ischecked($fix_post_img_size)} />~,            input_html => qq~<input type="checkbox" name="fix_post_img_size" id="fix_post_img_size" value="1"${ischecked($fix_post_img_size)} />~,
           name => 'fix_post_img_size',            name => 'fix_post_img_size',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="max_signat_img_width">$admin_txt{'476'}</label>~,            description => qq~<label for="max_signat_img_width">$admin_txt{'476'}</label>~,
           input_html => qq~<input type="text" name="max_signat_img_width" id="max_signat_img_width" size="5" value="$max_signat_img_width" /> pixel~,            input_html => qq~<input type="text" name="max_signat_img_width" id="max_signat_img_width" size="5" value="$max_signat_img_width" /> pixel~,
           name => 'max_signat_img_width',            name => 'max_signat_img_width',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="max_signat_img_height">$admin_txt{'477'}</label>~,            description => qq~<label for="max_signat_img_height">$admin_txt{'477'}</label>~,
           input_html => qq~<input type="text" name="max_signat_img_height" id="max_signat_img_height" size="5" value="$max_signat_img_height" /> pixel~,            input_html => qq~<input type="text" name="max_signat_img_height" id="max_signat_img_height" size="5" value="$max_signat_img_height" /> pixel~,
           name => 'max_signat_img_height',            name => 'max_signat_img_height',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="fix_signat_img_size">$admin_txt{'477x'}</label>~,            description => qq~<label for="fix_signat_img_size">$admin_txt{'477x'}</label>~,
           input_html => qq~<input type="checkbox" name="fix_signat_img_size" id="fix_signat_img_size" value="1"${ischecked($fix_signat_img_size)} />~,            input_html => qq~<input type="checkbox" name="fix_signat_img_size" id="fix_signat_img_size" value="1"${ischecked($fix_signat_img_size)} />~,
           name => 'fix_signat_img_size',            name => 'fix_signat_img_size',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="max_attach_img_width">$admin_txt{'478'}</label>~,            description => qq~<label for="max_attach_img_width">$admin_txt{'478'}</label>~,
           input_html => qq~<input type="text" name="max_attach_img_width" id="max_attach_img_width" size="5" value="$max_attach_img_width" /> pixel~,            input_html => qq~<input type="text" name="max_attach_img_width" id="max_attach_img_width" size="5" value="$max_attach_img_width" /> pixel~,
           name => 'max_attach_img_width',            name => 'max_attach_img_width',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="max_attach_img_height">$admin_txt{'479'}</label>~,            description => qq~<label for="max_attach_img_height">$admin_txt{'479'}</label>~,
           input_html => qq~<input type="text" name="max_attach_img_height" id="max_attach_img_height" size="5" value="$max_attach_img_height" /> pixel~,            input_html => qq~<input type="text" name="max_attach_img_height" id="max_attach_img_height" size="5" value="$max_attach_img_height" /> pixel~,
           name => 'max_attach_img_height',            name => 'max_attach_img_height',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="fix_attach_img_size">$admin_txt{'479x'}</label>~,            description => qq~<label for="fix_attach_img_size">$admin_txt{'479x'}</label>~,
           input_html => qq~<input type="checkbox" name="fix_attach_img_size" id="fix_attach_img_size" value="1"${ischecked($fix_attach_img_size)} />~,            input_html => qq~<input type="checkbox" name="fix_attach_img_size" id="fix_attach_img_size" value="1"${ischecked($fix_attach_img_size)} />~,
           name => 'fix_attach_img_size',            name => 'fix_attach_img_size',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="img_greybox">$admin_txt{'479a'}</label>~,            description => qq~<label for="img_greybox">$admin_txt{'479a'}</label>~,
           input_html => qq~            input_html => qq~
               <select name="img_greybox" id="img_greybox">                <select name="img_greybox" id="img_greybox">
                   <option value="0"${isselected(!$img_greybox)}>$admin_txt{'479b'}</option>                    <option value="0"${isselected(!$img_greybox)}>$admin_txt{'479b'}</option>
                   <option value="1"${isselected($img_greybox == 1)}>$admin_txt{'479c'}</option>                    <option value="1"${isselected($img_greybox == 1)}>$admin_txt{'479c'}</option>
                   <option value="2"${isselected($img_greybox == 2)}>$admin_txt{'479d'}</option>                    <option value="2"${isselected($img_greybox == 2)}>$admin_txt{'479d'}</option>
               </select>~,                </select>~,
           name => 'img_greybox',            name => 'img_greybox',
           validate => 'number',            validate => 'number',
       },        },
   ]    ]
}, },
{ {
   name  => $settings_txt{'advanced'},    name  => $settings_txt{'advanced'},
   id    => 'advanced',    id    => 'advanced',
   items => [    items => [
       {        {
           header => $settop_txt{'5'},            header => $settop_txt{'5'},
       },        },
       {        {
           description => qq~<label for="gzcomp">$gztxt{'1'}</label>~,            description => qq~<label for="gzcomp">$gztxt{'1'}</label>~,
           input_html => qq~            input_html => qq~
<select name="gzcomp" id="gzcomp" size="1"> <select name="gzcomp" id="gzcomp" size="1">
 <option value="0" ${isselected($gzcomp == 0)}>$gztxt{'3'}</option>$compressgzip$compresszlib  <option value="0" ${isselected($gzcomp == 0)}>$gztxt{'3'}</option>$compressgzip$compresszlib
</select>~, </select>~,
           name => 'gzcomp',            name => 'gzcomp',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="gzforce">$gztxt{'2'}</label>~,            description => qq~<label for="gzforce">$gztxt{'2'}</label>~,
           input_html => qq~<input type="checkbox" name="gzforce" id="gzforce" value="1" ${ischecked($gzforce)}/>~,            input_html => qq~<input type="checkbox" name="gzforce" id="gzforce" value="1" ${ischecked($gzforce)}/>~,
           name => 'gzforce',            name => 'gzforce',
           validate => 'boolean',            validate => 'boolean',
           depends_on => ['gzcomp!=0'],            depends_on => ['gzcomp!=0'],
       },        },
       {        {
           description => qq~<label for="cachebehaviour">$admin_txt{'802'}</label>~,            description => qq~<label for="cachebehaviour">$admin_txt{'802'}</label>~,
           input_html => qq~<input type="checkbox" name="cachebehaviour" id="cachebehaviour" value="1" ${ischecked($cachebehaviour)}/>~,            input_html => qq~<input type="checkbox" name="cachebehaviour" id="cachebehaviour" value="1" ${ischecked($cachebehaviour)}/>~,
           name => 'cachebehaviour',            name => 'cachebehaviour',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="enableclicklog">$admin_txt{'803'}</label>~,            description => qq~<label for="enableclicklog">$admin_txt{'803'}</label>~,
           input_html => qq~<input type="checkbox" name="enableclicklog" id="enableclicklog" value="1" ${ischecked($enableclicklog)}/>~,            input_html => qq~<input type="checkbox" name="enableclicklog" id="enableclicklog" value="1" ${ischecked($enableclicklog)}/>~,
           name => 'enableclicklog',            name => 'enableclicklog',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="ClickLogTime">$admin_txt{'690'}</label>~,            description => qq~<label for="ClickLogTime">$admin_txt{'690'}</label>~,
           input_html => qq~<input type="text" name="ClickLogTime" id="ClickLogTime" size="5" value="$ClickLogTime" />~,            input_html => qq~<input type="text" name="ClickLogTime" id="ClickLogTime" size="5" value="$ClickLogTime" />~,
           name => 'ClickLogTime',            name => 'ClickLogTime',
           validate => 'number',            validate => 'number',
           depends_on => ['enableclicklog'],            depends_on => ['enableclicklog'],
       },        },
       {        {
           description => qq~<label for="max_log_days_old">$admin_txt{'376'}</label>~,            description => qq~<label for="max_log_days_old">$admin_txt{'376'}</label>~,
           input_html => qq~<input type="text" name="max_log_days_old" id="max_log_days_old" size="5" value="$max_log_days_old" />~,            input_html => qq~<input type="text" name="max_log_days_old" id="max_log_days_old" size="5" value="$max_log_days_old" />~,
           name => 'max_log_days_old',            name => 'max_log_days_old',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="maxrecentdisplay">$floodtxt{'5'}</label>~,            description => qq~<label for="maxrecentdisplay">$floodtxt{'5'}</label>~,
           input_html => qq~<input type="text" name="maxrecentdisplay" id="maxrecentdisplay" size="5" value="$maxrecentdisplay" />~,            input_html => qq~<input type="text" name="maxrecentdisplay" id="maxrecentdisplay" size="5" value="$maxrecentdisplay" />~,
           name => 'maxrecentdisplay',            name => 'maxrecentdisplay',
           validate => 'fullnumber',            validate => 'fullnumber',
       },        },
       {        {
           description => qq~<label for="maxsearchdisplay">$floodtxt{'6'}</label>~,            description => qq~<label for="maxsearchdisplay">$floodtxt{'6'}</label>~,
           input_html => qq~<input type="text" name="maxsearchdisplay" id="maxsearchdisplay" size="5" value="$maxsearchdisplay" />~,            input_html => qq~<input type="text" name="maxsearchdisplay" id="maxsearchdisplay" size="5" value="$maxsearchdisplay" />~,
           name => 'maxsearchdisplay',            name => 'maxsearchdisplay',
           validate => 'fullnumber',            validate => 'fullnumber',
       },        },
       {        {
           description => qq~<label for="OnlineLogTime">$amv_txt{'13'}</label>~,            description => qq~<label for="OnlineLogTime">$amv_txt{'13'}</label>~,
           input_html => qq~<input type="text" name="OnlineLogTime" id="OnlineLogTime" size="5" value="$OnlineLogTime" />~,            input_html => qq~<input type="text" name="OnlineLogTime" id="OnlineLogTime" size="5" value="$OnlineLogTime" />~,
           name => 'OnlineLogTime',            name => 'OnlineLogTime',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           description => qq~<label for="lastonlineinlink">$amv_txt{'25'}</label>~,            description => qq~<label for="lastonlineinlink">$amv_txt{'25'}</label>~,
           input_html => qq~<input type="checkbox" name="lastonlineinlink" id="lastonlineinlink" size="5" value="1" ${ischecked($lastonlineinlink)}/>~,            input_html => qq~<input type="checkbox" name="lastonlineinlink" id="lastonlineinlink" size="5" value="1" ${ischecked($lastonlineinlink)}/>~,
           name => 'lastonlineinlink',            name => 'lastonlineinlink',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           header => $errorlog{'25'},            header => $errorlog{'25'},
       },        },
       {        {
           description => qq~<label for="elenable">$errorlog{'22'}</label>~,            description => qq~<label for="elenable">$errorlog{'22'}</label>~,
           input_html => qq~<input type="checkbox" name="elenable" id="elenable" value="1" ${ischecked($elenable)}/>~,            input_html => qq~<input type="checkbox" name="elenable" id="elenable" value="1" ${ischecked($elenable)}/>~,
           name => 'elenable',            name => 'elenable',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="elrotate">$errorlog{'23'}</label>~,            description => qq~<label for="elrotate">$errorlog{'23'}</label>~,
           input_html => qq~<input type="checkbox" name="elrotate" id="elrotate" value="1" ${ischecked($elrotate)}/>~,            input_html => qq~<input type="checkbox" name="elrotate" id="elrotate" value="1" ${ischecked($elrotate)}/>~,
           name => 'elrotate',            name => 'elrotate',
           validate => 'boolean',            validate => 'boolean',
           depends_on => ['elenable'],            depends_on => ['elenable'],
       },        },
       {        {
           description => qq~<label for="elmax">$errorlog{'24'}</label>~,            description => qq~<label for="elmax">$errorlog{'24'}</label>~,
           input_html => qq~<input type="text" name="elmax" id="elmax" size="5" value="$elmax" />~,            input_html => qq~<input type="text" name="elmax" id="elmax" size="5" value="$elmax" />~,
           name => 'elmax',            name => 'elmax',
           validate => 'number',            validate => 'number',
           depends_on => ['elenable', 'elrotate'],            depends_on => ['elenable', 'elrotate'],
       },        },
       {        {
           header => $settings_txt{'debug'},            header => $settings_txt{'debug'},
       },        },
       {        {
           description => qq~<label for="debug">$admin_txt{'999'}<br /><span class="small">$admin_txt{'999a'}</span></label>~,            description => qq~<label for="debug">$admin_txt{'999'}<br /><span class="small">$admin_txt{'999a'}</span></label>~,
           input_html => qq~            input_html => qq~
<select name="debug" id="debug" size="1"> <select name="debug" id="debug" size="1">
 <option value="0" ${isselected($debug == 0)}>$admin_txt{'nodebug'}</option>  <option value="0" ${isselected($debug == 0)}>$admin_txt{'nodebug'}</option>
 <option value="1" ${isselected($debug == 1)}>$admin_txt{'alldebug'}</option>  <option value="1" ${isselected($debug == 1)}>$admin_txt{'alldebug'}</option>
 <option value="2" ${isselected($debug == 2)}>$admin_txt{'admindebug'}</option>  <option value="2" ${isselected($debug == 2)}>$admin_txt{'admindebug'}</option>
</select>~, </select>~,
           name => 'debug',            name => 'debug',
           validate => 'number',            validate => 'number',
       },        },
       {        {
           header => $settings_txt{'files'},            header => $settings_txt{'files'},
       },        },
       {        {
           description => qq~<label for="use_flock">$admin_txt{'391'}</label>~,            description => qq~<label for="use_flock">$admin_txt{'391'}</label>~,
           input_html => qq~            input_html => qq~
<select name="use_flock" id="use_flock" size="1"> <select name="use_flock" id="use_flock" size="1">
 <option value="0" ${isselected($use_flock == 0)}>$admin_txt{'401'}</option>  <option value="0" ${isselected($use_flock == 0)}>$admin_txt{'401'}</option>
 <option value="1" ${isselected($use_flock == 1)}>$admin_txt{'402'}</option>  <option value="1" ${isselected($use_flock == 1)}>$admin_txt{'402'}</option>
 <option value="2" ${isselected($use_flock == 2)}>$admin_txt{'403'}</option>  <option value="2" ${isselected($use_flock == 2)}>$admin_txt{'403'}</option>
</select>~, </select>~,
           name => 'use_flock',            name => 'use_flock',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           description => qq~<label for="faketruncation">$admin_txt{'630'}</label>~,            description => qq~<label for="faketruncation">$admin_txt{'630'}</label>~,
           input_html => qq~<input type="checkbox" name="faketruncation" id="faketruncation" value="1" ${ischecked($faketruncation)}/>~,            input_html => qq~<input type="checkbox" name="faketruncation" id="faketruncation" value="1" ${ischecked($faketruncation)}/>~,
           name => 'faketruncation',            name => 'faketruncation',
           validate => 'boolean',            validate => 'boolean',
       },        },
       {        {
           header => $settings_txt{'freedisk'},            header => $settings_txt{'freedisk'},
       },        },
       {        {
           description => qq~<label for="enable_quota">$admin_txt{'quota'}</label>~,            description => qq~<label for="enable_quota">$admin_txt{'quota'}</label>~,
           input_html => qq~<input type="checkbox" name="enable_quota" id="enable_quota" value="1" ~ . (!$quota[2] ? 'disabled="disabled" ' : ${ischecked($enable_quota)}) . qq~/>~,            input_html => qq~<input type="checkbox" name="enable_quota" id="enable_quota" value="1" ~ . (!$quota[2] ? 'disabled="disabled" ' : ${ischecked($enable_quota)}) . qq~/>~,
           name => 'enable_quota',            name => 'enable_quota',
           validate => 'boolean',            validate => 'boolean',
           depends_on => (!$quota[2] ? [] : ['!enable_freespace_check','(findfile_time==0||','findfile_time==||','findfile_maxsize==0||','findfile_maxsize==)']),            depends_on => (!$quota[2] ? [] : ['!enable_freespace_check','(findfile_time==0||','findfile_time==||','findfile_maxsize==0||','findfile_maxsize==)']),
       },        },
       {        {
           description => qq~<label for="enable_quota_value">$admin_txt{'quota_value'}</label>~,            description => qq~<label for="enable_quota_value">$admin_txt{'quota_value'}</label>~,
           input_html => ($quota[2] ? $quota_select : qq~<input type="hidden" name="enable_quota_value" id="enable_quota_value" value="0" />~),            input_html => ($quota[2] ? $quota_select : qq~<input type="hidden" name="enable_quota_value" id="enable_quota_value" value="0" />~),
           name => 'enable_quota_value',            name => 'enable_quota_value',
           validate => 'number,null',            validate => 'number,null',
           depends_on => ['enable_quota'],            depends_on => ['enable_quota'],
       },        },
       {        {
           description => qq~<label for="hostusername">$admin_txt{'quotahostuser'}</label>~,            description => qq~<label for="hostusername">$admin_txt{'quotahostuser'}</label>~,
           input_html => qq~<input type="text" name="hostusername" id="hostusername" size="20" value="$hostusername" />~,            input_html => qq~<input type="text" name="hostusername" id="hostusername" size="20" value="$hostusername" />~,
           name => 'hostusername',            name => 'hostusername',
           validate => 'text,null',            validate => 'text,null',
           depends_on => ['enable_quota'],            depends_on => ['enable_quota'],
       },        },
       {        {
           description => qq~<label for="findfile_time">$admin_txt{'findtime'}</label>~,            description => qq~<label for="findfile_time">$admin_txt{'findtime'}</label>~,
           input_html => qq~<input type="text" name="findfile_time" id="findfile_time" size="4" value="~ . (@find ? qq~$findfile_time"~ : '0" disabled="disabled"') . qq~ /> $admin_txt{'537'}~,            input_html => qq~<input type="text" name="findfile_time" id="findfile_time" size="4" value="~ . (@find ? qq~$findfile_time"~ : '0" disabled="disabled"') . qq~ /> $admin_txt{'537'}~,
           name => 'findfile_time',            name => 'findfile_time',
           validate => 'number,null',            validate => 'number,null',
           depends_on => (@find ? ['!enable_quota','!enable_freespace_check'] : []),            depends_on => (@find ? ['!enable_quota','!enable_freespace_check'] : []),
       },        },
       {        {
           description => qq~<label for="findfile_root">$admin_txt{'findroot'}</label>~,            description => qq~<label for="findfile_root">$admin_txt{'findroot'}</label>~,
           input_html => qq~<input type="text" name="findfile_root" id="findfile_root" size="40" value="$findfile_root" ~ . (@find ? '' : 'disabled="disabled" ') . qq~/>~,            input_html => qq~<input type="text" name="findfile_root" id="findfile_root" size="40" value="$findfile_root" ~ . (@find ? '' : 'disabled="disabled" ') . qq~/>~,
           name => 'findfile_root',            name => 'findfile_root',
           validate => 'text,null',            validate => 'text,null',
           depends_on => (@find ? ['!enable_quota','!enable_freespace_check'] : []),            depends_on => (@find ? ['!enable_quota','!enable_freespace_check'] : []),
       },        },
       {        {
           description => qq~<label for="findfile_maxsize">$admin_txt{'findmax'}</label>~,            description => qq~<label for="findfile_maxsize">$admin_txt{'findmax'}</label>~,
           input_html => qq~<input type="text" name="findfile_maxsize" id="findfile_maxsize" size="10" value="$findfile_maxsize" ~ . (@find ? '' : 'disabled="disabled" ') . qq~/> MB~,            input_html => qq~<input type="text" name="findfile_maxsize" id="findfile_maxsize" size="10" value="$findfile_maxsize" ~ . (@find ? '' : 'disabled="disabled" ') . qq~/> MB~,
           name => 'findfile_maxsize',            name => 'findfile_maxsize',
           validate => 'number,null',            validate => 'number,null',
           depends_on => (@find ? ['!enable_quota','!enable_freespace_check'] : []),            depends_on => (@find ? ['!enable_quota','!enable_freespace_check'] : []),
       },        },
       {        {
           description => qq~<label for="enable_freespace_check">$admin_txt{'diskspacecheck'}</label>~,            description => qq~<label for="enable_freespace_check">$admin_txt{'diskspacecheck'}</label>~,
           input_html => qq~<input type="checkbox" name="enable_freespace_check" id="enable_freespace_check" value="1" ${ischecked($enable_freespace_check)}/><pre>@disk_space</pre>~,            input_html => qq~<input type="checkbox" name="enable_freespace_check" id="enable_freespace_check" value="1" ${ischecked($enable_freespace_check)}/><pre>@disk_space</pre>~,
           name => 'enable_freespace_check',            name => 'enable_freespace_check',
           validate => 'boolean',            validate => 'boolean',
           depends_on => ['!enable_quota','(findfile_time==0||','findfile_time==||','findfile_maxsize==0||','findfile_maxsize==)'],            depends_on => ['!enable_quota','(findfile_time==0||','findfile_time==||','findfile_maxsize==0||','findfile_maxsize==)'],
       },        },
   ],    ],
}, },
); );
   
# Routine to save them # Routine to save them
sub SaveSettings { sub SaveSettings {
   my %settings = @_;    my %settings = @_;
   $settings{'extensions'} =~ s~[^\ A-Za-z0-9_]~~g;    $settings{'extensions'} =~ s~[^\ A-Za-z0-9_]~~g;
   @ext = split(/\s+/, $settings{'extensions'});    @ext = split(/\s+/, $settings{'extensions'});
   
   if ($settings{'enable_quota'} && $settings{'enable_quota_value'} > 1 && $settings{'hostusername'}) {    if ($settings{'enable_quota'} && $settings{'enable_quota_value'} > 1 && $settings{'hostusername'}) {
       $settings{'enable_quota'} = $settings{'enable_quota_value'};        $settings{'enable_quota'} = $settings{'enable_quota_value'};
       $settings{'findfile_maxsize'} = 0;        $settings{'findfile_maxsize'} = 0;
       $settings{'enable_freespace_check'} = 0;        $settings{'enable_freespace_check'} = 0;
   } elsif (-d "$settings{'findfile_root'}" && $settings{'findfile_maxsize'} > 0 && !$settings{'enable_freespace_check'}) {    } elsif (-d "$settings{'findfile_root'}" && $settings{'findfile_maxsize'} > 0 && !$settings{'enable_freespace_check'}) {
       $findfile_space = '1<>0';        $findfile_space = '1<>0';
       $settings{'enable_quota'} = 0;        $settings{'enable_quota'} = 0;
   } elsif ($settings{'enable_freespace_check'}) {    } elsif ($settings{'enable_freespace_check'}) {
       $settings{'findfile_maxsize'} = 0;        $settings{'findfile_maxsize'} = 0;
       $settings{'enable_quota'} = 0;        $settings{'enable_quota'} = 0;
   } elsif (!-d "$settings{'findfile_root'}" || !$settings{'findfile_maxsize'}) {    } elsif (!-d "$settings{'findfile_root'}" || !$settings{'findfile_maxsize'}) {
       $settings{'findfile_time'} = 0;        $settings{'findfile_time'} = 0;
       $settings{'findfile_maxsize'} = 0;        $settings{'findfile_maxsize'} = 0;
   }    }
   
   # Settings.pl stuff    # Settings.pl stuff
   &SaveSettingsTo('Settings.pl', %settings);    &SaveSettingsTo('Settings.pl', %settings);
} }
   
1; 1;