本文整理汇总了PHP中Zone::zoneDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP Zone::zoneDelete方法的具体用法?PHP Zone::zoneDelete怎么用?PHP Zone::zoneDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone::zoneDelete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
// delete each zone one by one if admin or no usergroup
if ($config->usergroups && $group->getGroupRights($user->userid) == 'A' || !$config->usergroups) {
if ($config->usergroups) {
$zonelist = $group->listallzones();
} else {
$zonelist = $user->listallzones();
}
while ($otherzones = array_pop($zonelist)) {
$zone = new Zone($otherzones[0], $otherzones[1], $otherzones[2]);
if ($zone->zonetype == 'P') {
$currenttype = $l['str_primary'];
} else {
$currenttype = $l['str_secondary'];
}
$content .= sprintf($l['str_deleting_x_x_from_x'], $zone->zonename, $currenttype, $config->sitename) . '...<br>';
if (!$zone->zoneDelete()) {
$content .= $zone->error . ' ' . $l['str_errors_occured_during_deletion_plz_try_again'] . '<br> ' . sprintf($l['str_if_problem_persists_x_contact_us_x'], '<a href="mailto:' . $config->contactemail . '">', '</a>') . '<p >';
$localerror = 1;
} else {
$content .= $l['str_zone_successfully_deleted'] . '<p >';
}
}
// end while zone
}
// end zones has to be deleted
// delete user
// if group admin, delete grouplogs
if (!$localerror) {
if ($config->usergroups) {
if ($config->userlogs) {
if ($group->getGroupRights($user->userid) == 'A') {
示例2: delete
//.........这里部分代码省略.........
$valip = $val2;
}
$result .= $this->DeleteARecord($val1, $valid, $valip, $updatereverse);
$query = "";
break;
case "aaaa":
// www IN AAAA IPv6
preg_match("/^(.*)\\/(.*)/", $newvalue, $item);
$val1 = $item[1];
$val2 = $item[2];
# TODO: use DeleteARecord function(!)
$query = "DELETE FROM dns_record\n WHERE zoneid='" . $this->zoneid . "'\n AND type='AAAA' AND id='" . mysql_real_escape_string($val2) . "'";
$result .= sprintf($l['str_primary_deleting_aaaa_x'], xssafe($val1)) . "... ";
break;
case "txt":
// www IN TXT String
preg_match("/^(.*)\\/(.*)/", $newvalue, $item);
$val1 = $item[1];
$val2 = $item[2];
$query = "DELETE FROM dns_record\n WHERE zoneid='" . $this->zoneid . "'\n AND type='TXT' AND id='" . mysql_real_escape_string($val2) . "' ";
$result .= sprintf($l['str_primary_deleting_txt_x'], xssafe($val1)) . "... ";
break;
case "ptr":
// ip IN PTR name
preg_match("/^(.*)\\/(.*)/", $newvalue, $item);
$val1 = $item[1];
$val2 = $item[2];
preg_match("/^(.*)-(.*)/", $val2, $itembis);
$valid = $itembis[1];
$valname = $itembis[2];
$result .= $this->DeletePTRRecord($val1, $valid, $valname, $updatea);
$query = "";
break;
case "ns":
preg_match("/^(.*)-(.*)/", $newvalue, $item);
$valname = $item[1];
$valid = $item[2];
// IN NS name
$query = "DELETE FROM dns_record\n WHERE zoneid='" . $this->zoneid . "'\n AND type='NS' AND id='" . mysql_real_escape_string($valid) . "'";
$result .= sprintf($l['str_primary_deleting_ns_x'], xssafe($valname)) . "... ";
break;
case "mx":
preg_match("/^(.*)\\/(.*)/", $newvalue, $item);
$valname = $item[1];
$valid = $item[2];
// * IN MX pref name
$query = "DELETE FROM dns_record\n WHERE zoneid='" . $this->zoneid . "'\n AND type='MX' AND id='" . mysql_real_escape_string($valid) . "'";
$result .= sprintf($l['str_primary_deleting_mx_x'], xssafe($valname)) . "... ";
break;
case "subns":
// newzone IN NS ns.name
preg_match("/^(.*)\\/(.*)/", $newvalue, $item);
$val1 = $item[1];
$val2 = $item[2];
preg_match("/^(.*)-(.*)/", $val2, $itembis);
$valname = $item[1];
$valid = $item[2];
$query = "DELETE FROM dns_record\n WHERE zoneid='" . $this->zoneid . "'\n AND type='SUBNS' AND id='" . mysql_real_escape_string($valid) . "'";
$result .= sprintf($l['str_primary_deleting_sub_zone_x'], xssafe($valname)) . "... ";
break;
case "delegate":
// $newvalue: XX-YY
list($from, $to) = split('-', $newvalue);
// remove CNAMEs
for ($cnamecounter = intval($from); $cnamecounter <= intval($to); $cnamecounter++) {
$query = "DELETE FROM dns_record\n WHERE zoneid='" . $this->zoneid . "'\n AND type='CNAME' AND val1='" . $cnamecounter . "'";
$res = $db->query($query);
if ($db->error()) {
$this->error = $l['str_trouble_with_db'];
}
}
// remove NS
$query = "DELETE FROM dns_record WHERE zoneid='" . $this->zoneid . "'\n AND type='SUBNS' AND val1='" . mysql_real_escape_string($newvalue) . "'";
$res = $db->query($query);
if ($db->error()) {
$this->error = $l['str_trouble_with_db'];
}
// delete zone
// use zoneDelete()
$query = "SELECT userid FROM dns_zone WHERE zone='" . mysql_real_escape_string($newvalue) . "." . $this->zonename . "' AND zonetype='P'";
$res = $db->query($query);
$line = $db->fetch_row($res);
$zonetodelete = new Zone($newvalue . "." . $this->zonename, 'P', '', $line[0]);
$zonetodelete->zoneDelete();
// delete DELEGATE record
$query = "DELETE FROM dns_record\n WHERE zoneid='" . $this->zoneid . "'\n AND type='DELEGATE' AND val1='" . mysql_real_escape_string($newvalue) . "'";
break;
}
}
if (!empty($query)) {
$res = $db->query($query);
if ($db->error()) {
$this->error = $l['str_trouble_with_db'];
} else {
$result .= $l['str_primary_deleting_ok'] . "<br>\n";
}
}
}
return $result;
}