diff --git a/config.sample.php b/config.sample.php index 610711167212cd56897a5a0d15a9ba6cf421feed..3e5a7b0f1db8cd46088bf438c6ae9d280bab6b0c 100644 --- a/config.sample.php +++ b/config.sample.php @@ -4,6 +4,7 @@ $options = array(); $options['bind_dn'] = 'uid=youruseridhere,ou=service,dc=unl,dc=edu'; $options['bind_password'] = 'passwordhere'; +$authorized_users = array('hhusker0'); function autoload($class) { @@ -17,4 +18,4 @@ spl_autoload_register("autoload"); ini_set('display_errors', true); error_reporting(E_ALL); -set_include_path(dirname(__FILE__).'/vendor/php'); \ No newline at end of file +set_include_path(dirname(__FILE__).'/vendor/php'); diff --git a/index.php b/index.php index 6efbb977b9dcab2c02a01838774e5c52ccf9682c..e77ba5cb4f6c94c11ed36df252adbf3377dee5fc 100644 --- a/index.php +++ b/index.php @@ -14,6 +14,12 @@ if (!$auth->isLoggedIn()) { exit; } +if (empty($authorized_users) + || !in_array($auth->getUser(), $authorized_users)) { + echo 'You are not authorized to use this tool. Contact the UNL Identity Management Team.'; + exit; +} + echo '<h1>Upload a file containing NUIDs or My.UNL Usernames</h1> <form action="" method="post" enctype="multipart/form-data"> File <input type="file" name="userfile" />