summaryrefslogtreecommitdiff
path: root/FS/FS/access_user.pm
diff options
context:
space:
mode:
authorivan <ivan>2008-02-29 02:29:57 +0000
committerivan <ivan>2008-02-29 02:29:57 +0000
commitd49cc12aee7462cb3f0cc1073777f1e5c3dbb7f4 (patch)
tree4d51bac044eb4ffc4ba880a213d7788cf0b12412 /FS/FS/access_user.pm
parent1853ca72ecbd2d47bc09d196374534ab8ada08ce (diff)
disallow uppercase usernames in the first place. also Record::str2time_sql_closing snuck in.
Diffstat (limited to 'FS/FS/access_user.pm')
-rw-r--r--FS/FS/access_user.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/FS/FS/access_user.pm b/FS/FS/access_user.pm
index 250e432..a755daf 100644
--- a/FS/FS/access_user.pm
+++ b/FS/FS/access_user.pm
@@ -90,6 +90,9 @@ otherwise returns false.
sub insert {
my $self = shift;
+ my $error = $self->check;
+ return $error if $error;
+
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
local $SIG{QUIT} = 'IGNORE';
@@ -101,7 +104,7 @@ sub insert {
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- my $error = $self->htpasswd_kludge();
+ $error = $self->htpasswd_kludge();
if ( $error ) {
$dbh->rollback or die $dbh->errstr if $oldAutoCommit;
return $error;
@@ -111,7 +114,14 @@ sub insert {
if ( $error ) {
$dbh->rollback or die $dbh->errstr if $oldAutoCommit;
+
+ #make sure it isn't a dup username? or you could nuke people's passwords
+ #blah. really just should do our own login w/cookies
+ #and auth out of the db in the first place
+ #my $hterror = $self->htpasswd_kludge('-D');
+ #$error .= " - additionally received error cleaning up htpasswd file: $hterror"
return $error;
+
} else {
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
'';
@@ -236,7 +246,7 @@ sub check {
my $error =
$self->ut_numbern('usernum')
- || $self->ut_alpha('username')
+ || $self->ut_alpha_lower('username')
|| $self->ut_text('_password')
|| $self->ut_text('last')
|| $self->ut_text('first')