root/releases/0.1.1b/units/users/library.php

Revision 2, 0.6 kB (checked in by sven, 3 years ago)

importing elgg-0.1.1a

Line 
1 <?php
2
3     // User-related functions
4     
5     // Get current access level
6     
7         function accesslevel($owner = -1) {
8             
9             $currentaccess = 0;
10
11     // For now, there are three access levels: 0 (logged out), 1 (logged in) and 1000 (me)
12
13             if (logged_on == 1) {
14                 $currentaccess++;
15             }
16             
17             if ($_SESSION['userid'] == $owner) {
18                 $currentaccess += 1000;
19             }
20             
21             return $currentaccess;
22             
23         }
24     
25     // Protect users to a certain access level
26     
27         function protect($level, $owner = -1) {
28         
29             if (accesslevel($owner) < $level) {
30                 run("access_denied");
31
32                 // run("display:bottomofpage");
33                 exit();
34             }
35             
36         }
37
38 ?>
Note: See TracBrowser for help on using the browser.