<?php require_once __DIR__ . '/../bootstrap.php'; session_start(); signOut(); header("Location: ../index.php?message=Signed+out+successfully"); exit;
$eventData->user_id = $currentUser->id; $eventData->project_id = $project->id(); $eventData->project_name = $project->get('pro_tit'); $events = FAnalytics::getInstance(); $events->trackEvent('Proyecto', 'Proyectos subidos', json_encode($eventData)); } // Delete cookie $app->getResponse()->removeCookie('guest_project'); } } $app->redirect($app->getHelper('UrlHelper')->getUrl($login)); } } } if ($section_name == "signOut") { $salir = signOut(); } $session = validaSession(); $currentUser = getCurrentUser(); $loggedUser = getUserInfo($user->id); $defaultLogoLink = $currentUser ? 'perfil' : 'home'; $defaultLogoLink = FConfig::getUrl($defaultLogoLink); $notList = array(); if ($currentUser) { //NOTIFICACIONES // $not = listAll("notificaciones"," WHERE user_id = $currentUser->id AND leido = 'N' ORDER BY cdate DESC"); // while($rs_not = mysql_fetch_object($not)){ // $notList[] = $rs_not; // } $notList = Notification::getUserNotifications($currentUser->id); }
function memberCTL($func) { if ($func == 100) { $login['id'] = isset($_POST['id']) ? $_POST['id'] : null; if ($login['id']) { $login['password'] = isset($_POST['password']) ? $_POST['password'] : null; $stmt = login($login); //echo $stmt."<Br>"; switch ($stmt) { case 0: /* 0 -> success * 1 -> dupli * -1 -> logged-in */ $check_login = logged_in($login['id']); switch ($check_login) { case 0: $message = "Welcome " . $login['id']; $status = userStatus($login['id']); $_SESSION['login_id'] = $login['id']; $_SESSION['status'] = $status['status']; //print_r($_SESSION['status']); $func = null; break; case -1: case 1: $message = "Plz Log-out from other"; $func = null; break; } //$_SESSION['message'] = $message; break; case 1: $message = "Plz Check Your Password"; $func = 100; break; case -1: $message = "Plz Check Your ID"; $func = 100; break; } echo pop_message($message); } echo redirect_to_view($func, $_REQUEST['page'], $_REQUEST['key']); } elseif ($func == 101) { signOut($_SESSION['login_id']); $message = "안녕히 가세유"; $func = null; echo pop_message($message); //echo $func."<br>".$message."<Br>"; session_destroy(); echo redirect_to_view($func, $_REQUEST['page'], $_REQUEST['key']); } elseif ($func == 110) { $memInfo['id'] = isset($_POST['id']) ? $_POST['id'] : null; if ($memInfo['id']) { $memInfo['password'] = isset($_POST['password']) ? $_POST['password'] : null; $memInfo['nick'] = isset($_POST['nick']) ? $_POST['nick'] : null; $memInfo['mail'] = isset($_POST['mail']) ? $_POST['mail'] : null; $stmt = add_user($memInfo); //echo $stmt; switch ($stmt) { case true: $message = "SignUp Complete"; $func = 100; break; case false: $message = "SignUp Failed"; $func = 110; break; } echo pop_message($message); } echo redirect_to_view($func, $_REQUEST['page'], $_REQUEST['key']); } }
fancydie("Couldn't connect to the database. Reason: " . mysqli_connect_error()); } $user = urldecode($_GET['user']); $result = mysqli_query($con, "SELECT * FROM students WHERE fullname = '{$user}'"); $row = mysqli_fetch_array($result); $ID = $row['id']; $active = $row['active']; $totaltime = $row['totaltime']; $name = $row['name']; if (isset($_POST['action'])) { switch ($_POST['action']) { case 'login': signIn($ID); die; case 'logout': signOut($ID); die; case 'flogout': select(); die; default: die; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<?php include "../universal/config.php"; //---sendValidation---// if (isset($_POST["sendValidation"])) { include "sendValidation.php"; $result = sendValidation($_POST["email"]); echo $result; } elseif (isset($_POST["signUp"])) { include "signUp.php"; $result = signUp($_POST["key"], $_POST["email"], $_POST["username"], $_POST["password"]); echo $result; } elseif (isset($_POST["signIn"])) { include "signIn.php"; $result = signIn($_POST["email"], $_POST["password"], $_POST["remember"]); echo $result; } elseif (isset($_POST["resetValidation"])) { include "resetValidation.php"; $result = resetValidation($_POST["email"]); echo $result; } elseif (isset($_POST["resetPassword"])) { include "resetPassword.php"; $result = resetPassword($_POST["key"], $_POST["email"], $_POST["password"]); echo $result; } elseif (isset($_POST["signOut"])) { include "signOut.php"; $result = signOut(); echo $result; }