[ticket/324] Do not load module if column is disabled

This commit is contained in:
Marc Alexander
2014-07-30 12:18:50 +02:00
parent c5020a7608
commit c408f8b9c6

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
*