]> git.datanom.net - webcal.git/blob - user_validate.php
Initial upload
[webcal.git] / user_validate.php
1 <?php
2 /* $Id$ */
3 require_once 'config.inc.php';
4 require_once 'user_settings.inc.php';
5 require_once 'helper.php';
6
7 function valid_user() {
8 if (! isset($_SESSION['authenticate']) ||
9 ! is_object($_SESSION['authenticate'])) {
10 header('Location: ' . WEB_ROOT . 'login.php');
11 exit();
12 }
13
14 $auth = $_SESSION['authenticate'];
15 if (! $auth->validUser()) {
16 header('Location: ' . WEB_ROOT . 'login.php');
17 exit();
18 }
19 }
20
21 function has_admin_role() {
22 if (! isset($_SESSION['user_settings']) ||
23 ! is_object($_SESSION['user_settings'])) {
24 return false;
25 }
26 return ($_SESSION['user_settings']->getRole() == 0);
27 }
28
This page took 0.057423 seconds and 6 git commands to generate.