Merge pull request #325 from marc1706/ticket/324

[ticket/324] Do not load module if column is disabled
This commit is contained in:
Marc Alexander
2014-07-30 13:23:01 +02:00

View File

@@ -139,6 +139,12 @@ class helper
return false;
}
// Check if module shouldn't be loaded
if ($this->check_column_disabled($row))
{
return false;
}
/**
* Check for permissions before loading anything
* the default group of a user always defines his/her permission
@@ -146,6 +152,18 @@ class helper
return ($this->check_group_access($row)) ? $module : false;
}
/**
* Check if column is disabled
*
* @param array $row Module database row
*
* @return bool False if column is not disabled, true if it is
*/
protected function check_column_disabled($row)
{
return ($this->config['board3_left_column'] === false && column_num_string($row['module_column']) === 'left') || ($this->config['board3_right_column'] === false && column_num_string($row['module_column']) === 'right');
}
/**
* Check if user is in required groups
*