예제 #1
0
function requireSignin($bool)
{
    if ($bool && !isSignin()) {
        header("Location: sign_in_form.php?message=require signined");
        die;
    }
}
예제 #2
0
파일: event2.php 프로젝트: dhacks/team-e
<?php

require_once 'init.php';
if (!isSignin()) {
    $signin_url = 'signin.php';
    header("Location: {$signin_url}");
    exit;
}
$user_id = $_SESSION['user_id'];
//error_log("user id debug output" . $user_id, 4);
$db = connectDb();
$place = 0;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (isset($_POST['place'])) {
        $place = $_POST['place'];
    }
}
$user_data = getUserData($db, $user_id);
$user_name = $user_data["user_name"];
$user_id = $user_data["id"];
$event_data = getEventData($db, $user_id);
$event_name = $event_data["event_name"];
$event_content = $event_data["content"];
$lastEvent = getLastEvent($db, $user_id);
$leName = "イベントがありません";
$last = "イベントがありません";
$lastId = $lastEvent["user_id"];
$lastEId = $lastEvent["id"];
if ($lastId == $user_id) {
    $last = $lastEvent["content"];
    $leName = $lastEvent["event_name"];
예제 #3
0
파일: signin.php 프로젝트: g-hyoga/textbook
<?php

// signin.php
// PHP部分はここに書きます
require_once 'init.php';
if (isSignin()) {
    $index_url = 'index.php';
    header("Location: {$index_url}");
    exit;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    session_regenerate_id(true);
    $error = '';
    $email = $_POST['email'];
    $password = $_POST['password'];
    $db = connectDb();
    if (!($user_id = getUserId($email, $password, $db))) {
        $error = 'パスワードとメールアドレスが正しくありません';
    } else {
        if (empty($error)) {
            $_SESSION['user_id'] = $user_id;
            $index_url = 'index.php';
            header("Location: {$index_url}");
            exit;
        }
    }
}
?>


<!DOCTYPE html>