From 36c5d8b05977f94706c061fcf769206d3ae1d2c1 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 17 Apr 2007 06:56:27 +0000 Subject: [PATCH] Added a red border to entries that have a not valid mac address git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6060 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../addons/gotomasses/class_gotomasses.inc | 9 ++++---- plugins/addons/gotomasses/contents.tpl | 22 ++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc index a8230776f..09e80b8e8 100644 --- a/plugins/addons/gotomasses/class_gotomasses.inc +++ b/plugins/addons/gotomasses/class_gotomasses.inc @@ -82,7 +82,7 @@ class gotomasses extends plugin /* Add a new empty entry to the list */ if(isset($_POST['add_new_entry'])){ - $this->contents[] = array("MAC" => "", "OG" => ""); + $this->contents[] = array("MAC" => "", "OG" => "","VALID_MAC" => FALSE); } /* Call parent execute */ @@ -145,7 +145,7 @@ class gotomasses extends plugin $mac = preg_replace("/(,|;).*$/","",$str); if(!empty($og) || !empty($mac)){ - $this->contents[] = array("MAC" => $mac , "OG" => $og); + $this->contents[] = array("MAC" => $mac , "OG" => $og,"VALID_MAC" => is_mac($mac)); } } fclose($fp); @@ -159,7 +159,7 @@ class gotomasses extends plugin $mac = preg_replace("/(,|;).*$/","",$str); if(!empty($og) || !empty($mac)){ - $this->contents[] = array("MAC" => $mac , "OG" => $og); + $this->contents[] = array("MAC" => $mac , "OG" => $og, "VALID_MAC" => is_mac($mac)); } } } @@ -195,7 +195,8 @@ class gotomasses extends plugin $ogs = $this->get_object_groups(); foreach($this->contents as $id => $data){ if(isset($_POST['mac_'.$id])){ - $this->contents[$id]['MAC'] = $_POST['mac_'.$id]; + $this->contents[$id]['MAC'] = $_POST['mac_'.$id]; + $this->contents[$id]['VALID_MAC'] = is_mac($_POST['mac_'.$id]); } if(isset($_POST['og_'.$id]) && in_array_ics($_POST['og_'.$id],$ogs)){ $this->contents[$id]['OG'] = $_POST['og_'.$id]; diff --git a/plugins/addons/gotomasses/contents.tpl b/plugins/addons/gotomasses/contents.tpl index f2d108f58..de4f1e9f4 100644 --- a/plugins/addons/gotomasses/contents.tpl +++ b/plugins/addons/gotomasses/contents.tpl @@ -26,16 +26,18 @@

 

- - - + - @@ -49,8 +51,15 @@ + + {if !$contents.$key.VALID_MAC} + + -- 2.30.2
+ {t}No.{/t} + {t}Mac address{/t} +   + {t}Object group{/t} + {t}Options{/t}
{$key+1} + {else} + + {/if} + + -  - +  - +