freeside/fs_selfservice/FS-SelfService/cgi passwd.cgi,NONE,1.1 passwd.html,1.1,1.2
ivan
ivan at pouncequick.420.am
Tue Jun 15 06:29:48 PDT 2004
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory pouncequick:/tmp/cvs-serv21576/fs_selfservice/FS-SelfService/cgi
Modified Files:
passwd.html
Added Files:
passwd.cgi
Log Message:
moving passwd cgi to self-service
--- NEW FILE: passwd.cgi ---
#!/usr/bin/perl -Tw
use strict;
use Getopt::Std;
use FS::SelfService qw(passwd);
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $freeside_uid = scalar(getpwnam('freeside'));
$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
$ENV{'SHELL'} = '/bin/sh';
$ENV{'IFS'} = " \t\n";
$ENV{'CDPATH'} = '';
$ENV{'ENV'} = '';
$ENV{'BASH_ENV'} = '';
die "fs_passwd.cgi isn't running as freeside user\n" if $> != $freeside_uid;
my $cgi = new CGI;
$cgi->param('username') =~ /^([^\n]{0,255}$)/ or die "Illegal username";
my $me = $1;
$cgi->param('domain') =~ /^([^\n]{0,255}$)/ or die "Illegal domain";
my $domain = $1;
$cgi->param('old_password') =~ /^([^\n]{0,255}$)/ or die "Illegal old_password";
my $old_password = $1;
$cgi->param('new_password') =~ /^([^\n]{0,255}$)/ or die "Illegal new_password";
my $new_password = $1;
die "New passwords don't match"
unless $new_password eq $cgi->param('new_password2');
my $rv = passwd(
'username' => $me,
'domain' => $domain,
'old_password' => $old_password,
'new_password' => $new_password,
);
my $error = $rv->{error};
if ($error) {
die $error;
} else {
print $cgi->header(), <<END;
<html>
<head>
<title>Password changed</title>
</head>
<body bgcolor="#e8e8e8">
<h3>Password changed</h3>
<br>Your password has been changed.
</body>
</html>
END
}
Index: passwd.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/passwd.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- passwd.html 22 Jul 2002 10:51:22 -0000 1.1
+++ passwd.html 15 Jun 2004 13:29:44 -0000 1.2
@@ -9,6 +9,9 @@
<tr><th align="right">Username</th>
<td><input type="text" name="username" size="18"></td>
</tr>
+ <tr><th align="right">Domain</th>
+ <td><input type="text" name="domain" size="18"></td>
+ </tr>
<tr><th align="right">Current password</th>
<td><input type="password" name="old_password" size="18"></td>
</tr>
More information about the freeside-commits
mailing list