summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: efdccc9)
raw | patch | inline | side by side (parent: efdccc9)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 19 Jun 2009 08:47:35 +0000 (08:47 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 19 Jun 2009 08:47:35 +0000 (08:47 +0000) |
-Don't use base64 encoded dns in links and buttons, use IDs.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13737 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13737 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc | patch | blob | history |
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc
index beb0636a359c860b119d44c0f8d01832c0519b0c..9d7fa002156a91d41d51040051b1ffb498a1a5a2 100644 (file)
/* Section storage */
var $dhcpSections= array();
var $dhcpObjectCache= array();
+
+ var $dhcpDNtoID = array();
+
var $current_object= "";
var $types= array();
var $serviceDN= "";
/* Insert new section? */
if (preg_match('/^insertDhcp_.*_x$/', $name)){
- $dn= base64_decode(preg_replace('/^insertDhcp_([^_]+)_x$/', '\1', $name));
+ $id= preg_replace('/^insertDhcp_([^_]+)_x$/', '\1', $name);
+ $dn = $this->dhcpDNtoID[$id];
if (isset($this->dhcpObjectCache[$dn])){
$this->dialog= new dhcpNewSectionDialog($this->objectType($dn));
$this->current_object= $dn;
/* Edit section? */
if (preg_match('/^editDhcp_.*_x$/', $name)){
- $dn= base64_decode(preg_replace('/^editDhcp_([^_]+)_x$/', '\1', $name));
+ $id= preg_replace('/^editDhcp_([^_]+)_x$/', '\1', $name);
+ $dn = $this->dhcpDNtoID[$id];
if (isset($this->dhcpObjectCache[$dn])){
$section= $this->objectType($dn);
$this->current_object= $dn;
/* Remove section? */
if (preg_match('/^delDhcp_.*_x$/', $name)){
- $dn= base64_decode(preg_replace('/^delDhcp_([^_]+)_x$/', '\1', $name));
+ $id= preg_replace('/^delDhcp_([^_]+)_x$/', '\1', $name);
+ $dn = $this->dhcpDNtoID[$id];
if (isset($this->dhcpObjectCache[$dn])){
$this->current_object= $dn;
$this->dialog= 1;
}
if(isset($_GET['act']) && $_GET['act']=="edit" && isset($_GET['id'])){
- $dn = base64_decode($_GET['id']);
+ $id = $_GET['id'];
+ $dn = $this->dhcpDNtoID[$id];
if (isset($this->dhcpObjectCache[$dn])){
$section= $this->objectType($dn);
$this->current_object= $dn;
if(isset($_GET['act']) && $_GET['act']=="edit" && isset($_GET['id'])){
- $dn = base64_decode($_GET['id']);
+ $id = $_GET['id'];
+ $dn = $this->dhcpDNtoID[$id];
if (isset($this->dhcpObjectCache[$dn])){
$section= $this->objectType($dn);
$this->current_object= $dn;
$tmp = new dhcpNewSectionDialog(NULL);
foreach($this->dhcpSections as $section => $values ){
-
- $values = "<a href='?plug=".$_GET['plug']."&act=edit&id=".base64_encode($section)."'>".$values."</a>";
+
+ // Ensure that we've a valid id for this section.
+ if(!in_array($section,$this->dhcpDNtoID)){
+ $this->dhcpDNtoID[] = $section;
+ }
+
+ // Get entry ID
+ $id = array_search($section,$this->dhcpDNtoID);
+
+ $values = "<a href='?plug=".$_GET['plug']."&act=edit&id=".$id."'>".$values."</a>";
if (count($tmp->sectionMap[$this->objectType($section)])){
if ($this->objectType($section) == "dhcpService"){
$DhcpList->AddEntry(array(
array("string" => $values),
- array("string" => str_replace("%s",base64_encode($section),$editImgInsNoDel), "attach" => "style='text-align:right;'")
+ array("string" => str_replace("%s",$id,$editImgInsNoDel), "attach" => "style='text-align:right;'")
));
} else {
$DhcpList->AddEntry(array(
array("string" => $values),
- array("string" => str_replace("%s",base64_encode($section),$editImgIns), "attach" => "style='text-align:right;'")
+ array("string" => str_replace("%s",$id,$editImgIns), "attach" => "style='text-align:right;'")
));
}
} else {
$DhcpList->AddEntry(array(
array("string" => $values),
- array("string" => str_replace("%s",base64_encode($section),$editImg), "attach" => "style='text-align:right;'")
+ array("string" => str_replace("%s",$id,$editImg), "attach" => "style='text-align:right;'")
));
}
}
$this->dhcpSections[$key]= preg_replace('/^[^!]+!(.*)$/', '\\1', $val);
}
+ $this->dhcpDNtoID = array();
+ $this->dhcpDNtoID = array_merge(array_keys($this->dhcpSections),array_keys($this->dhcpObjectCache));
+ $this->dhcpDNtoID = array_unique($this->dhcpDNtoID);
}