[vhffs-dev] [603] Added Vhffs::Services::MailUser:: changepassword to change user mail password.

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


Revision: 603
Author:   beuss
Date:     2007-05-08 05:59:10 +0000 (Tue, 08 May 2007)

Log Message:
-----------
Added Vhffs::Services::MailUser::changepassword to change user mail password.
Box password is now updated when user has lost his password.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Services/MailUser.pm
    trunk/vhffs-panel/lost_ack.pl
    trunk/vhffs-panel/themes/vhffs/main.css
    trunk/vhffs-panel/themes/vhffs-ng/main.css
    trunk/vhffs-panel/user/prefs.pl


Modified: trunk/vhffs-api/src/Vhffs/Services/MailUser.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/MailUser.pm	2007-05-08 05:33:44 UTC (rev 602)
+++ trunk/vhffs-api/src/Vhffs/Services/MailUser.pm	2007-05-08 05:59:10 UTC (rev 603)
@@ -189,8 +189,12 @@
 	return -1 if( $self->{mail_service}->addbox( $self->{part} , $password ) < 0);
 }
 
+sub changepassword
+{
+    my ($self, $newpass) = @_;
+    return -1 if( $self->{mail_service}->change_box_password( $self->{part}, $newpass ) < 0 );
+}
 
 
 
-
 1;

Modified: trunk/vhffs-panel/lost_ack.pl
===================================================================
--- trunk/vhffs-panel/lost_ack.pl	2007-05-08 05:33:44 UTC (rev 602)
+++ trunk/vhffs-panel/lost_ack.pl	2007-05-08 05:59:10 UTC (rev 603)
@@ -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: trunk/vhffs-panel/themes/vhffs/main.css
===================================================================
--- trunk/vhffs-panel/themes/vhffs/main.css	2007-05-08 05:33:44 UTC (rev 602)
+++ trunk/vhffs-panel/themes/vhffs/main.css	2007-05-08 05:59:10 UTC (rev 603)
@@ -73,7 +73,6 @@
 .misc input
 {
 	background-color: white;
-	font-size: 1.5em;
 }
 
 

Modified: trunk/vhffs-panel/themes/vhffs-ng/main.css
===================================================================
--- trunk/vhffs-panel/themes/vhffs-ng/main.css	2007-05-08 05:33:44 UTC (rev 602)
+++ trunk/vhffs-panel/themes/vhffs-ng/main.css	2007-05-08 05:59:10 UTC (rev 603)
@@ -84,7 +84,6 @@
 .misc input
 {
 	background-color: white;
-	font-size: 1.5em;
 }
 
 

Modified: trunk/vhffs-panel/user/prefs.pl
===================================================================
--- trunk/vhffs-panel/user/prefs.pl	2007-05-08 05:33:44 UTC (rev 602)
+++ trunk/vhffs-panel/user/prefs.pl	2007-05-08 05:59:10 UTC (rev 603)
@@ -155,10 +155,9 @@
                          }
                     } else {
                         #Box already exists
-                        # 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 ) {
-                            $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/