[vhffs-dev] [604] Backport of revision 603 to vhffs-4.0.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 604
Author:   beuss
Date:     2007-05-08 06:04:25 +0000 (Tue, 08 May 2007)

Log Message:
-----------
Backport of revision 603 to vhffs-4.0.

Modified Paths:
--------------
    branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/MailUser.pm
    branches/vhffs-4.0/vhffs-panel/lost_ack.pl
    branches/vhffs-4.0/vhffs-panel/user/prefs_save.pl


Modified: branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/MailUser.pm
===================================================================
--- branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/MailUser.pm	2007-05-08 05:59:10 UTC (rev 603)
+++ branches/vhffs-4.0/vhffs-api/src/Vhffs/Services/MailUser.pm	2007-05-08 06:04:25 UTC (rev 604)
@@ -229,8 +229,12 @@
 	return -2 if( $self->{object}->commit < 0 );
 }
 
+sub changepassword
+{
+    my ($self, $newpass) = @_;
+    return -1 if( $self->{mail_service}->change_box_password( $self->{part}, $newpass ) < 0 );
+}
 
 
 
-
 1;

Modified: branches/vhffs-4.0/vhffs-panel/lost_ack.pl
===================================================================
--- branches/vhffs-4.0/vhffs-panel/lost_ack.pl	2007-05-08 05:59:10 UTC (rev 603)
+++ branches/vhffs-4.0/vhffs-panel/lost_ack.pl	2007-05-08 06:04:25 UTC (rev 604)
@@ -58,6 +58,15 @@
 {
     #create a new password for this user
     my $plainpassword = $user->generate_password;
+    my $mu;
+    if( $vhffs->get_config->use_mailuser == 1 ) {
+        use Vhffs::Services::MailUser;
+        $mu = init Vhffs::Services::MailUser( $vhffs , $user );
+        if( defined $mu  &&  ref($mu)  &&  $mu->available > 0 && $mu->exists_box) {
+            $mu->changepassword( $plainpassword);
+        } 
+    }
+
     
     # Send a mail with plain password inside
     my $subject = "Password changed";

Modified: branches/vhffs-4.0/vhffs-panel/user/prefs_save.pl
===================================================================
--- branches/vhffs-4.0/vhffs-panel/user/prefs_save.pl	2007-05-08 05:59:10 UTC (rev 603)
+++ branches/vhffs-4.0/vhffs-panel/user/prefs_save.pl	2007-05-08 06:04:25 UTC (rev 604)
@@ -198,11 +198,10 @@
 				}
 				else
 				{
-					# The use changed his password, we must update password for mail
+					# The user changed his password, we must update password for mail
 					if( $pwd_change == 1 )
 					{
-						$mu->delbox;
-						$mu->addbox( $pass1 );
+                        $mu->changepassword( $pass1);
 					}
 
 					# We change the spam status. if the spam status changed


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/