summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc09ae7)
raw | patch | inline | side by side (parent: bc09ae7)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 May 2006 11:49:31 +0000 (11:49 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 9 May 2006 11:49:31 +0000 (11:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3232 594d385d-05f5-0310-b6e9-bd551577e9d8
index 11317ec03b931df8f595047ca7759bb90136ba9b..c22c3c563a44ca3ebfa4dae5c2e793e202fdbec6 100644 (file)
--- a/TODO
+++ b/TODO
* Fix fai objects to generate tags if needed (sub objects, phone me...)
+* Add macAddress replacement for tc's and servers, too
+
+* What about unitTag's when moving objects?
+
Target for 2.5:
===============
diff --git a/include/functions.inc b/include/functions.inc
index e051a3948c32447ef7e3b2a501fee4f9384cae3c..92f858105b100df5da3fa5d1566d106180e78b63 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
+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_id($id)
{
if ($id == ""){
diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc
index 3b1f4168b91fe3f1f2eb623e21d772bc93bab8ce..7ac18845e37b94726cc0d6e2d6b3a4cf4f97b4fe 100644 (file)
$message[]= _("The required field 'Component name' is not set.");
}
+ /* To check for valid ip*/
+ if($this->netConfigDNS->ipHostNumber == ""){
+ $message[]= _("The required field IP address is empty.");
+ } else {
+ if (!is_ip($this->netConfigDNS->ipHostNumber)){
+ $message[]= _("The field IP address contains an invalid address.");
+ }
+ }
+
$ui= get_userinfo();
$acl= get_permissions ($this->dn, $ui->subtreeACL);
$acl= get_module_permission($acl, "component", $this->dn);
diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc
index 65cb290a52014a59e976f50664a76412e2f55787..0009690000dfa71b27037a04e1a6855778428a97 100644 (file)
$this->dn= "cn=".$this->cn.",ou=phones,ou=systems,".$this->base;
/* To check for valid ip*/
- $num="(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
-
-// if(in_array("goFonDefaultIP",$this->usedattrs[$this->selected_categorie])){
-// if (!preg_match("/^$num\\.$num\\.$num\\.$num$/", $this->goFonDefaultIP)){
-// $message[]= _("Wrong IP format in field goFonDefaultIP.");
-// }
-// }
-
-// /* Check for valid number */
-// if(in_array("goFonDefaultIP",$this->usedattrs[$this->selected_categorie])){
-// if((strlen($this->goFonQualify))!=(strlen((int)($this->goFonQualify)))){
-// $message[]= _("The given value for 'Response timeout' is not a valid number.");
-// }
-// }
+ if($this->netConfigDNS->ipHostNumber == ""){
+ $message[]= _("The required field IP address is empty.");
+ } else {
+ if (!is_ip($this->netConfigDNS->ipHostNumber)){
+ $message[]= _("The field IP address contains an invalid address.");
+ }
+ }
if ($this->cn == "" && chkacl ($this->acl, "cn") == ""){
$message[]= _("The required field 'Phone name' is not set.");
$ldap->cd($this->dn);
$this->cleanup();
-$ldap->modify ($this->attrs);
+ $ldap->modify ($this->attrs);
// $user_phone_reload
$ldap->cd ($this->config->current['BASE']);