Skip to content

Instantly share code, notes, and snippets.

@bigprof
Created November 27, 2017 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bigprof/b0e5df2b2823391f5f133c4b1ca3ea6b to your computer and use it in GitHub Desktop.
Save bigprof/b0e5df2b2823391f5f133c4b1ca3ea6b to your computer and use it in GitHub Desktop.
AppGini custom page inside hooks folder
<?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