// Filter for solving task given task
function FILTER_SOLVE_TASK ($data) {
// Don't solve anything if no admin!
- if (!isAdmin()) return $data;
+ if (!isAdmin()) {
+ return $data;
+ } // END - if
// Is this a direct task id or array element task_id is found?
if (is_int($data)) {
// Function to update task data
function adminUpdateTaskData ($id, $row, $data) {
- // Should be admin!
+ // Should be admin and valid id
if (!isAdmin()) {
// Not an admin so redirect better
- redirectToUrl('modules.php?module=index');
- } // END - if
-
- // Is the id not set, then we need a backtrace here... :(
- if ($id <= 0) {
+ debug_report_bug(__FUNCTION__, __LINE__, 'id=' . $id . ',row=' . $row . ',data=' . $data . ' - isAdmin()=false');
+ } elseif ($id <= 0) {
// Initiate backtrace
debug_report_bug(__FUNCTION__, __LINE__, sprintf("id is invalid: %s. row=%s, data=%s",
$id,
$GLOBALS['nav_depth'] = '0';
// Run the post-filter chain
- $ret = runFilterChain('post_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => ''));
+ $ret = runFilterChain('post_youhere_line', array('access_level' => $accessLevel, 'type' => $type, 'content' => $OUT));
- // Add additional content
- $OUT .= $ret['content'];
+ // Get content from filter back
+ $OUT = $ret['content'];
} // END - if
} // END - if
function addMenu ($mode, $action, $what) {
// Init some variables
$main_cnt = '0';
- $ADD = '';
// is the menu action valid?
if (!isMenuActionValid($mode, $action, $what, true)) {
} // END - if
// Non-admin shall not see all menus
- if (!isAdmin()) {
- $ADD = " AND `visible`='Y' AND `locked`='N'";
+ $ADD = " AND `visible`='Y' AND `locked`='N'";
+ if (isAdmin()) {
+ // Is admin, so make all visible
+ $ADD = '';
} // END - if
// Load SQL data and add the menu to the output stream...