ispman/lib/ISPMan UserMan.pm,1.63,1.64

Joerg Delker <[email protected]> Tue, 21 Nov 2006 14:41:31 +0000
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/lib/ISPMan
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv21579/lib/ISPMan

Modified Files:
	UserMan.pm 
Log Message:
merged branch dev_1_3-cyrus_virtdomain2

Index: UserMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/UserMan.pm,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- UserMan.pm	20 Nov 2006 16:03:39 -0000	1.63
+++ UserMan.pm	21 Nov 2006 14:41:29 -0000	1.64
@@ -61,6 +61,7 @@
     my $domain = $r->param("ispmanDomain");
     print "Sorry cannot add users to a replica domain<br>"
       . "Instead add users to its master domain which is ";
+
     my $replicaMaster =
       $self->getEntry(
         "ispmanDomain=$domain, $self->{'Config'}->{'ldapBaseDN'}",
@@ -182,12 +183,20 @@
 
     # add user to LDAP from user ldif template
     if ( $self->addDataFromLdif( "templates/users.ldif.template", $r ) ) {
+        
+        # reread user from LDAP to get computed values
+        my $_userInfo=$self->getUserInfo($_uid);
+        
         if ( $r->param("mailHost") ) {
-            $self->addProcessToHost( $domain, $r->param("mailHost"),
-                "createMailbox", "mailbox=$_uid" );
-            my $quota = $r->param("mailQuota") * 1024;
-            $self->addProcessToHost( $domain, $r->param("mailHost"),
-                "setMailboxQuota", "mailbox=$_uid&quota=$quota" );
+            my $quota=$r->param("mailQuota") * 1024;
+            $self->addProcessToHost($domain, $_userInfo->{'mailHost'},
+            "createMailbox",
+            "mailbox=".$_userInfo->{'mailLocalAddress'});
+            
+            $self->addProcessToHost($domain, $_userInfo->{'mailHost'},
+            "setMailboxQuota", 
+            "mailbox=".$_userInfo->{'mailLocalAddress'}."&".
+            "quota=$quota");
         }
 
         # send the process to method addUserFileServerProcess
@@ -290,10 +299,12 @@
 
     if ( $self->{'user'}{"mailHost"} ) {
         $self->addProcessToHost(
-            $self->{'user'}{'ispmanDomain'}, $self->{'user'}{"mailHost"},
-            "deleteMailbox",                 "mailbox=$self->{'user'}{'uid'}"
-        );
+            $self->{'user'}{'ispmanDomain'},
+            $self->{'user'}{"mailHost"},
+            "deleteMailbox", 
+            "mailbox=".$self->{'user'}{'mailLocalAddress'});
     }
+
     $self->deleteEntry($dn);
 }
 
@@ -541,6 +552,7 @@
 sub getUserDN {
     my $self = shift;
     my ( $domain, $uid ) = @_;
+    $uid =~ s/\.|\@/_/g;
     return join( ",", "uid=$uid", $self->getUsersBranchDN($domain) );
 }
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV