' , 'addUser(true);' , ''; }else if ($_POST['email'] != "") { //Login $id = login($_POST['email'], $_POST['password']); if ($id != -1) { $_SESSION['user'] = $id; $_SESSION['admin'] = getAdmin($id); } else $_SESSION['error'] = 1; } // Add guest-user if ($_POST['gemail'] != "") { if (!get_magic_quotes_gpc()) { $fname = addslashes($_POST['fname']); $lname = addslashes($_POST['lname']); $email = addslashes($_POST['gemail']); $newuser = getUser('Email', $email); } else { $fname = ($_POST['fname']); $lname = ($_POST['lname']); $email = ($_POST['gemail']); $newuser = getUser('Email', $email); } if ($newuser) { $regfail=1; } else { $regfail="0"; $chars = "abcdefghijkmnopqrstuvwxyz023456789"; srand((double)microtime()*1000000); $i = 0; $randpass = '' ; while ($i <= 7) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $randpass = $randpass.$tmp; $i++; } $worked = addUser($fname, $lname, $email, $randpass, 1); if ($worked) { $address = "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; $address = substr($address, 0, -9); $body = "Hello, ".$_POST['fname']."! You have been added as a user to Syllogistek, the". " Argument Library Software. Please login to the system ". "at ".$address.". The password generated for you is:\n\n\t".$randpass."\n\nYou". " may change this password from your user information screen once you log in.". "\n\n\nThis message has been generated automatically. Please do not reply to ". "this message."; $body = wordwrap($body, 70); mail($_POST['gemail'], "Welcome to Syllogistek!", $body, "From: donotreply@syll.net"); $regfail = 2; $user=getUser('Email',$email); $classes = getActiveClasses(true, null); $max = count($classes); for ($n = 0; $n < $max; $n++) { if ($classes[$n]['CourseName'] == "Public") { enrollUser($classes[$n]['ID'],$user['ID']); break; } } } else $regfail = 3; } } //Add super-user? if ($_POST['s_fname']) { $fname = $_POST['s_fname']; $lname = $_POST['s_lname']; $email = $_POST['s_email']; $pass = $_POST['s_pass']; if ($fname != "" && $lname != "" && $email != "" && $pass != "") { $pos = strpos($email, '@'); if ($pos > 0 && $pos < strlen($email)-1) { if ($email !== $_POST['s_emailcon']) $_SESSION['s_error_emailmatch'] = 1; if ($pass !== $_POST['s_passcon']) $_SESSION['s_error_passmatch'] = 1; if (!(isset($_SESSION['s_error_emailmatch']) || isset($_SESSION['s_error_passmatch']))) { $id = addUser($fname, $lname, $email, $pass, -2); $_SESSION['user'] = $id; $_SESSION['admin'] = getAdmin($id); } } else $_SESSION['s_error_bademail'] = 1; } else $_SESSION['s_error_blank'] = 1; } include("header.php"); if (isset($_SESSION['user'])) { if (isActive($_SESSION['user'])) { $user = getUserName($_SESSION['user']); ?> Welcome, !
What would you like to do?

Edit your user profile
"); echo("View users
"); if ($_SESSION['admin'] != 0) { echo("View classes
"); echo("Approve or edit arguments
"); } if ($_SESSION['admin'] >= 0) { echo("Submit an argument
"); echo("View submitted articles
"); } echo(""); if ($_SESSION['admin'] < 0) echo("View arguments
"); else if ($_SESSION['admin'] == 0) echo("Add or edit arguments
"); else if ($_SESSION['admin'] > 0) echo("Add, edit, or view arguments
"); echo("Query Library
"); echo("Log out
"); } else { unset($_SESSION['user']); unset($_SESSION['admin']); echo("Your Syllogistek account has been deactivated by a system administrator.
"); echo("Please contact your instructor in order to reactivate this account."); } } else { $num_users = count(getAllUsers(true)) + count(getAllUsers(false)); if ($num_users > 0) { ?>
Please log in with your registered email and password:
User registration failed!
You have been successfully added as a user to Syllogistek, the Argument Library Software!
Check your email for login information.
Error in database query.
Contact the Syllogistek administrator.
Email:
Password:
This is the first time that Syllogistek has been setup on the server.
Please provide the information below to set up the super-administrator account for this installation:
First Name:
Last Name:
Email: (this will be your login ID)
Confirm Email:
Create Password:
Confirm Password: