From: cajus Date: Tue, 7 Nov 2006 07:09:19 +0000 (+0000) Subject: Move from "none" to "$name" as requested X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b732853e38b57be298974dd5e25a01b03f071b62;p=gosa.git Move from "none" to "$name" as requested git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5025 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/Changelog b/Changelog index e0ca4c2f6..d20c453af 100644 --- a/Changelog +++ b/Changelog @@ -3,8 +3,8 @@ GOsa2 changelog * gosa 2.5.6 - Fixed endless javascript loop in setup.php - - Fixed setup.php to have no loops in certain cases - Avoid tab lables to have line feeds + - Activated missing checks for IP and MAC * gosa 2.5.5 - Added remove method for shared folder in kolab mode diff --git a/include/functions.inc b/include/functions.inc index 354d92816..a4b893960 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -986,6 +986,13 @@ function is_ip($ip) return preg_match("/^(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]?)$/", $ip); } + +function is_mac($mac) +{ + return preg_match("/^[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]$/i", $mac); +} + + /* Checks if the given ip address doesn't match "is_ip" because there is also a sub net mask given */ function is_ip_with_subnetmask($ip) diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index b58169262..c5665751c 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -50,7 +50,7 @@ class divListSystem extends MultiSelectWindow /* set Page header */ $this->AddHeader(array("string"=>" ","attach"=>"style='width:20px;'")); $this->AddHeader(array("string"=>_("System / Department"))); - $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:60px;border-right:0px;'")); + $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:70px;border-right:0px;'")); /* Text ,Value ,Name ,Is selected */ $this->AddCheckBox("ShowServers", _("Select to see servers"), _("Show servers"), true); @@ -175,6 +175,10 @@ class divListSystem extends MultiSelectWindow $action2 = ""; } + if(in_array("gotoWorkstation",$val['objectClass'])){ + $action2= "".$action2; + } + if(isset($val['message'])){ $display.= " (".$val['message']." '".$this->config->idepartments[$_SESSION['CurrentMainBase']]."' )"; } @@ -182,7 +186,7 @@ class divListSystem extends MultiSelectWindow $img = $this->parent->convert_list($val); $field1 = array("string" => sprintf($img['img'],$val['dn']), "attach" => "style='text-align:center;width:20px;'"); $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".preg_replace('/ /', ' ', @LDAP::fix($val['dn']))."'"); - $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action), "attach" => "style='width:60px;border-right:0px;text-align:right;'"); + $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action), "attach" => "style='width:70px;border-right:0px;text-align:right;'"); $this->AddElement( array($field1,$field2,$field3)); } diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 2a959b8bb..9a1b941a2 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -83,6 +83,9 @@ class systems extends plugin }elseif(preg_match("/user_setpwd_.*/i",$key)){ $s_action="change_pw"; $s_entry = preg_replace("/user_setpwd_/i","",$key); + }elseif(preg_match("/gen_cd_.*/i",$key)){ + $s_action="gen_cd"; + $s_entry = preg_replace("/gen_cd_/i","",$key); }elseif(preg_match("/newsystem_.*/i",$key)){ $s_action="newsystem"; $s_entry = preg_replace("/newsystem_/i","",$key); @@ -219,6 +222,16 @@ class systems extends plugin } } + /******************** + Create FAI CD ... + ********************/ + if ($s_action=="gen_cd"){ + $this->dn= $this->terminals[$s_entry]['dn']; + $_SESSION['objectinfo']= $this->dn; + return ($smarty->fetch(get_template_path('gencd.tpl', TRUE))); + } + + /******************** Change password ... diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 74a7183e5..fc55c61d7 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -298,12 +298,11 @@ class termDNS extends plugin $message[]= _("The required field 'IP-address' is not set."); } - /* check if given ip is valid ipi - */ - $num="(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])"; - if (!preg_match("/^$num\\.$num\\.$num\\.$num$/", $this->ipHostNumber)){ - $message[]= _("Wrong IP format in field IP-address."); - } + } + + /* check if given ip is valid ip */ + if ($this->ipHostNumber != "" && !is_ip($this->ipHostNumber)){ + $message[]= _("Wrong IP format in field IP-address."); } /* Check if mac is empty @@ -314,8 +313,7 @@ class termDNS extends plugin /* Check if given mac is valid mac */ - $tr = count(split(":",$this->macAddress)); - if($tr!=6){ + if(!is_mac($this->macAddress)){ $message[]=(_("The given macaddress is invalid. There must be 6 2byte segments seperated by ':'.")); }