News:

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

Main Menu

Check if user is logged in

Started by JF3000, June 15, 2016, 02:38:14 PM

Previous topic - Next topic

JF3000

I am not a programmer so any help is appreciated. How can I add the code to the beginning of this to check if the current user is an Admin before the file is run, if they're not an admin then the file isn't run.

<?php
global $ssi_guest_access;
$ssi_guest_access true;

ini_set("display_errors",1);
// SSI needed to get SMF functions
require('SSI.php');

// For the rss functions
if (isset($smcFunc))
require_once($sourcedir '/Subs-RSS2.php');
else
require_once($sourcedir '/Subs-RSS.php');

UpdateRSSFeedBots();
UpdateJSONFeedBots();
die(
'Feed Cron Finished');
?>


Thank you

yaax

You can add after line with require('SSI.php');
next code:
isAllowedTo('admin_forum');
Free SMF hosting:
http://www.ForumSide.com/

Free OpenCart shop hosting -
http://www.GetFreeShop.com/

Advertisement: