From b49385d6a4448956003e2c0a135abec5d61559d6 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Wed, 19 Dec 2007 01:19:36 +0000 Subject: [PATCH] Added support for the DisplayChdir directive --- proftpd/CHANGELOG | 2 ++ proftpd/lang/en | 1 + proftpd/mod_core.pl | 20 +++++++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/proftpd/CHANGELOG b/proftpd/CHANGELOG index 050c18579..9867580e8 100644 --- a/proftpd/CHANGELOG +++ b/proftpd/CHANGELOG @@ -6,3 +6,5 @@ Added a button to the main page for stopping the ProFTPd server. Fixed the default config file path on Debian, as it is different from Ubuntu. ---- Changes since 1.340 ---- Added a Module Config option to specify the file for new virtual hosts. +---- Changes since 1.380 ---- +Added support for the DisplayChdir directive. diff --git a/proftpd/lang/en b/proftpd/lang/en index 83a0f9212..593a33063 100644 --- a/proftpd/lang/en +++ b/proftpd/lang/en @@ -190,6 +190,7 @@ mod_core_display=Pre-login message file mod_core_none=None mod_core_edisplay=Missing pre-login message file mod_core_firstcd=Directory README filename +mod_core_firstcdt=Always show mod_core_efirstcd=Missing directory README filename mod_core_goaway=Too many connections message file mod_core_egoaway=Missing too many connections file diff --git a/proftpd/mod_core.pl b/proftpd/mod_core.pl index 62768c1b9..9c9770cf8 100644 --- a/proftpd/mod_core.pl +++ b/proftpd/mod_core.pl @@ -40,7 +40,8 @@ local $rv = [ [ 'DenyGroup', 1, 3, 'limit', 1.11 ], [ 'DenyUser', 1, 3, 'limit', 1.17 ], [ 'DisplayConnect', 0, 6, 'virtual global', 1.20 ], - [ 'DisplayFirstChdir', 0, 2, 'virtual anon directory global', 0.99 ], + [ 'DisplayFirstChdir', 0, 2, 'virtual anon directory global', '0.99-1.31' ], + [ 'DisplayChdir', 0, 2, 'virtual anon directory global', 1.31 ], [ 'DisplayGoAway', 0, 6, 'virtual anon global', 1.20 ], [ 'DisplayLogin', 0, 6, 'virtual anon global', 0.99 ], [ 'DisplayQuit', 0, 6, 'virtual anon global', 1.20 ], @@ -522,6 +523,23 @@ sub save_DisplayFirstChdir return &parse_opt("DisplayFirstChdir", '^\S+$', $text{'mod_core_efirstcd'}); } +sub edit_DisplayChdir +{ +return (1, $text{'mod_core_firstcd'}, + &opt_input($_[0]->{'words'}->[0], "DisplayChdir", + $text{'mod_core_none'}, 15). + &ui_checkbox("DisplayChdir_always", 'true', $text{'mod_core_firstcdt'}, + $_[0]->{'words'}->[1] eq 'true')); +} +sub save_DisplayChdir +{ +local @rv = &parse_opt("DisplayChdir", '^\S+$', $text{'mod_core_efirstcd'}); +if ($in{'DisplayChdir_always'}) { + $rv[0]->[0] .= ' true'; + } +return @rv; +} + sub edit_DisplayGoAway { return (2, $text{'mod_core_goaway'},