News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Access Restictions Based on Time of Day

Started by Majicc, August 06, 2008, 03:38:20 PM

Previous topic - Next topic

Majicc

I am looking for a way to restrict the access of a certain membergroup outside a set time frame.

I have a set of users who do not need to be accessing the board outside 8am-5pm. Draconian I know but problematic if i cant figure it out.

Does anyone know how I would accomplish this?

I am using the latest version (1.1.5) with the base configuration, nothing added to it.

Many thanks for your assistance.

Nathaniel

Time restrictions sounds like an interesting idea, I can't particularly think of a need for it, but I will have a look into it.

Its the sort of thing that you could ask for as a mod request. ;)
http://www.simplemachines.org/community/index.php?board=79.0
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

[SiNaN]

Sounds good.

../Sources/Load.php

Find:

?>

Replace:

function check_board_time()
{
global $board, $modSettings;

if(allowedTo('moderate_forum') || empty($board));
return true;

$time =  (int) date("H");

if($context['user']['is_logged'])
$time = $time + (int) $user_info['time_offset'];
else
$time = $time + (int) $modSettings['time_offset'];

if($time > 23)
$time = $time - 24;

if($time > 8 && $time < 17 & $board == 'BOARD_ID')
fatal_error('You can\'t see this board at this time.');
}

?>


../index.php

Find:

loadPermissions();

Replace:

loadPermissions();

// What time is it?
check_board_time();


Change 'BOARD_ID' as the ID of the board to be restricted.
Former SMF Core Developer | My Mods | SimplePortal

Advertisement: