get("user", array("name" => $_SESSION['username'])); // Determine if user exists, so we can add him/her as creator of the new survey if (count($creator_results) > 0) { $creator = $creator_results[0]; $newSurvey = new Survey(null, "New survey", "Default description", $creator, null); $dbi->set($newSurvey); } else { die("No user with that uid found!"); } // Optional part, for when the session needs to be set in pipelineEditor // For now, store in local copy, only upload local copy to db when needed (page change, etc...) if (isset($_SESSION['localSessionCopy']) && !empty($_SESSION['localSessionCopy'])) { $session = $_SESSION['localSessionCopy']; $session->pipeline[] = $newSurvey; $_SESSION['localSessionCopy'] = $session; } redirect("pipelineEditor.php"); ?>