Commit e1b87d69 authored by Côme Chilliet's avatar Côme Chilliet Committed by Benoit Mortier
Browse files

Avoid PHP errors when loading a dn from management class

Conflicts:
	include/class_management.inc
Showing with 12 additions and 10 deletions
+12 -10
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
</div> </div>
<div class="contentboxb"> <div class="contentboxb">
{foreach from=$objectFilters item="ofilter"} {if isset($objectFilters)}
{${$ofilter.id}}<label for="{$ofilter.id}">&nbsp;{$ofilter.label}</label><br/> {foreach from=$objectFilters item="ofilter"}
{/foreach} {${$ofilter.id}}<label for="{$ofilter.id}">&nbsp;{$ofilter.label}</label><br/>
{/foreach}
{/if}
<hr/> <hr/>
{$SCOPE} {$SCOPE}
......
...@@ -1218,6 +1218,8 @@ class listing ...@@ -1218,6 +1218,8 @@ class listing
*/ */
function getAction() function getAction()
{ {
global $config;
// Do not do anything if this is not our PID, or there's even no PID available... // Do not do anything if this is not our PID, or there's even no PID available...
if (!isset($_REQUEST['dn']) && (!isset($_REQUEST['PID']) || $_REQUEST['PID'] != $this->pid)) { if (!isset($_REQUEST['dn']) && (!isset($_REQUEST['PID']) || $_REQUEST['PID'] != $this->pid)) {
return; return;
...@@ -1241,6 +1243,11 @@ class listing ...@@ -1241,6 +1243,11 @@ class listing
$result['targets'][] = $this->entries[$target]['dn']; $result['targets'][] = $this->entries[$target]['dn'];
} }
} elseif (isset($_REQUEST['dn']) && preg_match('/^listing_([a-zA-Z_]+)$/', $key, $m)) { } elseif (isset($_REQUEST['dn']) && preg_match('/^listing_([a-zA-Z_]+)$/', $key, $m)) {
/* Pre-render list to init things if a dn is gonna be opened on first load */
$this->setBase($config->current['BASE']);
$this->filter->setCurrentScope('sub');
$this->update();
$this->render();
$dn = urldecode($_REQUEST['dn']); $dn = urldecode($_REQUEST['dn']);
$result['action'] = $m[1]; $result['action'] = $m[1];
$result['targets'][] = $dn; $result['targets'][] = $dn;
......
...@@ -167,13 +167,6 @@ class management ...@@ -167,13 +167,6 @@ class management
} }
} }
// Pre-render list to init things if a dn is gonna be opened on first load
if (isset($_REQUEST['dn'])) {
$this->headpage->setBase($config->current['BASE']);
$this->headpage->filter->setCurrentScope('sub');
$this->renderList();
}
// Handle actions (POSTs and GETs) // Handle actions (POSTs and GETs)
$str = $this->handleActions($this->detectPostActions()); $str = $this->handleActions($this->detectPostActions());
if ($str) { if ($str) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment