diff options
author | cvs2git <cvs2git> | 2006-08-23 22:25:40 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2006-08-23 22:25:40 +0000 |
commit | 58d093219cf60264550b8c34649d9f3190eda042 (patch) | |
tree | 10418dd70b52416a5f52da8e17d8e282d914595d /FS/FS/ClientAPI/passwd.pm | |
parent | 3ce7691203a7737406bf2d4442f7fd84b81f847e (diff) |
This commit was manufactured by cvs2svn to create tagAFTER_FINAL_MASONIZE
'AFTER_FINAL_MASONIZE'.
Diffstat (limited to 'FS/FS/ClientAPI/passwd.pm')
-rw-r--r-- | FS/FS/ClientAPI/passwd.pm | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/FS/FS/ClientAPI/passwd.pm b/FS/FS/ClientAPI/passwd.pm deleted file mode 100644 index b22d761..0000000 --- a/FS/FS/ClientAPI/passwd.pm +++ /dev/null @@ -1,46 +0,0 @@ -package FS::ClientAPI::passwd; - -use strict; -use FS::Record qw(qsearchs); -use FS::svc_acct; -use FS::svc_domain; - -sub passwd { - my $packet = shift; - - my $domain = $FS::ClientAPI::domain || $packet->{'domain'}; - my $svc_domain = qsearchs('svc_domain', { 'domain' => $domain } ) - or return { error => "Domain $domain not found" }; - - my $old_password = $packet->{'old_password'}; - my $new_password = $packet->{'new_password'}; - my $new_gecos = $packet->{'new_gecos'}; - my $new_shell = $packet->{'new_shell'}; - - #false laziness w/FS::ClientAPI::MyAccount::login - - my $svc_acct = qsearchs( 'svc_acct', { 'username' => $packet->{'username'}, - 'domsvc' => $svc_domain->svcnum, } - ); - return { error => 'User not found.' } unless $svc_acct; - return { error => 'Incorrect password.' } - unless $svc_acct->check_password($old_password); - - my %hash = $svc_acct->hash; - my $new_svc_acct = new FS::svc_acct ( \%hash ); - $new_svc_acct->setfield('_password', $new_password ) - if $new_password && $new_password ne $old_password; - $new_svc_acct->setfield('finger',$new_gecos) if $new_gecos; - $new_svc_acct->setfield('shell',$new_shell) if $new_shell; - my $error = $new_svc_acct->replace($svc_acct); - - return { error => $error }; - -} - -sub chfn {} - -sub chsh {} - -1; - |