function resetSession() { global $conceptTableInfo; if ($conceptTableInfo['SESSION']) { deleteSession($_SESSION['sessionAtom']); } }
<?php include $_SERVER["DOCUMENT_ROOT"] . 'Tam-An-Food-Store-Manager/' . 'config.php'; require_once FUNCTION_PATH . "general_function.php"; deleteSession(); redirect_to(CONFIG_PATH('public_HTML') . "login/");
* 3) Inserisco le nuove */ foreach ($sesOrders as $o) { if ($o == 0) { continue; } //Salto la "vuota" if ($o <= $_REQUEST['d_ToNumSession'] && array_key_exists($o, $oldSession)) { $x = updateSession($_SESSION['TourId'], $o, 'Q', $oldSession[$o]["Name"], $_REQUEST['d_ToTar_' . $o], $_REQUEST['d_ToAth_' . $o], $oldSession[$o]["First"], 0, false); } else { if ($o <= $_REQUEST['d_ToNumSession'] && !array_key_exists($o, $oldSession)) { if (isset($_REQUEST['d_ToTar_' . $o]) && isset($_REQUEST['d_ToAth_' . $o])) { $x = insertSession($_SESSION['TourId'], $o, 'Q', '', $_REQUEST['d_ToTar_' . $o], $_REQUEST['d_ToAth_' . $o], 1, 0); } } else { deleteSession($_SESSION['TourId'], $o, 'Q'); } } } } } else { foreach ($sesOrders as $o) { if ($o == 0) { continue; } $Arr_Values2Check_ManSessions['d_ToTar_' . $o] = array('Func' => 'GoodNumTarget', 'Error' => true); $Arr_Values2Check_ManSessions['d_ToAth_' . $o] = array('Func' => 'GoodNumAth', 'Error' => true); } } } }
<?php $file = '../jsonDB/admins.json'; $sessions = '../jsonDB/sessions.json'; $method = ''; if (isset($_POST['method'])) { $method = $_POST['method']; } if ($method == 'saveAdmin') { saveAdmin($file); } else { if ($method == 'saveSession') { saveSession($sessions); } else { if ($method == 'deleteSession') { deleteSession($sessions); } } } function saveAdmin($file) { $eventJSON = filter_input(INPUT_POST, 'json'); file_put_contents($file, $eventJSON); $responseArray['status'] = 'success'; echo json_encode($responseArray); } function saveSession($file) { $data = filter_input(INPUT_POST, 'data'); $jsonInPHP = json_decode(file_get_contents($file)); array_push($jsonInPHP->sessions, $data);
<?php require_once 'functions.php'; // log out if (isset($_GET['link'])) { $link = $_GET['link']; deleteSession($link); } ?> <header> <a href="index.php" class="logo">Online newspaper</a> <nav> <ul> <li><a href="index.php">Front page</a></li> <li><a href="dashboard.php">Dashboard</a></li> <li><a href="upload.php">Upload article</a></li> <li><a href="edit_profile.php">Profile</a></li> <li><a href="?link=1">Log out</a></li> </ul> </nav> </header>
} } } else { $msg = '_error_'; } } } else { $msg = '_error_'; } } else { $msg = '_error_'; } } elseif ($command == 'DEL') { $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null; $idParts = explode('_', $id); $x = deleteSession($_SESSION['TourId'], $idParts[0], $idParts[1]); if ($x !== true) { $msg = $x; } } //exit; // per resettare la post if ($msg == '') { header('Location: ./ManSessions.php'); exit; } } // combo sessioni $comboSessionsTypes = '<select id="d_SesType" name="d_SesType">' . "\n"; foreach ($sessionsTypes as $k => $v) { $toAdd = true;
$app->get('/api/updateSession', function ($property, $value) use($dbh) { $result = updateSession(); echo json_encode($result); }); /* Danny Rizzuto deleteSession Delete the current Session Error Codes: 0 = session deleted 1 = session not deleted Complete */ $app->get('/api/deleteSession', function () { $result = deleteSession(); echo json_encode($result); }); /* Danny Rizzuto loginUser Check to see if user can login Error Codes: 0 = login user 1 = user username/password incorrect 2 = statement did not execute 3 = user already logged in Returns username userType userID
header("Content-Type: application/nxs"); header("Content-Disposition: attachment; filename={$fileName}"); header("Expires: 0"); header("Pragma: no-cache"); } include "CreateSession.php"; $choose = explode(",", $_POST['sessID']); $k = "resolution-" . $choose[1]; $f = "link-" . $choose[1]; CreateSessionFile3_0($_POST['sessID'], $_POST[$k], $_POST[$f]); exit; } include "Messages.php"; include "includes/Top.php"; if (isset($_POST['operation']) && $_POST['operation'] == "delete") { deleteSession($_POST['sessID']); } ?> <center> <!--[if IE 6]> <script type="text/javascript"> function calcWidth() { document.getElementById('min_width').style.width = (document.body.clientWidth < 901 ? '900px' : '100%') } onresize = calcWidth; </script> <![endif]--> <? include("includes/Toolbar.php");?> <div id="min_width"> <form action="<?php echo $_SERVER['PHP_SELF'];
if ($result) { return $result->fetch_assoc()["username"]; } else { return ""; } } /*Slim*/ require 'Slim/Slim.php'; \Slim\Slim::registerAutoloader(); $app = new \Slim\Slim(); $app->get('/', function () { }); $app->post('/', function () use($app) { global $header, $footer; //get hidden value sessionID $sid = $app->request->post('sessionid'); $mid = getMemberId($sid); if ($mid >= 0) { //sessionID does exist deleteSession($sid); $username = getUsername($mid); $acceptedPage = "<img src=\"http://adorablekittens.com/wp-content/uploads/2015/07/cat-waving-goodbye-480x320.jpg\" \n\t\t\t\tclass=\"img-rounded img-responsive center-block\" width=\"300\"></br>\n\t\t\t <h2 class=\"text-center\">Ohhh :( Why did you have to leave so soon dear <b>{$username}</b>? I'll miss you!</h2></br></br></br>\n\t\t\t <form action=\"login.html\"> \n\t\t\t\t<button class=\"btn btn-lg btn-primary center-block\" type=\"submit\">Return to login page</button>\n\t\t\t </form>\n\t\t\t"; echo $header . $acceptedPage . $footer; } else { $refusedPage = "<img src=\"https://c1.staticflickr.com/3/2269/2152561318_1ca35956f9.jpg\" \n\t\t\tclass=\"img-circle img-responsive center-block\"></br>\n\t\t\t <h2 class=\"text-center\">Unfortunately you were an <b>invalid</b> user! For shame brother, for shame!</h2></br></br></br>\n\t\t\t <form action=\"login.html\"> \n\t\t\t\t<button class=\"btn btn-lg btn-primary center-block\" type=\"submit\">Return to login page</button>\n\t\t\t </form>\n\t\t\t"; echo $header . $refusedPage . $footer; } }); $app->run(); //close db connection $conn->close();
function deleteAllSessions() { $setting = loadAllSession(); while (list($key, $val) = @each($setting)) { deleteSession($key); } return true; }
$post_data = json_encode(array('error' => $post_data), JSON_FORCE_OBJECT); echo $post_data; } break; case 'get_enrolled_students': if (isset($_GET['token']) && $_GET['token'] != "" && isset($_GET['course_id']) && $_GET['course_id'] != "") { getEnrolledStudents($conn, $_GET['token'], $_GET['course_id']); } else { $post_data = array('message' => 'missing parameters', 'comment' => 'require param [token,course_id]'); $post_data = json_encode(array('error' => $post_data), JSON_FORCE_OBJECT); echo $post_data; } break; case 'delete_session': if (isset($_GET['user_name']) && $_GET['user_name'] != "" && isset($_GET['password']) && $_GET['password'] != "" && isset($_GET['session_id']) && $_GET['session_id'] != "") { deleteSession($conn, $_GET['user_name'], $_GET['password'], $_GET['session_id']); } else { $post_data = array('message' => 'missing parameters', 'comment' => 'require param [user_name,password,session_id]'); $post_data = json_encode(array('error' => $post_data), JSON_FORCE_OBJECT); echo $post_data; } break; case 'get_attendance_type': if (isset($_GET['course_id']) && $_GET['course_id'] != "") { getAttendanceType($conn, $_GET['course_id']); } else { $post_data = array('message' => 'missing parameters', 'comment' => 'require param [course_id]'); $post_data = json_encode(array('error' => $post_data), JSON_FORCE_OBJECT); echo $post_data; } break;