summaryrefslogtreecommitdiff
path: root/FS/FS/access_user.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-05-09 02:09:09 -0700
committerIvan Kohler <ivan@freeside.biz>2013-05-09 02:09:09 -0700
commit19eef2ec0e68587304cd597fc5b2f8e1f151e424 (patch)
tree0b78ca3ebf568d5f01d2f8faedc214d1447114c0 /FS/FS/access_user.pm
parent076ddfe0b0e764636e8389edebaedddef0fbf003 (diff)
NG auth: pw changes, RT#21563
Diffstat (limited to 'FS/FS/access_user.pm')
-rw-r--r--FS/FS/access_user.pm58
1 files changed, 8 insertions, 50 deletions
diff --git a/FS/FS/access_user.pm b/FS/FS/access_user.pm
index cdee377..79e863b 100644
--- a/FS/FS/access_user.pm
+++ b/FS/FS/access_user.pm
@@ -2,7 +2,7 @@ package FS::access_user;
use strict;
use base qw( FS::m2m_Common FS::option_Common );
-use vars qw( $DEBUG $me $conf $htpasswd_file );
+use vars qw( $DEBUG $me $conf );
use FS::UID;
use FS::Auth;
use FS::Conf;
@@ -15,12 +15,6 @@ use FS::cust_main;
$DEBUG = 0;
$me = '[FS::access_user]';
-#kludge htpasswd for now (i hope this bootstraps okay)
-FS::UID->install_callback( sub {
- $conf = new FS::Conf;
- $htpasswd_file = $conf->base_dir. '/htpasswd';
-} );
-
=head1 NAME
FS::access_user - Object methods for access_user records
@@ -106,7 +100,6 @@ sub insert {
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- $error = $self->htpasswd_kludge();
if ( $error ) {
$dbh->rollback or die $dbh->errstr if $oldAutoCommit;
return $error;
@@ -116,14 +109,7 @@ 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;
'';
@@ -131,26 +117,6 @@ sub insert {
}
-sub htpasswd_kludge {
- my $self = shift;
-
- return '' if $self->is_system_user;
-
- unshift @_, '-c' unless -e $htpasswd_file;
- if (
- system('htpasswd', '-b', @_,
- $htpasswd_file,
- $self->username,
- $self->_password,
- ) == 0
- )
- {
- return '';
- } else {
- return 'htpasswd exited unsucessfully';
- }
-}
-
=item delete
Delete this record from the database.
@@ -171,10 +137,7 @@ sub delete {
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- my $error =
- $self->SUPER::delete(@_)
- || $self->htpasswd_kludge('-D')
- ;
+ my $error = $self->SUPER::delete(@_);
if ( $error ) {
$dbh->rollback or die $dbh->errstr if $oldAutoCommit;
@@ -211,16 +174,11 @@ sub replace {
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- if ( $new->_password ne $old->_password ) {
- my $error = $new->htpasswd_kludge();
- if ( $error ) {
- $dbh->rollback or die $dbh->errstr if $oldAutoCommit;
- return $error;
- }
- } elsif ( $old->disabled && !$new->disabled
- && $new->_password =~ /changeme/i ) {
- return "Must change password when enabling this account";
- }
+ return "Must change password when enabling this account"
+ if $old->disabled && !$new->disabled
+ && ( $new->_password =~ /changeme/i
+ || $new->_password eq 'notyet'
+ );
my $error = $new->SUPER::replace($old, @_);
@@ -551,7 +509,7 @@ sub spreadsheet_format {
=item is_system_user
Returns true if this user has the name of a known system account. These
-users will not appear in the htpasswd file and can't have passwords set.
+users cannot log into the web interface and can't have passwords set.
=cut