summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 82e64ef)
raw | patch | inline | side by side (parent: 82e64ef)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Dec 2009 14:56:23 +0000 (14:56 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Dec 2009 14:56:23 +0000 (14:56 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14876 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc | patch | blob | history |
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc
index 87e1efc5ecf120c4714da6eb3f9e086eb3a3e6eb..2635140005cb1a00beefcc2502634c74b52cde87 100644 (file)
$tmp2 = array();
foreach($device['RECORDS'] as $Num => $Rec){
+ /* Check values */
+ if ($Rec['type'] != "pTRRecord") {
+ $msg= $this->checkRecordType($DevName, $Rec['type'], $Rec['value']);
+ if ($msg != "") {
+ $message[]= $msg;
+ }
+ }
+
/* Check for multiple use of unique record types
*/
if(in_array($Rec['type'],$singleEntries)){
}
+ /* Check record types for strange inputs */
+ function checkRecordType($name, $type, $value)
+ {
+echo $type;
+ $checks= array(
+ "aRecord" => "/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/"
+ );
+
+ /* No check for entry */
+ if (!isset($checks[$type])) {
+ return "";
+ }
+
+ /* Else check ;-) */
+ if (!preg_match($checks[$type], $value)) {
+ return (sprintf("The syntax of entry %s (record type %s, value %s) is invalid!", $name, $type, $value));
+ }
+ }
+
+
function remove_from_parent()
{
}