summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorivan <ivan>2004-11-26 06:50:13 +0000
committerivan <ivan>2004-11-26 06:50:13 +0000
commit3d4905406e586b355ef5b0240325e789783d2b9c (patch)
tree4bf9130a7599181dd168ae29900522da53a74f80 /FS/FS
parent9027fa93a91ced6f330627255e7296a792434f6d (diff)
add password-noampersand and password-noexlamation config files, patch from Stephpen Bechard, closes: Bug#539
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Conf.pm14
-rw-r--r--FS/FS/svc_acct.pm9
2 files changed, 23 insertions, 0 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index d676d4e8c..cfc420742 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -637,6 +637,20 @@ httemplate/docs/config.html
},
{
+ 'key' => 'password-noampersand',
+ 'section' => 'password',
+ 'description' => 'Disallow ampersands in passwords',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'password-noexclamation',
+ 'section' => 'password',
+ 'description' => 'Disallow exclamations in passwords (Not setting this could break old text Livingston or Cistron Radius servers)',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'qmailmachines',
'section' => 'deprecated',
'description' => '<b>DEPRECATED</b>, add <i>qmail</i> and <i>shellcommands</i> <a href="../browse/part_export.cgi">exports</a> instead. This option used to export `/var/qmail/control/virtualdomains\', `/var/qmail/control/recipientmap\', and `/var/qmail/control/rcpthosts\'. Setting this option (even if empty) also turns on user `.qmail-extension\' file maintenance in conjunction with the <b>shellmachine</b> option.',
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 28ef94986..1e30a0fec 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -7,6 +7,7 @@ use vars qw( @ISA $DEBUG $me $conf
$username_ampersand $username_letter $username_letterfirst
$username_noperiod $username_nounderscore $username_nodash
$username_uppercase
+ $password_noampersand $password_noexclamation
$welcome_template $welcome_from $welcome_subject $welcome_mimetype
$smtpmachine
$radius_password $radius_ip
@@ -55,6 +56,8 @@ $FS::UID::callback{'FS::svc_acct'} = sub {
$username_nodash = $conf->exists('username-nodash');
$username_uppercase = $conf->exists('username-uppercase');
$username_ampersand = $conf->exists('username-ampersand');
+ $password_noampersand = $conf->exists('password-noexclamation');
+ $password_noexclamation = $conf->exists('password-noexclamation');
$dirhash = $conf->config('dirhash') || 0;
if ( $conf->exists('welcome_email') ) {
$welcome_template = new Text::Template (
@@ -683,6 +686,12 @@ sub check {
unless ( $username_ampersand ) {
$recref->{username} =~ /\&/ and return gettext('illegal_username');
}
+ if ( $password_noampersand ) {
+ $recref->{_password} =~ /\&/ and return gettext('illegal_password');
+ }
+ if ( $password_noexclamation ) {
+ $recref->{_password} =~ /\!/ and return gettext('illegal_password');
+ }
$recref->{popnum} =~ /^(\d*)$/ or return "Illegal popnum: ".$recref->{popnum};
$recref->{popnum} = $1;