diff -urP imp/lib/imp.lib imp.0121/lib/imp.lib
--- imp/lib/imp.lib Sun Jan 3 12:01:17 1999
+++ imp.0121/lib/imp.lib Mon Jan 4 12:59:59 1999
@@ -111,6 +111,12 @@
define( "MGR_USER_ADD", 80100 );
define( "MGR_USER_EDIT", 80200 );
+/* -- passwd.php3 -- */
+/* -- Password Management --*/
+
+define ( "PASSWD_INPUT", 20100 );
+define ( "PASSWD_CHANGE", 20200 );
+define ( "PASSWD_DISALLOW", 20300 );
/* EOF - defines/Actions.def */
diff -urP imp/locale/en/menu.lang imp.0121/locale/en/menu.lang
--- imp/locale/en/menu.lang Sun Jan 3 12:01:28 1999
+++ imp.0121/locale/en/menu.lang Mon Jan 4 15:56:11 1999
@@ -31,5 +31,5 @@
$lang->logout = 'logout';
$lang->faq = 'faq';
$lang->ldap_search = 'LDAP Search';
-
+$lang->passwd = 'Change Password';
?>
diff -urP imp/locale/en/passwd.lang imp.0121/locale/en/passwd.lang
--- imp/locale/en/passwd.lang Thu Jan 1 09:00:00 1970
+++ imp.0121/locale/en/passwd.lang Mon Jan 4 17:02:39 1999
@@ -0,0 +1,38 @@
+
+
+ You should have received a copy of the GNU Public
+ License along with this package; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ */
+
+
+$lang = new HordeLocaleLang;
+
+$lang->changing_passwd = 'Changing IMAP Password';
+$lang->user_name = 'Username';
+$lang->old_password = 'Old Password';
+$lang->new_password = 'New Password';
+$lang->retype = 'Retype';
+$lang->change_passwd = 'Change Passwd';
+
+$lang->error[ 'error' ] = 'Error';
+$lang->error[ 'errormsg' ] = 'The following error has occured while processing your request';
+$lang->error[ 'nopermission' ] = 'Password Changing not allowed';
+$lang->error[ 'setting' ] = 'Server and Port not set correctly';
+$lang->error[ 'username' ] = 'Wrong username. The username must mach that of the user currently logged-in.';
+$lang->error[ 'old_pass' ] = 'Old Password wrong';
+$lang->error[ 'new_pass_ne' ] = 'New password not correctly retyped';
+$lang->error[ 'short_pass' ] = 'New password too short';
+$lang->errot[ 'no_connect' ] = 'Could not connect to password Server';
+?>
diff -urP imp/locale/local/passwd.lang imp.0121/locale/local/passwd.lang
--- imp/locale/local/passwd.lang Thu Jan 1 09:00:00 1970
+++ imp.0121/locale/local/passwd.lang Mon Jan 4 12:43:37 1999
@@ -0,0 +1,7 @@
+
diff -urP imp/login.php3 imp.0121/login.php3
--- imp/login.php3 Sun Jan 3 12:01:04 1999
+++ imp.0121/login.php3 Mon Jan 4 17:00:36 1999
@@ -45,6 +45,7 @@
$messages[ 'logout' ] = 'You have been logged out of IMP. Thank you for using the system. If you wish to log in again, please use the form below.';
$messages[ 'nocert' ] = 'You need a valid certificate in order to access this site.';
$messages[ 'noaccount' ] = 'You do not yet have an email account with us.';
+$messages[ 'chpass' ] = 'Your password has been successfully changed, please re-login.';
/* doctype */
require("$default->include_dir/doctype.inc");
diff -urP imp/passwd.php3 imp.0121/passwd.php3
--- imp/passwd.php3 Thu Jan 1 09:00:00 1970
+++ imp.0121/passwd.php3 Mon Jan 4 17:02:18 1999
@@ -0,0 +1,135 @@
+
+
+ You should have received a copy of the GNU Public
+ License along with this package; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+require( './lib/imp.lib' ); /* IMPlib is the IMP function library */
+require( './config/defaults.php3' ); /* Defaults configuration file */
+require( './lib/setcookie.lib' );
+
+$language = select_lang();
+require( "./locale/$language/passwd.lang" );
+require( "./locale/local/passwd.lang" );
+/* require( "./help/defines/passwd.help" ); # add help in future */
+
+if( $default->ssl->enabled ) { include( "./lib/ssl.lib" ); }
+
+error_reporting($default->error_level); /* set error level from imp.lib */
+
+setlang($language);
+
+/* get user info */
+$user = getuser();
+$pass = getpass();
+$server = $default->poppassd_server;
+$port = $default->poppassd_port;
+
+/* only proceed if permission given; against evil users directly going to passwd.php3 */
+ /* need to output error if so */
+if (!(isset($default->use_poppassd) && $default->use_poppassd)){
+ $errortype = 'nopermission';
+ include( "$default->include_dir/passwd.php3-error.inc" );
+ exit;
+}
+
+/* doctype */
+require("$default->include_dir/doctype.inc");
+
+/* run through ActionIDs */
+
+if (isset($actionID)) {
+ switch ($actionID) {
+ case NO_ACTION:
+ break;
+
+ case PASSWD_INPUT;
+ include( "$default->include_dir/passwd.php3-input.inc" );
+
+ case PASSWD_DISALLOW;
+ $errortype = 'nopermission';
+ include( "$default->include_dir/passwd.php3-error.inc" );
+
+ case PASSWD_CHANGE; /* now we change the passwd */
+ /* error checking */
+ if (!(isset($default->poppassd_server) || isset($default->poppassd_port))){
+ $errortype = 'setting';
+ include( "$default->include_dir/passwd.php3-error.inc" );}
+ if (!($username == getuser())){ $errortype = 'username'; include( "$default->include_dir/passwd.php3-error.inc" );}
+ if (!($old_pass == getpass())){ $errortype = 'old_pass'; include( "$default->include_dir/passwd.php3-error.inc" );}
+ if (strlen($new_pass) <= 4){ $errortype = 'short_pass'; include( "$default->include_dir/passwd.php3-error.inc" );}
+ if (!($new_pass == $new_pass2)){ $errortype = 'new_pass_ne'; include( "$default->include_dir/passwd.php3-error.inc" );}
+
+ /* OK, the input data seems to be OK, connect */
+ $passd = fsockopen($default->poppassd_server, $default->poppassd_port, &$errno, &$errstr);
+ if (!$passd){
+ $errortype = "Password Server: $errno($errstr)";
+ include( "$default->include_dir/passwd.php3-error.inc" );
+ }else{
+ $input = fgets($passd, 128);
+ if(!eregi( "^200", $input)){
+ fclose($passd);
+ $errortype="no_connect";
+ include( "$default->include_dir/passwd.php3-error.inc" );}
+ $output = "user ". getuser() . "\n";
+ fputs($passd,$output);
+
+ $input = fgets($passd, 128);
+ if(!eregi( "^200", $input)){
+ fclose($passd);
+ $errortype="$input";
+ include( "$default->include_dir/passwd.php3-error.inc" );}
+ $output = "pass " . getpass() . "\n";
+ fputs($passd,$output);
+
+ $input = fgets($passd, 128);
+ if(!eregi( "^200", $input)){
+ fclose($passd);
+ $errortype="$input";
+ include( "$default->include_dir/passwd.php3-error.inc" );}
+ $output = "newpass $new_pass\n";
+ fputs($passd,$output);
+
+ $input = fgets($passd, 128);
+ if(!eregi( "^200", $input)){
+ fclose($passd);
+ $errortype="$input";
+ include( "$default->include_dir/passwd.php3-error.inc" );}
+ $output = "quit\n";
+ fputs($passd,$output);
+
+ $input = fgets($passd, 128);
+ if(!eregi( "^200", $input)){
+ fclose($passd);
+ $errortype="$input";
+ include( "$default->include_dir/passwd.php3-error.inc" );}
+ fclose($passd);
+
+ /* yeah, password changedm, user must re-login */
+ echo '';
+ exit;
+
+ }
+
+ default:
+ include( "$default->include_dir/passwd.php3-input.inc" );
+ }
+} else {
+ include( "$default->include_dir/passwd.php3-input.inc" );
+}
+
+?>
diff -urP imp/templates/menu.php3-main.inc imp.0121/templates/menu.php3-main.inc
--- imp/templates/menu.php3-main.inc Sun Jan 3 12:01:34 1999
+++ imp.0121/templates/menu.php3-main.inc Mon Jan 4 17:05:12 1999
@@ -35,7 +35,7 @@
folders ?>
-user_ldap_compose): ?>
+use_ldap_compose): ?>