ispman/lib/ISPMan ConfMan.pm,1.9,1.10

[email protected]
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/lib/ISPMan
In directory sc8-pr-cvs1:/tmp/cvs-serv7388

Modified Files:
	ConfMan.pm 
Log Message:
Adding some utility functions to get DN by module and var. Also adding scope one to getModules

Index: ConfMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ConfMan.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ConfMan.pm	26 Apr 2003 12:47:58 -0000	1.9
+++ ConfMan.pm	13 Jan 2004 22:14:24 -0000	1.10
@@ -40,6 +40,8 @@
 modifyModule
 getConfVars
 setConfVar
+getConfVarDN
+getConfModuleDN
 );
 
 $VERSION = '0.01';
@@ -55,18 +57,29 @@
 
 }
 
+sub getConfModuleDN{
+	my $self=shift;
+	my ($module)=shift;
+	return "ispmanModule=$module,ou=conf, @{[$self->getConf('ldapBaseDN')]}";
+}
+
+sub getConfVarDN {
+	my $self=shift;
+	my ($module,$var)=@_;
+	return join ',', "ispmanVar=$var" , $self->getConfModuleDN($module);
+}
 
 sub getConfModules {
    my $self=shift;
    $self->log_event("running getConfModules"); 
-   return   $self->{'ldap'}->getEntriesAsHashRef("ou=conf, @{[$self->getConf('ldapBaseDN')]}", "objectclass=ispmanconfmodule", ["ispmanModule", "description", "ispmanModuleAlias"]);
+   return   $self->{'ldap'}->getEntriesAsHashRef("ou=conf, @{[$self->getConf('ldapBaseDN')]}", "objectclass=ispmanconfmodule", ["ispmanModule", "description", "ispmanModuleAlias"], 'one');
 }
 
 sub getConfVars {
    my $self=shift;
    my $module=shift;
    $module||="*";
-   return   $self->{'ldap'}->getEntriesAsHashRef("ou=conf, @{[$self->getConf('ldapBaseDN')]}", "&(objectclass=ispmanConfVar)(ispmanModule=$module)", ["ispmanModule", "ispmanVar", "ispmanVal", "ispmanQuestion"]);
+   return $self->{'ldap'}->getEntriesAsHashRef("ou=conf, @{[$self->getConf('ldapBaseDN')]}", "&(objectclass=ispmanConfVar)(ispmanModule=$module)", ["ispmanModule", "ispmanVar", "ispmanVal", "ispmanQuestion"]);
 }
 
 




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.