projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ad10f79
)
add username-nounderscore and username-nodash config files
author
ivan
<ivan>
Fri, 26 Apr 2002 11:14:37 +0000
(11:14 +0000)
committer
ivan
<ivan>
Fri, 26 Apr 2002 11:14:37 +0000
(11:14 +0000)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/svc_acct.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
3565be9
..
6e45ec0
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-779,6
+779,20
@@
httemplate/docs/config.html
},
{
},
{
+ 'key' => 'username-nounderscore',
+ 'section' => 'username',
+ 'description' => 'Disallow underscores in usernames',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'username-nodash',
+ 'section' => 'username',
+ 'description' => 'Disallow dashes in usernames',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'username-uppercase',
'section' => 'username',
'description' => 'Allow uppercase characters in usernames',
'key' => 'username-uppercase',
'section' => 'username',
'description' => 'Allow uppercase characters in usernames',
diff --git
a/FS/FS/svc_acct.pm
b/FS/FS/svc_acct.pm
index
d3c415c
..
bb8c5e2
100644
(file)
--- a/
FS/FS/svc_acct.pm
+++ b/
FS/FS/svc_acct.pm
@@
-5,7
+5,8
@@
use vars qw( @ISA $noexport_hack $conf
$dir_prefix @shells $usernamemin
$usernamemax $passwordmin $passwordmax
$username_ampersand $username_letter $username_letterfirst
$dir_prefix @shells $usernamemin
$usernamemax $passwordmin $passwordmax
$username_ampersand $username_letter $username_letterfirst
- $username_noperiod $username_uppercase
+ $username_noperiod $username_nounderscore $username_nodash
+ $username_uppercase
$mydomain
$dirhash
@saltset @pw_set );
$mydomain
$dirhash
@saltset @pw_set );
@@
-40,6
+41,8
@@
$FS::UID::callback{'FS::svc_acct'} = sub {
$username_letter = $conf->exists('username-letter');
$username_letterfirst = $conf->exists('username-letterfirst');
$username_noperiod = $conf->exists('username-noperiod');
$username_letter = $conf->exists('username-letter');
$username_letterfirst = $conf->exists('username-letterfirst');
$username_noperiod = $conf->exists('username-noperiod');
+ $username_nounderscore = $conf->exists('username-nounderscore');
+ $username_nodash = $conf->exists('username-nodash');
$username_uppercase = $conf->exists('username-uppercase');
$username_ampersand = $conf->exists('username-ampersand');
$mydomain = $conf->config('domain');
$username_uppercase = $conf->exists('username-uppercase');
$username_ampersand = $conf->exists('username-ampersand');
$mydomain = $conf->config('domain');
@@
-547,6
+550,12
@@
sub check {
if ( $username_noperiod ) {
$recref->{username} =~ /\./ and return gettext('illegal_username');
}
if ( $username_noperiod ) {
$recref->{username} =~ /\./ and return gettext('illegal_username');
}
+ if ( $username_nounderscore ) {
+ $recref->{username} =~ /_/ and return gettext('illegal_username');
+ }
+ if ( $username_nodash ) {
+ $recref->{username} =~ /\-/ and return gettext('illegal_username');
+ }
unless ( $username_ampersand ) {
$recref->{username} =~ /\&/ and return gettext('illegal_username');
}
unless ( $username_ampersand ) {
$recref->{username} =~ /\&/ and return gettext('illegal_username');
}