if (isset($_SESSION['url'])) { $url = $_SESSION['url']; } // holds url for last page visited that caused the redirect to the login page echo json_encode(["success" => true, "url" => $url]); // header("content-type:application/json"); // // echo json_encode($user); // // exit(); } else { if ($action == "initEntities") { echo "We are here: enities"; } else { if ($action == "initZeiti") { } else { if ($action == 'Logout') { unset($_SESSION['user']); unset($_SESSION['templateID']); unset($_SESSION['name']); unset($_SESSION['entityname']); print json_encode(['success' => true]); } else { if ($action == "getMines") { $list = $dao->getMines(); json::sendJsonObj($list); } } } } }