Skip to content
Snippets Groups Projects
Commit f3984372 authored by Brett Bieber's avatar Brett Bieber
Browse files

Require the user to log in before submitting NUIDs

parent 032c85a7
No related branches found
No related tags found
No related merge requests found
...@@ -2,15 +2,28 @@ ...@@ -2,15 +2,28 @@
require_once 'config.inc.php'; require_once 'config.inc.php';
if (!isset($_FILES, $_FILES['userfile'])) { $auth = UNL_Auth::factory('SimpleCAS');
echo '
<h1>Upload a file containing NUIDs</h1> if (isset($_GET['logout'])) {
$auth->logout();
}
if (!$auth->isLoggedIn()) {
echo "You must log in first";
$auth->login();
exit;
}
echo '<h1>Upload a file containing NUIDs</h1>
<form action="" method="post" enctype="multipart/form-data"> <form action="" method="post" enctype="multipart/form-data">
File <input type="file" name="userfile" /> File <input type="file" name="userfile" />
<input type="submit" name="submit" /> <input type="submit" name="submit" />
</form> </form>
'; <a href="?logout">Logout</a>';
exit;
if (!isset($_FILES, $_FILES['userfile'])) {
echo 'Upload a file';
exit();
} }
if (!($contents = file($_FILES['userfile']['tmp_name']))) { if (!($contents = file($_FILES['userfile']['tmp_name']))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment