root/dev/common/includes/class.session.php @ 190

Revision 190, 0.6 KB (checked in by exi, 16 years ago)

This is a big update...
Moved all admin scripts to common/admin.
Moved all includes and classes to common/includes.
Edited all include-paths to reflect the movement.
Fixed a bug with the session system allowing every registered user to access admin pages.
Replaced calls to date() to use a wrapper so gmdate can be used.
Replaced some calls to $config with calls to the static object.
Fixed a big which caused the portrait_grab to not download a new picute.
Added a classified-state to kills.
Removed the sync_server server script in this tree.
Added code to help modules find the includes to index.php.

Line 
1<?php
2
3class Session
4{
5    function init()
6    {
7        if (isset($_REQUEST[session_name()]))
8        {
9            session_start();
10            if (isset($_SESSION['user']))
11            {
12                user::loggedin(true);
13            }
14        }
15    }
16
17    function isAdmin()
18    {
19        return (bool)$_SESSION['admin'];
20    }
21
22    function isSuperAdmin()
23    {
24        return (bool)$_SESSION['admin_super'];
25    }
26
27    function create($admin = false)
28    {
29        session_start();
30        $_SESSION['admin'] = $admin;
31    }
32
33    function destroy()
34    {
35        session_destroy();
36    }
37}
38?>
Note: See TracBrowser for help on using the browser.