Do better call debug_report_bug() if something bad happened
authorRoland Häder <roland@mxchange.org>
Mon, 18 Jul 2011 13:58:04 +0000 (13:58 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 18 Jul 2011 13:58:04 +0000 (13:58 +0000)
inc/filters.php
inc/modules/admin/admin-inc.php
inc/mysql-manager.php

index 881eb57395f1b1bd2d476de9c437f4b423dec756..34574e46a599b1ca839a33a326f3610cc14ee2f8 100644 (file)
@@ -180,7 +180,9 @@ function FILTER_AUTO_ACTIVATE_EXTENSION ($data) {
 // 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)) {
index b7537c8b604212d74f8b9bc9236c88aa6f78b9d0..1f5d396740a8bd49873888355cab8c201fb1feca 100644 (file)
@@ -1368,14 +1368,11 @@ function adminDeleteTask ($id) {
 
 // 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,
index 48db0063ba2e835b4f1430f1cc3080cb469e0fd5..f38e7aec5dae6d6ebb8d025f968a736cc9141ba8 100644 (file)
@@ -163,10 +163,10 @@ function addYouAreHereLink ($accessLevel, $FQFN, $return = false) {
                        $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
 
@@ -184,7 +184,6 @@ function addYouAreHereLink ($accessLevel, $FQFN, $return = false) {
 function addMenu ($mode, $action, $what) {
        // Init some variables
        $main_cnt = '0';
-       $ADD = '';
 
        // is the menu action valid?
        if (!isMenuActionValid($mode, $action, $what, true)) {
@@ -192,8 +191,10 @@ function addMenu ($mode, $action, $what) {
        } // 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...