summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2011-09-25 22:10:40 -0700
committerLuke Shumaker <lukeshu@sbcglobal.net>2011-09-25 22:10:40 -0700
commitff75fd84aca136360d05e4980a98718b9c4484b0 (patch)
tree77113a752d2f27b20bcdb01e260312357c532d24
parentfd5c709fc7497cca08971724a3c0d4bc6fefa39f (diff)
Don't let a logged in user go through new-user registration.
-rw-r--r--src/controllers/Users.class.php4
-rw-r--r--src/views/pages/users/new-logged-in.html.php8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/controllers/Users.class.php b/src/controllers/Users.class.php
index 2461f65..52fd33c 100644
--- a/src/controllers/Users.class.php
+++ b/src/controllers/Users.class.php
@@ -59,6 +59,10 @@ class Users extends Controller {
public function new_user($routed, $vars) {
// since there will never be a remainder to `users/new', we can
// use that parameter to pass in some data.
+ if (Login::isLoggedIn()) {
+ $this->showView('users/new-logged-in', array());
+ exit();
+ }
if (!isset($vars['errors'])) $vars['errors'] = array();
global $mm; $pm = $mm->pluginManager();
$vars['antispam_html'] = $pm->callHook('antispam_html');
diff --git a/src/views/pages/users/new-logged-in.html.php b/src/views/pages/users/new-logged-in.html.php
new file mode 100644
index 0000000..51823fe
--- /dev/null
+++ b/src/views/pages/users/new-logged-in.html.php
@@ -0,0 +1,8 @@
+<?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();