diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-01-07 08:21:00 -0800 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-01-07 10:22:21 -0800 |
commit | 83e460cdc3fc09867a3adb48c3d0894579dd3050 (patch) | |
tree | 0771bd935b30971bf2c244b6f158ed7496b644e5 /src/views/pages | |
parent | 3d64793a1ee45857856be1cd71c3a0a040a3e869 (diff) |
Refactor to separate the framework from the app; drop message stuff, this app is just user management. Add a json view for individual users
Diffstat (limited to 'src/views/pages')
23 files changed, 0 insertions, 683 deletions
diff --git a/src/views/pages/auth/badrequest.html.php b/src/views/pages/auth/badrequest.html.php deleted file mode 100644 index c1fe726..0000000 --- a/src/views/pages/auth/badrequest.html.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->status('400 Bad Request'); -$t->header('Authentication'); -$t->paragraph('The recieved POST request was malformed/invalid. '. - 'If you got here from a link, this is a bug; '. - 'Let the admin know.'. - 'If you got here from outside, then the API is being '. - 'used incorrectly.'); -$t->footer(); diff --git a/src/views/pages/auth/index.html.php b/src/views/pages/auth/index.html.php deleted file mode 100644 index ac80140..0000000 --- a/src/views/pages/auth/index.html.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; -$username = $VARS['username']; - -$t->header('Authentication'); - -$t->openTag('div',array('class'=>'login')); -$t->text("Logged in as ".htmlentities($username).'.'); -$t->logout_button('Logout'); -$t->closeTag('div'); - -$t->footer();
\ No newline at end of file diff --git a/src/views/pages/auth/login.html.php b/src/views/pages/auth/login.html.php deleted file mode 100644 index a246a9e..0000000 --- a/src/views/pages/auth/login.html.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; -$username = $VARS['username']; -$password = $VARS['password']; - -$t->header('Authentication'); - -$t->openTag('form',array('action'=>$t->url('auth'), 'method'=>"post")); -$t->openFieldset('Login'); -switch ($VARS['login_code']) { -case -1: break; -case 0: - $t->inputP('Successfully logged in as '. - htmlentities($username).'.'); - if (isset($VARS['url'])) { - $url = htmlentities($VARS['url']); - $t->inputP($t->link($url, - 'Return to the page you were on.', - true)); - } - $t->closeFieldset(); - $t->closeTag('form'); - return; - break; -case 1: - $t->inputP("Password does not match username.", - array('class'=>'error')); - break; -case 2: - $t->inputP("Username <q>$username</q> does not exist."); - $username = ''; - break; -} -$t->inputText( 'username', 'Username:', '', $username); -$t->inputPassword('password', 'Password:', '', $password); -$t->openTag('li'); -$t->tag('input', array('type'=>'submit', 'value'=>'Login')); -$t->closeTag('li'); -$t->closeFieldset(); -$t->tag('input', array('type'=>'hidden', - 'name'=>'action', - 'value'=>'login')); -if (isset($VARS['url'])) { - $url = htmlentities($VARS['url']); - $t->tag('input', array('type'=>'hidden', - 'name'=>'url', - 'value'=>$url)); -} -$t->closeTag('form'); diff --git a/src/views/pages/auth/logout.html.php b/src/views/pages/auth/logout.html.php deleted file mode 100644 index 2d00998..0000000 --- a/src/views/pages/auth/logout.html.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->header('Authentication'); -$t->paragraph('Logged out'); -$t->footer(); diff --git a/src/views/pages/groups/401.html.php b/src/views/pages/groups/401.html.php deleted file mode 100644 index 23e3778..0000000 --- a/src/views/pages/groups/401.html.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->status('401 Unauthorized'); -$t->header('Unauthorized'); -$t->tag('h1', array(), "401: Unauthorized"); -if ($VARS['uid']===false) { - // Not logged in - $t->paragraph('You need to be logged in to view group-data.'); -} else { - // Logged in, so the account must not activated - $t->paragraph('Your account needs to be activated by an administrator '. - 'to group-data.'); -} -$t->footer(); diff --git a/src/views/pages/http404.html.php b/src/views/pages/http404.html.php deleted file mode 100644 index 730b0ee..0000000 --- a/src/views/pages/http404.html.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$routed = implode('/', $VARS['routed']); -$remainder = implode('/', $VARS['remainder']); -$full = $routed.'/'.$remainder; - -$t->status('404 Not Found'); -$t->header('Page Not Found'); -$t->tag('h1',array(),"404: Not Found"); -$t->paragraph("Awe man, the page you requested wasn't found."); -$t->paragraph('This folder was found: '. - '<tt>'.$t->link($t->url($routed), $routed.'/', true).'</tt>'); -$t->paragraph("But this file in it wasn't: ". - '<tt>'.$full.'</tt>'); -$t->footer(); diff --git a/src/views/pages/index.html.php b/src/views/pages/index.html.php deleted file mode 100644 index 71b0091..0000000 --- a/src/views/pages/index.html.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->header('Main Page'); -$t->tag('h1', array(), "Message Manager"); -$t->paragraph($t->link($t->url('users/new'),'Register to be on the team', true), array('style'=>'font-size:5em')); -$t->link($t->url('users'), 'List of all users'); -$t->footer(); diff --git a/src/views/pages/messages/401.html.php b/src/views/pages/messages/401.html.php deleted file mode 100644 index 0b24f80..0000000 --- a/src/views/pages/messages/401.html.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->status('401 Unauthorized'); -$t->header('Unauthorized'); -$t->tag('h1', array(), "401: Unauthorized"); -if ($VARS['uid']===false) { - // Not logged in - $t->paragraph('You need to be logged in to view messages.'); -} else { - // Logged in, so the account must not activated - $t->paragraph('Your account needs to be activated by an administrator '. - 'to view messages.'); -} -$t->footer(); diff --git a/src/views/pages/messages/frame.html.php b/src/views/pages/messages/frame.html.php deleted file mode 100644 index e64bc2f..0000000 --- a/src/views/pages/messages/frame.html.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; -$msg_id = $VARS['msg_id']; -$parser = $VARS['parser']; -$msgdir = $VARS['msgdir']; - -function messageLink($id) { - if (is_array($id)) { $id = $id[1]; } - global $VARS; $t = $VARS['template']; $msgdir = $VARS['msgdir']; - $exists = is_file("$msgdir/$id"); - $class = - $id = htmlentities($id); - return sprintf('<<a href="%1$s"%2$s>%3$s</a>>', - $t->url("messages/$id/"), - ($exists?'':' class="http404"'), - $id); -} -function parseMessageIDs($string) { - $base = $_SERVER['REQUEST_URL']; - $html = preg_replace_callback( - '/<([^>]*)>/', - 'messageLink', - $string); - return $html; -} - -$t->header('View Message'); -$t->openTag('table'); -$t->row(array('To:' , htmlentities( $parser->getHeader('to' )))); -$t->row(array('From:' , htmlentities( $parser->getHeader('from' )))); -$t->row(array('Subject:' , htmlentities( $parser->getHeader('subject' )))); -$t->row(array('In-Reply-to:', parseMessageIDs($parser->getHeader('in-reply-to')))); -$t->row(array('References:' , parseMessageIDs($parser->getHeader('references' )))); -$t->closeTag('table'); - -$t->openTag('div', array('class'=>'message-body')); -if ($parser->getMessageBodyPart('html')!==false) { - $t->tag('h2', array(), 'HTML'); - $t->tag('iframe', array('src'=>$t->url("messages/$msg_id/body.html")), ''); -} -if ($parser->getMessageBodyPart('text')!==false) { - $t->tag('h2', array(), 'Plain Text'); - $t->tag('iframe', array('src'=>$t->url("messages/$msg_id/body.txt")), ''); -} -$t->closeTag('div'); -$t->tag('h2', array(), 'Attachments'); -$t->openTag('table'); -$attachments = $parser->getAttachments(); -foreach ($attachments as $id => $attachment) { - $t->row(array( - htmlentities($attachment->getContentType()), - $t->link($t->url("$msg_id/attachment/$id"), - htmlentities($attachment->getFilename())), - )); -} -$t->closeTag('table'); -$t->footer(); diff --git a/src/views/pages/messages/index.html.php b/src/views/pages/messages/index.html.php deleted file mode 100644 index 111b6c6..0000000 --- a/src/views/pages/messages/index.html.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; -$messages = $VARS['messages']; - -$t->header('Message Index'); -$t->tag('h1', array(), "Message Index"); - -$t->openTag('table'); -$t->row(array('From','Subject', 'Date')); -foreach ($messages as $date => $message_array) { - foreach ($message_array as $message) { - $url = $t->url('messages/'.$message['id'].'/'); - $subject = htmlentities($message['subject']); - $from = htmlentities($message['from']); - $date_str = str_replace(' ', ' ', date('Y-m-d H:i:s',$date)); - $t->row(array( - $t->link($url, $from , true), - $t->link($url, $subject , true), - $t->link($url, $date_str, true), - )); - } -} -$t->closeTag('table'); - -$t->footer(); diff --git a/src/views/pages/no-conf.html.php b/src/views/pages/no-conf.html.php deleted file mode 100644 index 1f4e3d3..0000000 --- a/src/views/pages/no-conf.html.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->header('Message Manager'); -$t->paragraph('Awe shiz, dude, conf.php doesn\'t exist, you '. - 'need to go through the '. - '<a href="installer">installer</a>.'); -$t->footer(); diff --git a/src/views/pages/plugins/401.html.php b/src/views/pages/plugins/401.html.php deleted file mode 100644 index 5b1b222..0000000 --- a/src/views/pages/plugins/401.html.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->status('401 Unauthorized'); -$t->header('Unauthorized'); -$t->tag('h1',array(),"401: Unauthorized"); -$t->paragraph('You need to be logged in as an admin to edit global plugin '. - 'settings.'); -$t->footer(); diff --git a/src/views/pages/plugins/index.html.php b/src/views/pages/plugins/index.html.php deleted file mode 100644 index b182288..0000000 --- a/src/views/pages/plugins/index.html.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php global $VARS; -require_once('Database.class.php'); -$t = $VARS['template']; -$plugins = $VARS['plugins']; -$db = Database::getInstance(); - -$t->header('Administrator Plugin Management'); -$t->openTag('form',array('method'=>'post','action'=>$t->url('plugins'))); - -foreach ($plugins as $plugin) { - $t->setRet(true); - $props = array('type'=>'checkbox', - 'name'=>'plugins[]', - 'id'=>'plugins_'.$plugin['name'], - 'value'=>$plugin['name']); - if ($plugin['active']==true) { - $props['checked'] = 'checked'; - } - $box = $t->tag('input', $props); - $t->setRet(false); - $t->openFieldset($plugin['name'].$box); - - $t->inputP($plugin['description']); - foreach ($plugin['config'] as $param => $type) { - $name = $plugin['key'].'['.$param.']'; - $value = $db->getPluginConf($plugin['name'], $param); - $hint = "Type: $type"; - switch ($type) { - case 'text': - case 'int': - $t->inputText( $name, $param, $hint, $value); break; - case 'password': - $t->inputPassword($name, $param, $hint, $value); break; - } - } - $t->closeFieldset(); -} - -$t->tag('input', array('type'=>'submit', - 'value'=>'Save/Update')); -$t->closeTag('form'); -$t->footer(); diff --git a/src/views/pages/users/401.html.php b/src/views/pages/users/401.html.php deleted file mode 100644 index 0a5a1ce..0000000 --- a/src/views/pages/users/401.html.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->status('401 Unauthorized'); -$t->header('Unauthorized'); -$t->tag('h1', array(), "401: Unauthorized"); -if ($VARS['uid']===false) { - // Not logged in - $t->paragraph('You need to be logged in to view user-data.'); -} else { - // Logged in, so the account must not activated - $t->paragraph('Your account needs to be activated by an administrator '. - 'to view user-data.'); -} -$t->footer(); diff --git a/src/views/pages/users/404.html.php b/src/views/pages/users/404.html.php deleted file mode 100644 index 00f9dca..0000000 --- a/src/views/pages/users/404.html.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; -$username = $VARS['username']; - -$t->status('404 Not Found'); -$t->header('User Not Found'); -$t->tag('h1',array(),"404: Not Found"); -$t->paragraph('No user with the name <q>'. - htmlentities($username).'</q> exists.'); -$t->footer(); diff --git a/src/views/pages/users/500.html.php b/src/views/pages/users/500.html.php deleted file mode 100644 index 339fe63..0000000 --- a/src/views/pages/users/500.html.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php global $VARS; -require_once('Database.class.php'); -$t = $VARS['template']; -$db = Database::getInstance(); - -$t->status('500 Internal Server Error'); -$t->header('Unknown error'); -$t->paragraph("An unknown error was encountered when creating ". - "the user. The username appears to be free, and ". - "the passwords match, so I'm assuming that the ". - "error is on our end. Sorry."); -$t->paragraph("Here's a dump of the SQL error stack, it may ". - "help us find the issue:"); -$t->tag('pre', array(), htmlentities($db->mysql_error())); -$t->footer(); diff --git a/src/views/pages/users/created.html.php b/src/views/pages/users/created.html.php deleted file mode 100644 index d3027cc..0000000 --- a/src/views/pages/users/created.html.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; -$username = $VARS['username']; - -//$t->status('201 Created'); -header('Location: '.$t->url("users/$username")); -$t->header('User created'); -/*$t->paragraph("You can go ahead and fill out more of your ". - "user information, (click the @username link at ". - "the top) but will need to wait for an ". - "administrator to approve your account before ". - "you can really use the site. Actually, ". - "filling your info out might help approval, so ". - "that the administrator can more easily see who ". - "you are."); -*/ -$t->tag('h2',array(), $t->link($t->url("users/$username"), 'Go on to step 2')); -$t->footer(); diff --git a/src/views/pages/users/index.csv.php b/src/views/pages/users/index.csv.php deleted file mode 100644 index 0a69cee..0000000 --- a/src/views/pages/users/index.csv.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php global $VARS; -$attribs = $VARS['attribs']; -$users = $VARS['users']; - -function escape($value) { - if (is_bool($value)) { - return ($value?'true':'false'); - } else { - $chars = "'" . '"' . '\\' . ','; - return addcslashes($value, $chars); - } -} - -$arr = array(); -foreach ($attribs as $attrib) { - $arr[] = escape($attrib['name']); -} -echo implode(',', $arr)."\n"; - -foreach ($users as $user) { - $arr = array(); - foreach ($attribs as $attrib) { - $props = $user[$attrib['key']]; - $arr[] = escape($props['value']); - } - echo implode(',', $arr)."\n"; -} diff --git a/src/views/pages/users/index.html.php b/src/views/pages/users/index.html.php deleted file mode 100644 index 159ff76..0000000 --- a/src/views/pages/users/index.html.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; -$attribs = $VARS['attribs']; -$users = $VARS['users']; -require_once('Login.class.php'); - -$t->header('Users'); - -$t->paragraph($t->link($t->url('users.csv'), "Download this as a spreadsheet.", true)); - -$t->openTag('form', array('action'=>$t->url('users/index'), - 'method'=>'post')); - -if (Login::isLoggedIn()) { - $t->tag('input', array('type'=>'submit', - 'value'=>'Save/Update')); -} - -$t->openTag('table', array('class'=>'sortable', 'id'=>'bar')); - -function table_head($attribs, $t) { - $t->openTag('tr'); - foreach ($attribs as $attrib) { - switch ($attrib['type']) { - case 'bool': $class = 'small'; break; - default: $class = ''; break; - } - $t->tag('th', array('class'=>$class), $attrib['name']); - } - if (Login::isLoggedIn()) { - $t->tag('th', array(), '-'); - } - $t->closeTag('tr'); -} - -$t->openTag('thead'); -table_head($attribs, $t); -$t->closeTag('thead'); - -$t->openTag('tfoot'); -table_head($attribs, $t); -$t->closeTag('tfoot'); - -$t->openTag('tbody'); - -foreach ($users as $user) { - $t->openTag('tr'); - - foreach ($attribs as $attrib) { - $t->openTag('td'); - - $props = $user[$attrib['key']]; - - $bool = $attrib['type']=='bool'; - if ($bool) { - $value = $props['value']=='true'; - } else { - $value = $props['value']; - } - $editable = $props['editable']; - $post_key = $props['post_key']; - - $arr = array('name'=>$post_key); - if (!$editable) { - $arr['readonly'] = 'readonly'; - if ($bool) $arr['disabled'] = $disabled; - } - if ($bool) { - $t->tag('input', array('type'=>'hidden', 'name'=>$post_key, 'value'=>'false')); - if ($value==true) { - $arr['checked'] = 'checked'; - } - $arr['value'] = 'true'; - $arr['type'] = 'checkbox'; - } else { - $t->tag('span', array('class'=>'cell_width'), $value); - $arr['value'] = $value; - $arr['type'] = 'text'; - } - - $t->tag('input', array('name'=>'_old['.$arr['name'].']', - 'value'=>$arr['value'], - 'type'=>'hidden')); - $t->tag('input', $arr); - $t->closeTag('td'); - } - - if (Login::isLoggedIn()) { - $t->openTag('td'); - $t->link($t->url('users/'.$user['auth_name']['value']), 'More'); - $t->closeTag('td'); - } - $t->closeTag('tr'); -} - -$t->closeTag('tbody'); -$t->closeTag('table'); - -if (Login::isLoggedIn()) { - $t->tag('input', array('type'=>'submit', - 'value'=>'Save/Update')); -} - -$t->footer(); diff --git a/src/views/pages/users/individual.html.php b/src/views/pages/users/individual.html.php deleted file mode 100644 index 39360b7..0000000 --- a/src/views/pages/users/individual.html.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php global $VARS, $CONTACT_METHODS; -$t = $VARS['template']; -$users = $VARS['users']; -$username = $VARS['username']; - -function inputText($user, $key, $label, $hint='') { - global $VARS; $t = $VARS['template']; - $current_setting = $user->getConf($key); - $t->inputText("user_$key", $label, $hint, $current_setting, - !$user->canEdit()); -} -function inputTextarea($user, $key, $label, $hint='') { - global $VARS; $t = $VARS['template']; - $current_setting = $user->getConf($key); - $t->inputTextarea("user_$key", $label, $hint, $current_setting, - !$user->canEdit()); -} - -function inputBool($user, $key, $label, $hint='') { - global $VARS; $t = $VARS['template']; - $current_setting = $user->getConf($key)=='true'; - $t->inputBool("user_$key", $label, $hint, $current_setting, - !$user->canEdit()); -} - -function inputArray($user, $key, $arr) { - global $VARS; $t = $VARS['template']; - $defaults = $user->getConfArray($key); - - foreach ($arr as $value => $label) { - $t->inputBoolArray($key, $value, $label, - in_array($value, $defaults), !$user->canEdit()); - } -} - -function inputField($user, $arr) { - $fieldname = $arr[0]; - $fieldlabel = $arr[1]; - $fieldtype = $arr[2]; - - switch ($fieldtype) { - case 'text': - inputText($user, $fieldname, $fieldlabel, ''); - break; - case 'textarea': - inputTextarea($user, $fieldname, $fieldlabel, ''); - break; - case 'paragraph': - global $VARS; $t = $VARS['template']; - $t->inputP($fieldlabel); - break; - case 'checkbox': - inputBool($user, $fieldname, $fieldlabel, ''); - break; - } -} - -//////////////////////////////////////////////////////////////////////////////// - -if (count($users)>1) { - $t->header("Users: $username"); -} else { - $t->header("User: $username"); -} - -foreach($users as $user) { -$username = $user->getName(); - -$t->tag('h1', array(), ($user->canEdit()?'Edit':'View')." User <q>$username</q> (UID: ".$user->getUID().")"); - -if ($user->canEdit()) { - $t->openTag('form', array('method'=>'post', - 'action'=>$t->url("users/$username"))); -} else { - $t->openTag('form'); -} - -$t->openFieldset("Login / Authentication"); -// Username //////////////////////////////////////////////////////////////////// -if (isset($VARS['changed name']) && !$VARS['changed name']) { - $t->inputP("Error setting username to ". - "<q>$new_name</q>. 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 <q>Twitter name</q>.", - $user->getName(), !$user->canEdit()); -// Password //////////////////////////////////////////////////////////////////// -if (@$VARS['pw_updated']===true) { - $t->inputP('Password successfully updated.'); -} -if (@$VARS['pw mixmatch']===true) { - $t->inputP("Passwords don't match.", true); -} -if ($user->canEdit()) $t->inputNewPassword('auth_password','Reset Password'); -//////////////////////////////////////////////////////////////////////////////// -$t->closeFieldset(); - -$t->openFieldset("Contact"); -// TODO: I should make this a setting for admins to set. -$hints = array('email'=> - "Right now you can only have one email address, ". - "but I'm working on making it so you can have ". - "multiple.", - 'phone'=> - "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." - ); -$use_arr = array(); -foreach ($CONTACT_METHODS as $method) { - inputText($user, - $method->addr_slug, - ucwords($method->addr_text), - $hints[$method->addr_slug]); - $use_arr[$method->verb_slug] = ucwords($method->verb_text); -} - -$t->inputP("When I recieve a message, notify me using the following methods:"); -inputArray($user, 'use', $use_arr); -$t->closeFieldSet(); - -foreach ($VARS['config_options'] as $groupname=>$options) { - $t->openFieldset($groupname); - foreach ($options as $option) { - inputField($user, $option); - } - $t->closeFieldset(); -} - -$t->openFieldSet('Groups'); -$group_arr = array(); -foreach ($VARS['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'); -} -$t->footer(); diff --git a/src/views/pages/users/new-locked.html.php b/src/views/pages/users/new-locked.html.php deleted file mode 100644 index dc7ad0d..0000000 --- a/src/views/pages/users/new-locked.html.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->status('403 Forbidden'); -$t->header('Create new user'); - -$t->paragraph("Sorry, new user registration is disabled."); - -$t->footer(); diff --git a/src/views/pages/users/new-logged-in.html.php b/src/views/pages/users/new-logged-in.html.php deleted file mode 100644 index 51823fe..0000000 --- a/src/views/pages/users/new-logged-in.html.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->header('Create new user'); - -$t->paragraph("Dude, you're logged in, what are you doing creating an account?"); - -$t->footer(); diff --git a/src/views/pages/users/new.html.php b/src/views/pages/users/new.html.php deleted file mode 100644 index 9df376f..0000000 --- a/src/views/pages/users/new.html.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php global $VARS; -$t = $VARS['template']; - -$t->header('Create new user'); - -$t->openTag('form', array('method'=>'post', - 'action'=>$t->url('users'))); - -$t->openFieldset("New User: Step 1"); - -if ($VARS['userlist']) { - $t->inputP("If you may have already created a username, please, ". - "<em>please</em> check the ". - $t->link($t->url('users/'), 'user-list', true). - " to find your old username, instead of creating a new ". - "user. If you don't like the name, you can log in and ". - "change it."); -} - -if (in_array('illegal name', $VARS['errors'])) { - $t->inputP("That is a forbidden username.", true); -} -if (in_array('user exists', $VARS['errors'])) { - $t->inputP("A user with that name already exists."); -} -$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 <q>Twitter name</q>.",$VARS['username']); - -@$password = $VARS['password1']; -if (in_array('pw mixmatch', $VARS['errors'])) { - $t->inputP("The passwords didn't match.", true); - $password = ''; -} -if (in_array('no pw', $VARS['errors'])) { - $t->inputP("You must set a password.", true); - $password = ''; -} -$t->inputNewPassword('auth_password','Password', $password); - -if (in_array('no email', $VARS['errors'])) { - $t->inputP("You must provide an email address.", true); -} -$t->inputText('user_email', 'Email Address', - 'This is so that we can contact you. (duh).', $VARS['email']); -$t->closeFieldset(); - -foreach ($VARS['antispam_html'] as $html) { - echo $html; -} - -$t->tag('input', array('type'=>'submit', 'value'=>'Go on to Step 2')); - -$t->closeTag('form'); - -$t->footer(); |