summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0124773)
raw | patch | inline | side by side (parent: 0124773)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 26 Oct 2007 06:13:45 +0000 (06:13 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 26 Oct 2007 06:13:45 +0000 (06:13 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7668 594d385d-05f5-0310-b6e9-bd551577e9d8
12 files changed:
index 59ca97dde940f913ad2185782c91d9591ff50a13..c32be66ae6821f9ddc0803b84ccebfa239378808 100644 (file)
continue;
}
- $entry_id = $task_id= 0;
+ $entry_id = $task_id= "";
/* Comment must be set correctly */
if(empty($comment)){
$desc = "";
}else{
- $task_id =preg_replace("/^.*taskid:([0-9]*).*$/","\\1",$comment);
- $entry_id=preg_replace("/^.*entryid:([0-9]*).*$/","\\1",$comment);
+ $task_id =preg_replace("/^.*taskid:([0-9a-z]*).*$/i","\\1",$comment);
+ $entry_id=preg_replace("/^.*entryid:([0-9a-z]*).*$/i","\\1",$comment);
$desc =preg_replace("/^.*desc:(.*)$/","\\1",$comment);
}
- if($task_id == 0 || empty($task_id)){
+ if($task_id == "" || empty($task_id)){
$task_id = $this->get_new_id();
}
- if($entry_id == 0 || empty($entry_id)){
+ if($entry_id == "" || empty($entry_id)){
$entry_id = $this->get_new_id();
}
return(TRUE);
}
- private function _add_entry($entry,$task_id = 0)
+ private function _add_entry($entry,$task_id = "")
{
- if($task_id == 0 || empty($task_id)){
+ if($task_id == "" || empty($task_id)){
$task_id = $this->get_new_id();
}
$entry['TASK_ID'] = $task_id;
diff --git a/include/functions.inc b/include/functions.inc
index 423fb28e3659626511b236c2f878d65323333669..adf7cf60a41d858768e89f6787ccf9ade05909a0 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
return preg_match ("/^[\/0-9 ()+*-]+$/", $nr);
}
+function is_dns_name($str)
+{
+ return(preg_match("/^[a-z0-9\.\-]*$/i",$str));
+}
function is_url($url)
{
diff --git a/plugins/addons/gotomasses/class_divListMasses.inc b/plugins/addons/gotomasses/class_divListMasses.inc
index 9a17bffdcc39377ce7902dbff46a01ba7ff51be7..f32f76b514f44a113f813425db52c87f925224ea 100644 (file)
continue;
}
-
-
/* Handle coloring */
$color="";
if($this->parent->sort_by == "TaskID"){
index b87ff78f69b42b48ad469b1bad161d03e55b5b38..d820aa5b8fda87ae75e8830eeb19cac56f70573b 100644 (file)
$this->by_object['workservice']= new workservice($this->config, $this->dn);
$this->by_object['workservice']->inheritTimeServer = false;
$this->by_object['workservice']->parent= &$this;
+ $this->by_object['workservice']->acl = "#all#";
}
if((preg_match("/S/",$objects) || preg_match("/W/",$objects))&&(!isset($this->by_object['workstartup']))){
$this->by_name['workstartup']= _("Startup");
$this->by_object['workstartup']= new workstartup($this->config, $this->dn);
$this->by_object['workstartup']->parent= &$this;
+ $this->by_object['workstartup']->acl = "#all#";
$this->by_name['faiSummary']= _("Summary");
$this->by_object['faiSummary']= new faiSummaryTab($this->config, $this->dn);
$this->by_object['faiSummary']->parent= &$this;
diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc
index 3bd61a220223075da09e684a1a288e4182e5656e..4306494b3bc34f7f262f642c1112a381d6e2fd5a 100644 (file)
$message[]= _("The required field 'Component name' is not set.");
}
+ /* Check if given name is a valid host/dns name */
+ if(!is_dns_name($this->cn) && chkacl ($this->acl, "cn") == ""){
+ $message[] = _("Please specify a valid name for this object.");
+ }
+
/* To check for valid ip*/
if($this->netConfigDNS->ipHostNumber == ""){
$message[]= _("The required field IP address is empty.");
diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc
index a505fa931789b06289433571796226f5417db921..021990c8af199973c958cf2012af98bb50b628c6 100644 (file)
}
}
+ /* Check if given name is a valid host/dns name */
+ if(!is_dns_name($this->cn) && chkacl ($this->acl, "cn") == ""){
+ $message[] = _("Please specify a valid name for this object.");
+ }
+
if ($this->cn == ""){
$message[]= _("The required field 'Phone name' is not set.");
}
diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 55407a07e67f953d82e6de0dc5bc2be5430f3797..ec922b9fe332a9e3c7f4ef0df6cb4ea07ef79c11 100644 (file)
$dn= "cn=".$this->cn.",ou=printers,ou=systems,".$this->base;
/* must: cn */
- if(preg_match("/printer/i",$this->BelongsTo) && (empty($this->cn))){
- $message[]= "The required field 'Printer name' is not set.";
+ if(($this->BelongsTo == "Printer") && (empty($this->cn))){
+ $message[]= _("The required field 'Printer name' is not set.");
+ }
+
+ /* must: cn */
+ if(($this->BelongsTo == "Printer") && !is_dns_name($this->cn)){
+ $message[]= _("Invalid character in printer name.");
}
/* must: labeledURI */
$this->PPDdialogToSave->save_ppd();
}
if($this->orig_dn != $this->dn){
- $this->PPDdialogToSave = new printerPPDDialog($this->config, $this->dn,$this->gotoPrinterPPD);
- $this->PPDdialogToSave->cn = $this->cn;
- $this->PPDdialogToSave->generateProperties();
- $this->PPDdialogToSave->update_ppd_url();
+ if(!empty($this->gotoPrinterPPD)) {
+ $this->PPDdialogToSave = new printerPPDDialog($this->config, $this->dn,$this->gotoPrinterPPD);
+ $this->PPDdialogToSave->cn = $this->cn;
+ $this->PPDdialogToSave->generateProperties();
+ $this->PPDdialogToSave->update_ppd_url();
+ }
}
/* Remove previously selected ppd file.*/
diff --git a/plugins/admin/systems/class_printerPPDDialog.inc b/plugins/admin/systems/class_printerPPDDialog.inc
index 1863d8deb7d8219c50742f42e5377257854297c8..a867c707536aa141e9f7fcce27e0751df96841c9 100644 (file)
function getPrinterReload()
{
if(is_readable($this->pathToPPD)){
- $tmp = $this->ppdManager->getPrinterList(true);
+ $tmp = @$this->ppdManager->getPrinterList(true);
$this->ppdListHeader = $this->ppdList = array();
diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc
index de16b1d526aed09bcf83e9a347c1e8e3b30b2100..cf0eeffd901efacb958eb79d8d49434b31cb3cf0 100644 (file)
$message[]= _("The required field 'Server name' is not set.");
}
+ /* Check if given name is a valid host/dns name */
+ if(!is_dns_name($this->cn) && chkacl ($this->acl, "cn") == ""){
+ $message[] = _("Please specify a valid name for this object.");
+ }
+
if ($this->orig_dn != $this->dn){
$ldap= $this->config->get_ldap_link();
$ldap->cd ($this->base);
diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc
index b0c2e4c679f8f5e49ca0bb6826abd88c7fcc510e..f10770f3e8db4ea045deb068c124e84df28ee11f 100644 (file)
$message[]= _("The required field 'Terminal name' is not set.");
}
+ /* Check if given name is a valid host/dns name */
+ if(!is_dns_name($this->cn) && chkacl ($this->acl, "cn") == ""){
+ $message[] = _("Please specify a valid name for this object.");
+ }
+
if ($this->orig_dn == 'new'){
$ldap= $this->config->get_ldap_link();
$ldap->cd ($this->base);
diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc
index 5b5a58a6c54cd1c54800664159b908cebb789cd3..a19cd8617f9b602fa330ef2b2f250aa00529798c 100644 (file)
$message[]= _("The required field 'Workstation name' is not set.");
}
+ /* Check if given name is a valid host/dns name */
+ if(!is_dns_name($this->cn) && chkacl ($this->acl, "cn") == ""){
+ $message[] = _("Please specify a valid name for this object.");
+ }
+
if ($this->orig_dn != $this->dn){
$ldap= $this->config->get_ldap_link();
$ldap->cd ($this->base);
diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc
index 6e72439f91a8fb50cb3b7cceaf9bed3a8cebf000..4105b26bc8406b8ae0b42113f16901975e833dc9 100644 (file)
}else{
$tmp = $this->getFAIreleases();
foreach($tmp as $release => $data){
- if(isset($rest['RELEASE'][$release])){
+ if(isset($rest['RELEASE'][$release]) && $release == $this->FAIrelease){
$use = $data['USE'];
}
}