Skip to content

Commit

Permalink
fix inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
janul committed Nov 18, 2014
1 parent 0440b46 commit 9b5181e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions application/controllers/Arp.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,17 @@ public function format2($idp_entityid, $m = null)
$keyprefix = getCachePrefix();
$this->load->driver('cache', array('adapter' => 'memcached', 'key_prefix' => $keyprefix));

$inherit = $this->config->item('arpbyinherit');

if(is_null($inherit) || $inherit !== FALSE)
$inheritConf = $this->config->item('arpbyinherit');
if(is_null($inheritConf) || $inheritConf !== FALSE)
{
$inherit = TRUE;
}
else
{
$inherit = FALSE;
}

if($inherit)
{
$cacheid = 'arp2_' . $idp->getId();
}
Expand All @@ -94,13 +102,13 @@ public function format2($idp_entityid, $m = null)
$arpcached = $this->cache->get($cacheid);
if (empty($arpcached)) {
log_message('debug', 'not found in memcache');
if(empty($inherit))
if($inherit)
{
$data['out'] = $this->generateXml($idp,FALSE);
$data['out'] = $this->generateXml($idp,TRUE);
}
else
{
$data['out'] = $this->generateXml($idp,TRUE);
$data['out'] = $this->generateXml($idp,FALSE);
}
if (!empty($data['out'])) {
$this->cache->save($cacheid, $data['out'], 2400);
Expand Down

0 comments on commit 9b5181e

Please sign in to comment.