/** * Push the admin user on to the user stack * and make it the $current_user * */ function adminUser() { $user = Users::getActiveAdminUser(); global $current_user; if (empty(self::$userStack) || count(self::$userStack) == 0) { self::$loggedInUser = $current_user; } array_push(self::$userStack, $current_user); $current_user = $user; return $user; }