getAuthObj($uid); if (!$user->canRead()) { include(VIEWPATH.'/pages/users/401.php'); exit(); } // Read/Change the username $username = $user->getName(); if (isset($_POST['auth_name'])) { $new_name = $_POST['auth_name']; if ($new_name != $username) { global $illegal_names; if (!in_array($new_name, $illegal_names)) { $changed_name = $user->setName($new_name); $username = $user->getName(); } } } //////////////////////////////////////////////////////////////////////////////// $t = $mm->template(); $mm->header("Users: $username"); $t->tag('h1', array(), ($user->canEdit()?'Edit':'View')." User (UID: $uid)"); if ($user->canEdit()) { $t->openTag('form', array('method'=>'post', 'action'=>$mm->baseUrl()."users/$username")); } else { $t->openTag('form'); } $t->openFieldset("Login / Authentication"); if (isset($changed_name) && !$changed_name) { $t->inputP("Error setting username to ". "$new_name. This is probably because". " a user with that name already exists.", true); } $t->inputText('auth_name','Username', "This is the name you use to log in, but it is also a ". "short name that is used in various places, think of it ". "as a sort of Twitter name.", $username,!$user->canEdit()); if ($user->canEdit()) inputNewPassword($user, 'auth_password','Reset Password'); $t->closeFieldset(); $t->openFieldset("Information"); inputText($user, 'firstname','First Name',''); inputText($user, 'lastname','Last Name',''); inputText($user, 'hsclass','Highschool Class of','Please put the full year (ex: 2012)'); $t->closeFieldset(); $t->openFieldset("Contact"); inputText($user, 'email', 'Email', "Right now you can only have one email address, ". "but I'm working on making it so you can have ". "multiple."); inputText($user, 'phone', 'Cell Number', "A home phone number isn't much use here because it is ". "used to text-message you (if you enable it), and ". "contact you at competition."); $t->inputP("When I recieve a message, notify me using the following methods:"); inputArray($user, 'use', array('email'=>'Email', 'sms'=>'Text Message')); $t->closeFieldSet(); $t->openFieldSet('Groups'); $groups = $mm->listGroupNames(); $group_arr = array(); foreach ($groups as $group_name) { $group_arr[$group_name] = ucwords($group_name); } inputArray($user, 'groups', $group_arr); $t->closeFieldset(); if ($user->canEdit()) { $t->tag('input', array('type'=>'submit', 'value'=>'Save')); } $t->closeTag('form'); $mm->footer();