Created
November 27, 2017 12:43
-
-
Save bigprof/b0e5df2b2823391f5f133c4b1ca3ea6b to your computer and use it in GitHub Desktop.
AppGini custom page inside hooks folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Assuming this custom file is placed inside 'hooks' */ | |
define('PREPEND_PATH', '../'); | |
$hooks_dir = dirname(__FILE__); | |
include("{$hooks_dir}/../defaultLang.php"); | |
include("{$hooks_dir}/../language.php"); | |
include("{$hooks_dir}/../lib.php"); | |
include_once("{$hooks_dir}/../header.php"); | |
/* check access */ | |
$mi = getMemberInfo(); | |
// if(!in_array($mi['username'], array('john.doe', 'jane.doe'))){ | |
// if(!$mi['username'] || $mi['username'] == 'guest'){ | |
if(!in_array($mi['group'], array('Admins', 'Data entry'))){ | |
echo error_message("Access denied"); | |
include_once("{$hooks_dir}/../footer.php"); | |
exit; | |
} | |
?> | |
<?php include_once("{$hooks_dir}/../footer.php"); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment