diff --git a/modules/com_vtiger_workflow/VTWorkflowUtils.php b/modules/com_vtiger_workflow/VTWorkflowUtils.php index f671da0e2..8da81f93a 100644 --- a/modules/com_vtiger_workflow/VTWorkflowUtils.php +++ b/modules/com_vtiger_workflow/VTWorkflowUtils.php @@ -65,8 +65,12 @@ function loggedInUser() { */ function revertUser() { global $current_user; - if (count(self::$userStack) != 0) { - $current_user = array_pop(self::$userStack); + $userStackCounts = count(self::$userStack); + if ($userStackCounts != 0) { + for ($i=1; $i<$userStackCounts; $i++) { + array_pop(self::$userStack); + } + $current_user = self::$userStack[0]; } else { $current_user = null; }