###############################################################################
# Settings_Advanced.pl #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 2.4 #
# Packaged: April 12, 2009 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2009 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
# Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com #
# Your source for web hosting, web design, and domains. #
###############################################################################
$settings_advancedplver = 'YaBB 2.4 $Revision$';
if ($GLOBAL::ACTION eq 'detailedversion') { return 1; }
my $uploaddiriscorrect = qq~$admin_txt{'164'}~;
if(-w $uploaddir && -d $uploaddir) {$uploaddiriscorrect = qq~$admin_txt{'163'}~;}
# Setting for gzip, if it's available
my $compressgzip = (-e "/bin/gzip" && open(GZIP, "| gzip -f")) ? qq~\n ~ : '';
# Setting for Compress::Zlib, if it's available
my $compresszlib;
eval { require Compress::Zlib; Compress::Zlib::memGzip("test"); };
$compresszlib = qq~\n ~ unless $@;
# RSS Defaults
if ($rss_disabled eq '') { $rss_disabled = 0; }
if ($rss_limit eq '') { $rss_limit = 10; }
if ($rss_message eq '') { $rss_message = 1; }
# Free Disk Space Checking
my @disk_space = qx{df -k .};
map { $_ =~ s/ +/ /g } @disk_space;
my @find = qx(find . -noleaf -type f -printf "%s-");
$hostusername = $hostusername || (split(/ +/, qx{ls -l YaBB.$yyext}))[2];
my @quota = qx{quota -u $hostusername -v};
$quota[0] =~ s/^ +//;
$quota[0] =~ s/ / /g;
$quota[1] =~ s/^ +//;
$quota[1] =~ s/ / /g;
my $quota_select = qq~$quota[0]
$quota[1]~;
if ($quota[2]) {
my $ds = (split(/ +/, $disk_space[1], 2))[0] if !$enable_quota;
$quota_select .= qq~
';
}
# List of settings
@settings = (
{
name => $settings_txt{'permarss'},
id => 'permarss',
items => [
# Permalinks
{
header => $admin_txt{'24'},
},
{
description => qq~~,
input_html => qq~~,
name => 'accept_permalink',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~~,
name => 'symlink',
validate => 'text,null',
depends_on => ['accept_permalink'],
},
{
description => qq~~,
input_html => qq~~,
name => 'perm_domain',
validate => 'text,null',
depends_on => ['accept_permalink'],
},
# RSS
{
header => $settings_txt{'rss'},
},
{
description => qq~~,
input_html => qq~~,
name => 'rss_disabled',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~~,
name => 'rss_limit',
validate => 'number',
depends_on => ['!rss_disabled'],
},
{
description => qq~~,
input_html => qq~~,
name => 'showauthor',
validate => 'boolean',
depends_on => ['!rss_disabled'],
},
{
description => qq~~,
input_html => qq~~,
name => 'showdate',
validate => 'boolean',
depends_on => ['!rss_disabled'],
},
{
description => qq~~,
input_html => qq~
~,
name => 'rss_message',
validate => 'number',
depends_on => ['!rss_disabled'],
},
],
},
{
name => $settings_txt{'email'},
id => 'email',
items => [
# Email
{
header => $settings_txt{'email'},
},
{
description => qq~~,
input_html => qq~
~,
name => 'mailtype',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'mailprog',
validate => 'text,null',
},
{
description => qq~~,
input_html => qq~~,
name => 'smtp_server',
validate => 'text,null',
},
{
description => qq~~,
input_html => qq~
~,
name => 'smtp_auth_required',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'authuser',
validate => 'text,null',
},
{
description => qq~~,
input_html => qq~~,
name => 'authpass',
validate => 'text,null',
},
{
description => qq~~,
input_html => qq~~,
name => 'webmaster_email',
validate => 'text',
},
# New Member Notification
{
header => $admin_txt{'366'},
},
{
description => qq~~,
input_html => qq~~,
name => 'new_member_notification',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~~,
name => 'new_member_notification_mail',
validate => 'text,null',
depends_on => ['new_member_notification']
},
# New Member Notification
{
header => $admin_txt{'600'},
},
{
description => qq~~,
input_html => qq~~,
name => 'sendtopicmail',
validate => 'number',
},
],
},
{
name => $settings_txt{'attachments'},
id => 'attachments',
items => [
{
header => $settings_txt{'attachments'},
},
{
description => qq~$edit_paths_txt{'20'}
$settings_txt{'changeinpaths'}~,
input_html => $uploaddir, # Non-changable setting
},
{
description => $settings_txt{'uploaddircorrect'},
input_html => $uploaddiriscorrect, # This is tested to see if it's valid at the top of the file.
},
{
description => $fatxt{'17'},
input_html => qq~ ~,
name => 'allowattach',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'allowguestattach',
validate => 'boolean',
depends_on => ['allowattach!=0'],
},
{
description => qq~~,
input_html => qq~~,
name => 'amdisplaypics',
validate => 'boolean',
depends_on => ['allowattach!=0'],
},
{
description => qq~~,
input_html => qq~~,
name => 'checkext',
validate => 'boolean',
depends_on => ['allowattach!=0'],
},
{
description => qq~~,
input_html => qq~~,
name => 'extensions',
validate => 'text',
depends_on => ['allowattach!=0', 'checkext'],
},
{
description => qq~~,
input_html => qq~ KB~,
name => 'limit',
validate => 'number',
depends_on => ['allowattach!=0'],
},
{
description => qq~~,
input_html => qq~ KB~,
name => 'dirlimit',
validate => 'number',
depends_on => ['allowattach!=0'],
},
{
description => qq~~,
input_html => qq~
~,
name => 'overwrite',
validate => 'number',
depends_on => ['allowattach!=0'],
},
],
},
{
name => $settings_txt{'images'},
id => 'images',
items => [
{
header => $admin_txt{'471'},
},
{
description => qq~~,
input_html => qq~ pixel~,
name => 'max_avatar_width',
validate => 'number',
},
{
description => qq~~,
input_html => qq~ pixel~,
name => 'max_avatar_height',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'fix_avatar_img_size',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~ pixel~,
name => 'max_post_img_width',
validate => 'number',
},
{
description => qq~~,
input_html => qq~ pixel~,
name => 'max_post_img_height',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'fix_post_img_size',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~ pixel~,
name => 'max_signat_img_width',
validate => 'number',
},
{
description => qq~~,
input_html => qq~ pixel~,
name => 'max_signat_img_height',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'fix_signat_img_size',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~ pixel~,
name => 'max_attach_img_width',
validate => 'number',
},
{
description => qq~~,
input_html => qq~ pixel~,
name => 'max_attach_img_height',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'fix_attach_img_size',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~
~,
name => 'img_greybox',
validate => 'number',
},
]
},
{
name => $settings_txt{'advanced'},
id => 'advanced',
items => [
{
header => $settop_txt{'5'},
},
{
description => qq~~,
input_html => qq~
~,
name => 'gzcomp',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'gzforce',
validate => 'boolean',
depends_on => ['gzcomp!=0'],
},
{
description => qq~~,
input_html => qq~~,
name => 'cachebehaviour',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~~,
name => 'enableclicklog',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~~,
name => 'ClickLogTime',
validate => 'number',
depends_on => ['enableclicklog'],
},
{
description => qq~~,
input_html => qq~~,
name => 'max_log_days_old',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'maxrecentdisplay',
validate => 'fullnumber',
},
{
description => qq~~,
input_html => qq~~,
name => 'maxsearchdisplay',
validate => 'fullnumber',
},
{
description => qq~~,
input_html => qq~~,
name => 'OnlineLogTime',
validate => 'number',
},
{
description => qq~~,
input_html => qq~~,
name => 'lastonlineinlink',
validate => 'boolean',
},
{
header => $errorlog{'25'},
},
{
description => qq~~,
input_html => qq~~,
name => 'elenable',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~~,
name => 'elrotate',
validate => 'boolean',
depends_on => ['elenable'],
},
{
description => qq~~,
input_html => qq~~,
name => 'elmax',
validate => 'number',
depends_on => ['elenable', 'elrotate'],
},
{
header => $settings_txt{'debug'},
},
{
description => qq~~,
input_html => qq~
~,
name => 'debug',
validate => 'number',
},
{
header => $settings_txt{'files'},
},
{
description => qq~~,
input_html => qq~
~,
name => 'use_flock',
validate => 'boolean',
},
{
description => qq~~,
input_html => qq~~,
name => 'faketruncation',
validate => 'boolean',
},
{
header => $settings_txt{'freedisk'},
},
{
description => qq~~,
input_html => qq~~,
name => 'enable_quota',
validate => 'boolean',
depends_on => (!$quota[2] ? [] : ['!enable_freespace_check','(findfile_time==0||','findfile_time==||','findfile_maxsize==0||','findfile_maxsize==)']),
},
{
description => qq~~,
input_html => ($quota[2] ? $quota_select : qq~~),
name => 'enable_quota_value',
validate => 'number,null',
depends_on => ['enable_quota'],
},
{
description => qq~~,
input_html => qq~~,
name => 'hostusername',
validate => 'text,null',
depends_on => ['enable_quota'],
},
{
description => qq~~,
input_html => qq~ $admin_txt{'537'}~,
name => 'findfile_time',
validate => 'number,null',
depends_on => (@find ? ['!enable_quota','!enable_freespace_check'] : []),
},
{
description => qq~~,
input_html => qq~~,
name => 'findfile_root',
validate => 'text,null',
depends_on => (@find ? ['!enable_quota','!enable_freespace_check'] : []),
},
{
description => qq~~,
input_html => qq~ MB~,
name => 'findfile_maxsize',
validate => 'number,null',
depends_on => (@find ? ['!enable_quota','!enable_freespace_check'] : []),
},
{
description => qq~~,
input_html => qq~
@disk_space~, name => 'enable_freespace_check', validate => 'boolean', depends_on => ['!enable_quota','(findfile_time==0||','findfile_time==||','findfile_maxsize==0||','findfile_maxsize==)'], }, ], }, ); # Routine to save them sub SaveSettings { my %settings = @_; $settings{'extensions'} =~ s~[^\ A-Za-z0-9_]~~g; @ext = split(/\s+/, $settings{'extensions'}); if ($settings{'enable_quota'} && $settings{'enable_quota_value'} > 1 && $settings{'hostusername'}) { $settings{'enable_quota'} = $settings{'enable_quota_value'}; $settings{'findfile_maxsize'} = 0; $settings{'enable_freespace_check'} = 0; } elsif (-d "$settings{'findfile_root'}" && $settings{'findfile_maxsize'} > 0 && !$settings{'enable_freespace_check'}) { $findfile_space = '1<>0'; $settings{'enable_quota'} = 0; } elsif ($settings{'enable_freespace_check'}) { $settings{'findfile_maxsize'} = 0; $settings{'enable_quota'} = 0; } elsif (!-d "$settings{'findfile_root'}" || !$settings{'findfile_maxsize'}) { $settings{'findfile_time'} = 0; $settings{'findfile_maxsize'} = 0; } # Settings.pl stuff &SaveSettingsTo('Settings.pl', %settings); } 1;