My favorites | Sign in
Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

/*
MAKING DABR INVITE ONLY

The function below would need to be added to your config.php file
and then you need to play around the with list of allowed users.
*/

function config_log_request() {
// This function is called from menu.php if it exists

// Ignore people that aren't logged in
if (!user_is_authenticated()) return;

// Create a *lowercase* list of allowed users
$allowed_users = array(
'twitter',
'davidcarrington',
'stephenfry',
);
// Or a file-based alternative if you prefer not to keep tampering with config.php:
// $allowed_users = file('../allowed_users.php');

// Check if the current user is in our allowed user list
if (!in_array(strtolower(user_current_username()), $allowed_users)) {
// They're not, kick them out!
user_logout();
die("Sorry, you're not on the list of allowed users for this site.");
}
}

?>
Show details Hide details

Change log

r153 by david.carrington on Aug 19, 2009   Diff
Added information for making a Dabr
install invite only.

Fixes  issue 54 
Go to: 
Sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 921 bytes, 33 lines
Powered by Google Project Hosting