Changeset 13 for trunk/DNSDB.pm


Ignore:
Timestamp:
09/11/09 17:59:51 (15 years ago)
Author:
Kris Deugau
Message:

/trunk

Checkpoint
Merging record add/edit pieces into one template/code block
Added debugging array @debugbits to push strings into rather than printing,

since we haven't spit out headers before the processing (this is so we can
redirect)

Added DNSDB::grpName
Removed obsolete defrecs.tmpl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r10 r13  
    2323@ISA            = qw(Exporter);
    2424@EXPORT_OK      = qw(
    25         &initGlobals &connectDB &finish &addDomain &delDomain &domainName &getSOA &getRecLine &getDomRecs
    26         &addRec &delRec &domStatus
     25        &initGlobals &connectDB &finish &addDomain &delDomain &domainName &grpName &getSOA &getRecLine
     26        &getDomRecs &addRec &delRec &domStatus
    2727        %typemap %reverse_typemap
    2828        );
     
    3030@EXPORT         = (); # Export nothing by default.
    3131%EXPORT_TAGS    = ( ALL => [qw(
    32                 &initGlobals &connectDB &finish &addDomain &delDomain &domainName &getSOA &getRecLine &getDomRecs
    33                 &addRec &delRec &domStatus
     32                &initGlobals &connectDB &finish &addDomain &delDomain &domainName &grpName &getSOA &getRecLine
     33                &getDomRecs &addRec &delRec &domStatus
    3434                %typemap %reverse_typemap
    3535                )]
     
    254254
    255255
     256## DNSDB::grpName()
     257# Return the domain name based on a domain ID
     258# Takes a database handle and the domain ID
     259# Returns the domain name or undef on failure
     260sub grpName {
     261  $errstr = '';
     262  my $dbh = shift;
     263  my $grpid = shift;
     264  my $sth = $dbh->prepare("select name from groups where group_id=?");
     265  $sth->execute($grpid);
     266  my ($grpname) = $sth->fetchrow_array();
     267  $errstr = $DBI::errstr if !$grpname;
     268  return $grpname if $grpname;
     269} # end domainName
     270
     271
    256272## DNSDB::editRecord()
    257273# Change an existing record
Note: See TracChangeset for help on using the changeset viewer.