Show sourcecode

The following files exists in this folder. Click to view.

webbutv3/word-app/util/

db_connect.php
dict.xml
practice.php
user.php
util.php

user.php

19 lines ASCII Windows (CRLF)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

function user_id()
{
    return 
$_SESSION["userId"];
}

function 
logged_in()
{
    return isset(
$_SESSION["userId"]) && $_SESSION["userId"] != null;
}

function 
login_guard()
{
    if (!
logged_in()) {
        
header("Location: " path_to_url(BASE_PATH "/login.php"));
        die();
    }
}