if (isset($_POST["Dev" . $i . "Btn"])) { handleSwitch($i, 'kart' . $i . 'Text'); } } if (isset($_POST["newBtn"])) { //echo ("new session: <br/>\n\n"); // cleanup the session data cleanupSession(-1); /* To clean up all session ids */ // store the config file_put_contents('data_session.php', '<?php return ' . var_export(serialize($kart_session_data), true) . '; ?>', LOCK_EX); } /* This will clear everything */ if (isset($_POST["clearAllBtn"])) { // cleanup the session data cleanupSession(-1); /* To clean up all session ids */ $GlobalData = new globalData($GlobalData->serverName, $GlobalData->serverIp, $GlobalData->serverPort); // store the config file_put_contents('data_session.php', '<?php return ' . var_export(serialize($kart_session_data), true) . '; ?>', LOCK_EX); file_put_contents('data_config.php', '<?php return ' . var_export(serialize($GlobalData), true) . '; ?>', LOCK_EX); } if (isset($_POST["editBtn"])) { //cannot change server details if session started if ($GlobalData->isStarted() === FALSE) { if ($GlobalData->inEdit != TRUE) { $GlobalData->inEdit = TRUE; } else { /* This is submit */ $GlobalData->updateServer("Server" != $_POST['serverName'] ? $_POST['serverName'] : "", "Ip" != $_POST['serverIp'] ? $_POST['serverIp'] : "", "Port" != $_POST['serverPort'] ? $_POST['serverPort'] : ""); $GlobalData->inEdit = FALSE;
} else { if (isset($_POST["stopBtn"])) { //echo ("StopBtn: " . $kart_drv_name['DEV1'] . "<br/>\n\n"); // Send Start command if (FALSE == sendHttpRequest("STOP:ALL:")) { echo "Failed to send STOP request <br>"; return FALSE; } $Started = False; $kart_drv_name['STARTED'] = false; file_put_contents('config.php', '<?php return ' . var_export($kart_drv_name, true) . ';'); } else { if (isset($_POST["newBtn"]) && $Started == False) { //echo ("new session: <br/>\n\n"); // cleanup the session data cleanupSession(); // Clear the driver names foreach ($kart_drv_name as $key => $val) { if ($key == 'SRV_NAME' || $key == 'SRV_IP' || $key == 'SRV_PORT' || $key == 'STARTED') { continue; } $kart_drv_name[$key] = $defaultName; } $kart_drv_name['STARTED'] = false; // store the config file_put_contents('config.php', '<?php return ' . var_export($kart_drv_name, true) . ';'); } } } ?>
} else { $new_history[0] = $current_page; if ($new_history[0] != $history[0]) { $history = array_merge($new_history, $history); } } while (count($history) > 5) { array_pop($history); } } if (isset($history[0]['parameter']['download'])) { unset($history[0]['parameter']['download']); } unset($current_page); $session->setValue('history', $history); cleanupSession($session, $environment); unset($history); // kann sich die session nicht selbst speichern ??? $session_manager = $environment->getSessionManager(); $session_manager->update($session); unset($session_manager); } elseif ($environment->getCurrentModule() == 'agb' and $environment->getCurrentFunction() == 'index') { $session_manager = $environment->getSessionManager(); $session_manager->save($session); unset($session_manager); } /*********** LOGGING ***********/ // Log information to database. If this part is changed, change it in page material_getfile.php, too! include_once 'include/inc_log.php'; /*********** ROOM ACTIVITY ***********/ $activity_points = 1;