Packageindex Classtrees Modulegroups Elementlist Report XML Files

XName -

Primary

Zone
   |
  +-- Primary

Class for all functions for primary manipulation

 

public class Primary extends Zone

Class for all functions for primary manipulation

 

Methods inherited from Zone

zone, exists, subexists, retrieveid, zonecreate, zonedelete, zonelogs, zonestatus, retrieveuser

Public Method Summary

void

Primary(string $db, string $zonename, string $zonetype, string $user)

Class constructor & data retrieval (use of Retrieve[Multi]Record)
string

printModifyForm()

returns a pre-filled form to modify primary records
string

PrintModified(array $params)

Process params from primarymodifyform() form:
string

Delete(array $delete)

Takes list of items to be deleted, and process them

Private Method Summary

string

AddMXRecord(string $mx, int $pref)

Add an MX record to the current zone
string

AddNSRecord(string $ns)

Add an NS record to the current zone
string

AddARecord(string $a, string $aname)

Add an A record to the current zone
string

AddCNAMERecord(string $cname, string $cnamea)

Add an CNAME record to the current zone
string

AddSUBNSRecord(string $subns, string $subnsa)

Add a zone delegation to the current zone
string

AddAZONERecord(string $azone)

Add an A record to for the top of the current zone
string

UpdateSOA(string $xferip)

Update SOA of current zone
int

RetrieveRecords(string $type, array &$arraytofill)

Fill in given array with all records of type $type for current zone
int

RetrieveMultiRecords(string $type, array &$array1tofill, array &$array2tofill)

Same as RetrieveRecords, but used when a type of record might
int

generateConfigFile()

Generate a temporary config file in /tmp

Fields inherited from Zone

$db, $error, $zonename, $zonetype, $userid, $zoneid

Private Field Summary

unknown

$creation

unknown

$serial

unknown

$refresh

unknown

$retry

unknown

$expiry

unknown

$minimum

unknown

$xfer

unknown

$user

unknown

$mx

unknown

$ns

unknown

$a

unknown

$aip

unknown

$azone

unknown

$cname

unknown

$dname

unknown

$a6

unknown

$aaaa

unknown

$subns

unknown

$subnsa

Public Method Details

Primary

public void Primary( string $db, string $zonename, string $zonetype, string $user )

  Class constructor & data retrieval (use of Retrieve[Multi]Record)

Parameter
string $db
DB
string $zonename
zone name
string $zonetype
zone type (must be 'M'aster)
string $user
class member user for current user
Returns void


printModifyForm

public string printModifyForm( )

  returns a pre-filled form to modify primary records

Returns string

HTML pre-filled form


PrintModified

public string PrintModified( array $params )

  Process params from primarymodifyform() form:
for each record type execute addTYPERecord, execute updateSOAand outputs result & config file

Parameter
array $params
contains $VARS ($HTTP_GET_VARS or POST), $azone and $xferip
Returns string

HTML result


Delete

public string Delete( array $delete )

  Takes list of items to be deleted, and process them

Parameter
array $delete
list of items cname(alias), a(name), ns(name), etc..
Returns string

text of result (Deleting XXX record... Ok<br />)


Private Method Details

AddMXRecord

private string AddMXRecord( string $mx, int $pref )

  Add an MX record to the current zone

Parameter
string $mx
name of MX
int $pref
preference value for this MX
Returns string

text of result (Adding MX Record... Ok)


AddNSRecord

private string AddNSRecord( string $ns )

  Add an NS record to the current zone

Parameter
string $ns
name of NS
Returns string

text of result (Adding NS Record... Ok)


AddARecord

private string AddARecord( string $a, string $aname )

  Add an A record to the current zone

Parameter
string $a
ip of A record
string $aname
name of A record
Returns string

text of result (Adding A Record... Ok)


AddCNAMERecord

private string AddCNAMERecord( string $cname, string $cnamea )

  Add an CNAME record to the current zone

Parameter
string $cname
name of CNAME record
string $cnamea
record pointed by this CNAME record
Returns string

text of result (Adding CNAME Record... Ok)


AddSUBNSRecord

private string AddSUBNSRecord( string $subns, string $subnsa )

  Add a zone delegation to the current zone

Parameter
string $subns
name of subzone
string $subnsa
name of NS server
Returns string

text of result (Adding zone NS Record... Ok)


AddAZONERecord

private string AddAZONERecord( string $azone )

  Add an A record to for the top of the current zone

Parameter
string $azone
ip of the zone's A record
Returns string

text of result (Adding A zone Record... Ok)


UpdateSOA

private string UpdateSOA( string $xferip )

  Update SOA of current zone

Parameter
string $xferip
IP(s) allowed to do zone transfers
Returns string

1 if success, 0 if DB error, string of error else


RetrieveRecords

private int RetrieveRecords( string $type, array &$arraytofill )

  Fill in given array with all records of type $type for current zone

Parameter
string $type
type of record to be retrieved
array &$arraytofill
reference of array to be filled with records
Returns int

1 if success, 0 if error


RetrieveMultiRecords

private int RetrieveMultiRecords( string $type, array &$array1tofill, array &$array2tofill )

  Same as RetrieveRecords, but used when a type of record might
have multiple similar entries (A for round robin, NS, etc...)Results are stored in two separate arrays

Parameter
string $type
type of record to be retrieved
array &$array1tofill
reference of array to be filled with first record element
array &$array2tofill
reference of array to be filled with second record element
Returns int

1 if success, 0 if error


generateConfigFile

private int generateConfigFile( )

  Generate a temporary config file in /tmp

Returns int

1


Private Field Details

$creation

private unknown $creation

>><<



$serial

private unknown $serial

>><<



$refresh

private unknown $refresh

>><<



$retry

private unknown $retry

>><<



$expiry

private unknown $expiry

>><<



$minimum

private unknown $minimum

>><<



$xfer

private unknown $xfer

>><<



$user

private unknown $user

>><<



$mx

private unknown $mx

>><<



$ns

private unknown $ns

>><<



$a

private unknown $a

>><<



$aip

private unknown $aip

>><<



$azone

private unknown $azone

>><<



$cname

private unknown $cname

>><<



$dname

private unknown $dname

>><<



$a6

private unknown $a6

>><<



$aaaa

private unknown $aaaa

>><<



$subns

private unknown $subns

>><<



$subnsa

private unknown $subnsa

>><<




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta