ispman/lib/ISPMan UserMan.pm,1.52,1.53
Atif Ghaffar <[email protected]>
| Newsgroups | gmane.comp.isp.ispman.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ispman/ispman/lib/ISPMan
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13866
Modified Files:
UserMan.pm
Log Message:
Passing Process parameters by name as in URL
Index: UserMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/UserMan.pm,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- UserMan.pm 5 Sep 2004 11:18:13 -0000 1.52
+++ UserMan.pm 30 Dec 2004 01:02:38 -0000 1.53
@@ -173,28 +173,18 @@
# add user to LDAP from user ldif template
if ( $self->addDataFromLdif( "templates/users.ldif.template", $r ) ) {
if ( $r->param("mailHost") ) {
- $self->addProcessToHost( $domain, $r->param("mailHost"),
- "createMailbox", join "",
- ( $self->getConf("imapMailboxPrefix"), $_uid ) );
- $self->addProcessToHost(
- $domain,
- $r->param("mailHost"),
- "setMailboxQuota",
- join ',',
- (
- ( join "", ( $self->getConf("imapMailboxPrefix"), $_uid ) ),
- $r->param("mailQuota") * 1024
- )
- );
+ $self->addProcessToHost( $domain, $r->param("mailHost"),"createMailbox", "mailbox=$_uid");
+ my $quota=$r->param("mailQuota") * 1024;
+ $self->addProcessToHost($domain, $r->param("mailHost"), "setMailboxQuota", "mailbox=$_uid"a=$quota");
}
-# send the process to method addUserFileServerProcess
-# the process will only be sent to fileHost if one is defined
-# if not defined then we fall back to the old method and send to the filserver group
+ # send the process to method addUserFileServerProcess
+ # the process will only be sent to fileHost if one is defined
+ # if not defined then we fall back to the old method and send to the filserver group
# passing domain, username, process and username as params
- $self->addUserFileServerProcess( $domain, $_uid, 'createHomeDirectory',
- $_uid );
+ my $_userInfo=$self->getUserInfo($_uid);
+ $self->addUserFileServerProcess( $domain, $_uid, 'createHomeDirectory', "uid=$_uid&homeDirectory=$_userInfo->{'homeDirectory'}&uidNumber=$_userInfo->{'uidNumber'}&gidNumber=$_userInfo->{'gidNumber'}");
return 1;
}
@@ -239,7 +229,10 @@
#can be called from CLI or other subroutines
# get all values from the dn to the hash
+ print "Deleting $dn<br>";
$self->{'user'} = $self->{'ldap'}->getEntryAsHashRef($dn);
+ print $self->html_dumper($self->{'user'});
+
#it is possible that as user has multiple uids.
#hint
@@ -262,10 +255,11 @@
$self->{'user'}{'ispmanDomain'},
$self->{'user'}{'uid'},
'deleteHomeDirectory',
- join ',',
- (
- $self->{'user'}{'uid'}, $self->{'user'}{'homeDirectory'},
- $self->{'user'}{'uidNumber'}, $self->{'user'}{'gidNumber'}
+ join '&', (
+ "uid=" . $self->{'user'}{'uid'},
+ "homeDirectory=" . $self->{'user'}{'homeDirectory'},
+ "uidNumber=" . $self->{'user'}{'uidNumber'},
+ "gidNumber=" . $self->{'user'}{'gidNumber'}
)
);
@@ -273,10 +267,7 @@
$self->addProcessToHost(
$self->{'user'}{'ispmanDomain'},
$self->{'user'}{"mailHost"},
- "deleteMailbox",
- join "",
- ( $self->getConf("imapMailboxPrefix"), $self->{'user'}{'uid'} )
- );
+ "deleteMailbox", "mailbox=$self->{'user'}{'uid'}");
}
$self->deleteEntry($dn);
}
@@ -337,24 +328,13 @@
my $userInfo = $self->getUserInfo( $r->param("uid") );
if ( $userInfo->{'mailHost'} && $r->param("mailQuota") ) {
my $quota = $r->param("mailQuota") * 1024;
+ my $mailbox=$r->param("uid");
unless ( $quota == $userInfo->{'mailQuota'} ) {
$data->{'mailQuota'} = $quota;
$self->addProcessToHost(
$userInfo->{'ispmanDomain'},
$userInfo->{'mailHost'},
- "setMailboxQuota",
- join ',',
- (
- (
- join "",
- (
- $self->getConf("imapMailboxPrefix"),
- $r->param("uid")
- )
- ),
- $quota
- )
- );
+ "setMailboxQuota", "mailbox=$mailbox"a=$quota");
}
}
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt